brianegan / flutter_redux

A library that connects Widgets to a Redux Store
MIT License
1.65k stars 219 forks source link

Warning related to `?` operator on Linux/Dev channel. #228

Closed luleyleo closed 2 years ago

luleyleo commented 2 years ago

After updating my flutter installation (Channel beta, 2.12.0-4.2.pre), I get the following warnings:

Launching lib/main.dart on Linux in debug mode...
ERROR: ../../../Apps/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_redux-0.9.0/lib/flutter_redux.dart:474:22: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
ERROR:  - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../Apps/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR:       WidgetsBinding.instance?.addPostFrameCallback((_) {
ERROR:                      ^
ERROR: ../../../Apps/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_redux-0.9.0/lib/flutter_redux.dart:577:22: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
ERROR:  - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../Apps/flutter/packages/flutter/lib/src/widgets/binding.dart').
ERROR:       WidgetsBinding.instance?.addPostFrameCallback((_) {
ERROR:                      ^

Apparently, WidgetsBinding.instance will return a not-null value in the future.

brianegan commented 2 years ago

Thanks! Publish 0.10.0-beta.1 to fix this up.

brianegan commented 2 years ago

Oops, didn't mean to close. I'll close this one out once the WidgetsBinding.instance change is on Flutter stable and we can publish 0.10.0 properly.