Search
[Flutter/dart] Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because ...
- M.R
- Jul 10, 2023
- 1 min read
Phenomenon
When I try to build with Flutter I get the following error
Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null
By following the log, it seems that flutter_redux is issuing it.
The environment is Flutter 3.7.0, flutter_redux 0.10.0
Cause and Solution
I don't know the exact cause, but it seems to be a compatibility issue between the versions of Flutter and the flutter_redux library.
When I dropped flutter_redux to 0.9.0, the above error did not occur and I was able to build successfully.
Reference
https://github.com/brianegan/flutter_redux/issues/233
Comments