When upgraded to flutter 3.0.0 , there is a problem started to appear when running the app,
(The app works but there are error/s (warning/s) in the terminal).
It seems like a Binding issue.
the error(warning) says: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
../…/src/keyboard_visibility.dart:21
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../fvm/versions/3.0.0/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
WidgetsBinding.instance!.addObserver(this);
^
: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
../…/src/keyboard_visibility.dart:37
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../fvm/versions/3.0.0/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
WidgetsBinding.instance!.removeObserver(this);
^
: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
../…/src/bot_toast_init.dart:15
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../fvm/versions/3.0.0/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
WidgetsBinding.instance!.addObserver(this);
^
: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
../…/src/bot_toast_manager.dart:6
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../fvm/versions/3.0.0/packages/flutter/lib/src/scheduler/binding.dart').
package:flutter/…/scheduler/binding.dart:1
SchedulerBinding.instance!.addPostFrameCallback((_) {
^
: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
../…/src/bot_toast_manager.dart:9
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../fvm/versions/3.0.0/packages/flutter/lib/src/scheduler/binding.dart').
package:flutter/…/scheduler/binding.dart:1
SchedulerBinding.instance!.ensureVisualUpdate();
Edit: - The problem is related to the compatibility of some packages with the flutter 3.0.0
- (There are some changes in flutter 3, so now authors of the packages should be catching up for these changes).
f you see warnings about bindings When migrating to Flutter 3, you might see warnings like the following:
Warning: Operand of null-aware operation '!' has type >'SchedulerBinding' which excludes null.
-for example like the package bot_toast There is an open issue on the GitHub repository of this package https://github.com/MMMzq/bot_toast/issues/133 so the problem should be fixed soon after releasing an update as they said.