Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for flutter 3.0.0 #3

Open
danjoemybro opened this issue Jun 8, 2022 · 0 comments · May be fixed by #4
Open

Update for flutter 3.0.0 #3

danjoemybro opened this issue Jun 8, 2022 · 0 comments · May be fixed by #4

Comments

@danjoemybro
Copy link

danjoemybro commented Jun 8, 2022

Flutter 3.0.0 issue

There is a current issue with Flutter 3 where the instance of scheduler binding has become non-nullable. Could a hot-fix be made to this package for the latest update?

The Error:

/usr/local/Caskroom/flutter/2.10.5/flutter/.pub-cache/hosted/pub.dartlang.org/autoscale_tabbarview-1.0.2/lib/src/size_detector_widget.dart:24:22: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/usr/local/Caskroom/flutter/2.10.5/flutter/packages/flutter/lib/src/scheduler/binding.dart').
package:flutter/…/scheduler/binding.dart:1
    SchedulerBinding.instance?.addPostFrameCallback((_) => _detectSize());
                     ^

The potential fix:

The line that needs to change is on line 24 within size_detector_widget.dart where the '?' just has to be removed.

From this:

SchedulerBinding.instance?.addPostFrameCallback((_) => _detectSize());

To this:

SchedulerBinding.instance.addPostFrameCallback((_) => _detectSize());
@gilice gilice linked a pull request Jul 3, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant