Comments (5)
It's not quite the same -- if you read, it's actually the opposite haha.
In the reported issue above, the error is:
Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
In your report, the error is:
Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.
I hope you can understand, but as Flutter updates, so must this library. In this case, Flutter has made a breaking change, this library has adapted to support that change.
If you need to support Flutter 2, the previous versions should work, but sadly I do not have time to backport bug fixes. I'll add a note in the README.
from flutter_redux.
There's already a beta version out which solves this problem , a new version 0.10.0
will also provide a new stable version with this functionality.
from flutter_redux.
@brianegan this issue still occurs on flutter_redux: 0.10.0
and Flutter 2.10.3
from flutter_redux.
@tudor07 Thanks for the report. Is it the exact same error message, or is it complaining that WidgetsBinding.instance must be nullable? Version 0.10.0 was built to support Flutter 3+ and may not work with older versions.
If it's the same message, please look at the code for your local version of flutter_redux 0.10.0 and see if the ?
still exist on line 474 & 576. If it does not, then something odd is happening and I may need to publish a new version.
The local code should be in ~/.pub-cache/hosted/pub.dartlang.org/flutter_redux-0.10.0
.
The two lines that contain Widgetbindings.instance
should look like:
https://github.com/brianegan/flutter_redux/blob/master/lib/flutter_redux.dart#L474
https://github.com/brianegan/flutter_redux/blob/master/lib/flutter_redux.dart#L576
from flutter_redux.
The code is exactly like the one you provided.
The full error message:
../../../../dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_redux-0.10.0/lib/flutter_redux.dart:474:31: Error: Method 'addPostFrameCallback'
cannot be called on 'WidgetsBinding?' because it is potentially null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../dev/flutter/packages/flutter/lib/src/widgets/binding.dart').
Try calling using ?. instead.
WidgetsBinding.instance.addPostFrameCallback((_) {
^^^^^^^^^^^^^^^^^^^^
../../../../dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_redux-0.10.0/lib/flutter_redux.dart:576:31: Error: Method 'addPostFrameCallback'
cannot be called on 'WidgetsBinding?' because it is potentially null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../dev/flutter/packages/flutter/lib/src/widgets/binding.dart').
Try calling using ?. instead.
WidgetsBinding.instance.addPostFrameCallback((_) {
^^^^^^^^^^^^^^^^^^^^
Looks like the library is no longer compatible with Flutter 2 😔
It would be nice to fix this and still being able to use it for folks who didn't upgrade to Flutter 3 yet.
If that is not possible maybe it's worth adding a warning in the docs.
from flutter_redux.
Related Issues (20)
- How to not accept change notifications when the Router is not at the top level, and then take the initiative to obtain the changes when the Router returns to the top level HOT 1
- onDidChange called twice HOT 8
- Is this package still actively maintained?
- `onWillChange` and `onDidChange` errors are swallowed HOT 4
- Warning related to `?` operator on Linux/Dev channel. HOT 2
- Import Store data type
- Widgets binding error after upgrading flutter version to 2.13.0-0.1.pre HOT 1
- onDidChange not working as expected HOT 3
- flutter_redux depends on flutter_redux, version solving failed HOT 3
- onWillChange and onDidChange called twice after state update HOT 2
- Passing Store as an argument to MethodChannel and Background Isolate
- Question on how to use the reducer right way HOT 2
- [Question]: Any thoughts on difference between ignoreChange and distinct?
- Socket and Flutter_redux HOT 18
- Dispatching an action that does not alter state rerenders the widget, causing an infinite loop HOT 5
- How to watch redux store change inside useEffect? HOT 5
- [Question] is it expected that the store doesn't run until frames render? HOT 1
- After push a new page, and Dispatching an action, there is an infinite loop
- Is flutter redux actively maintained HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_redux.