Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Fix warnings for Flutter 3.0 - Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null. #765

Closed
wants to merge 6 commits into from

Conversation

fzyzcjy
Copy link

@fzyzcjy fzyzcjy commented May 13, 2022

Detailed warnings:

    ../../../../.pub-cache/git/charts-30477090290b348ed3101bc13017aae465f59017/charts_flutter/lib/src/chart_container.dart:249:27: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
     - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../fvm/versions/3.0.0/packages/flutter/lib/src/scheduler/binding.dart').
        if (!SchedulerBinding.instance!.hasScheduledFrame) {
                              ^
    ../../../../.pub-cache/git/charts-30477090290b348ed3101bc13017aae465f59017/charts_flutter/lib/src/chart_container.dart:250:24: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
     - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../fvm/versions/3.0.0/packages/flutter/lib/src/scheduler/binding.dart').
          SchedulerBinding.instance!.scheduleFrame();
                           ^
    ../../../../.pub-cache/git/charts-30477090290b348ed3101bc13017aae465f59017/charts_flutter/lib/src/chart_container.dart:253:22: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
     - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../fvm/versions/3.0.0/packages/flutter/lib/src/scheduler/binding.dart').
        SchedulerBinding.instance!.addPostFrameCallback(startAnimationController);
                         ^
    ../../../../.pub-cache/git/charts-30477090290b348ed3101bc13017aae465f59017/charts_flutter/lib/src/chart_container.dart:276:22: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
     - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../fvm/versions/3.0.0/packages/flutter/lib/src/scheduler/binding.dart').
        SchedulerBinding.instance!.addPostFrameCallback(doRebuild);

fix #771

@viralkachhadiya
Copy link

viralkachhadiya commented May 13, 2022

@fzyzcjy
Copy link
Author

fzyzcjy commented May 13, 2022

done

@viralkachhadiya
Copy link

viralkachhadiya commented May 13, 2022

must be specify limit new flutter version 3.0.0 in pubspec.yml otherwise those who are not using latest version of 3.0.0, they all are getting error. #764

@fzyzcjy
Copy link
Author

fzyzcjy commented May 13, 2022

done

Copy link

@rickcasson rickcasson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To maintain compatibility while removing warnings, I would recommend using the approach suggested in the Flutter 3.0 release notes: https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.0.0#your-code

charts_flutter/pubspec.yaml Outdated Show resolved Hide resolved
charts_flutter/lib/src/chart_container.dart Outdated Show resolved Hide resolved
charts_flutter/lib/src/chart_container.dart Outdated Show resolved Hide resolved
charts_flutter/example/lib/behaviors/slider.dart Outdated Show resolved Hide resolved
charts_flutter/lib/src/chart_container.dart Show resolved Hide resolved
charts_flutter/lib/src/chart_container.dart Outdated Show resolved Hide resolved
@viralkachhadiya
Copy link

@rickcasson can you close this pr? Bcz @fzyzcjy might be not available and assign me .

@fzyzcjy
Copy link
Author

fzyzcjy commented Jun 6, 2022

Oh I forgot it. Let me update it.

@fzyzcjy
Copy link
Author

fzyzcjy commented Jun 6, 2022

done

@ilovelinux
Copy link

Fix #771

@fzyzcjy
Copy link
Author

fzyzcjy commented Jun 13, 2022

Any updates...?

@lohanbodevan
Copy link

Hey @rickcasson, any idea when it would be released? Thanks ;)

@rickcasson
Copy link

rickcasson commented Jun 27, 2022

@lohanbodevan @fzyzcjy, sorry, no idea. I'm not a maintainer of this repo, and based on the readme, it doesn't sound like they are accepting external contributions anyway...

@blong-sofi
Copy link

@google-admin , @google-ospo-team , gentle bump

@google-admin
Copy link
Member

@google/google-charts-admins can maybe help

@marceloamp2
Copy link

Same issue

@a15056478
Copy link

a15056478 commented Jul 14, 2022

Did anyone find any other solution for this? @google-admin

Copy link

@robinpdev robinpdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks awesome, comments are clear. Would be nice if this got approved

@gfb-47
Copy link

gfb-47 commented Aug 5, 2022

Would be nice if this got approved

Copy link

@a15056478 a15056478 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Copy link

@filippo-veneri filippo-veneri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR is OK

@tushar0518
Copy link

@nshahan can you please look into it? Thank you.

@jatinArhamLabs
Copy link

@rickcasson when this branch gets merged

@DanOxlade
Copy link

+1 for this, this is the last package my app needs to be updated for Flutter 3+

@ilovelinux
Copy link

@DanOxlade you can already upgrade to Flutter 3+. The library does its job, the only annoying thing is a little warning (not error, see PR description) you will get every time you will build an app.

@gfb-47
Copy link

gfb-47 commented Sep 15, 2022

pr is fine, what is the issue?

@stuartmorgan
Copy link
Collaborator

This project is no longer maintained, and cannot accept any PRs. Community members interested in collaborating on a community-maintained fork can coordinate in this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null