Home > Mobile >  Errors after updating Flutter to the latest version
Errors after updating Flutter to the latest version

Time:05-03

I updated Flutter to the latest version and since updating I have been getting these errors:

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/persistent_bottom_nav_bar-4.0.2/lib/persistent-tab-view.widget.dart:368:22: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').
      WidgetsBinding.instance!.addPostFrameCallback((_) {

                     ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/persistent_bottom_nav_bar-4.0.2/lib/animations/animations.dart:55:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/persistent_bottom_nav_bar-4.0.2/lib/nav-bar-styles/style-6-bottom-nav-bar.widget.dart:44:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {

                   ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/persistent_bottom_nav_bar-4.0.2/lib/nav-bar-styles/style-8-bottom-nav-bar.widget.dart:44:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {

                   ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/persistent_bottom_nav_bar-4.0.2/lib/nav-bar-styles/style-11-bottom-nav-bar.widget.dart:46:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {

                   ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/persistent_bottom_nav_bar-4.0.2/lib/nav-bar-styles/style-12-bottom-nav-bar.widget.dart:46:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/persistent_bottom_nav_bar-4.0.2/lib/nav-bar-styles/style-13-bottom-nav-bar.widget.dart:46:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/persistent_bottom_nav_bar-4.0.2/lib/nav-bar-styles/style-14-bottom-nav-bar.widget.dart:46:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').

    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/getwidget-2.0.5/lib/components/sticky_header/gf_sticky_header_builder.dart:63:28: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').

            WidgetsBinding.instance?.endOfFrame.then((_) {
                           ^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flare_flutter-3.0.2/lib/flare_render_box.dart:167:26: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/scheduler/binding.dart').
        SchedulerBinding.instance?.cancelFrameCallbackWithId(_frameCallbackID);
                         ^

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flare_flutter-3.0.2/lib/flare_render_box.dart:170:28: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/scheduler/binding.dart').
          SchedulerBinding.instance?.scheduleFrameCallback(_beginFrame) ?? -1;
                           ^

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flare_flutter-3.0.2/lib/flare_render_box.dart:272:26: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/scheduler/binding.dart').

        SchedulerBinding.instance?.cancelFrameCallbackWithId(_frameCallbackID);
                         ^

flutter doctor:

[√] Flutter (Channel dev, 2.13.0-0.3.pre, on Microsoft Windows [Version 10.0.19043.1645], locale tr-TR)
[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.13)
[√] Android Studio (version 2021.1)
[√] VS Code (version 1.66.2)
[√] Connected device (4 available)
[√] HTTP Host Availability

• No issues found!

I upgraded Flutter with flutter upgrade. I started getting these errors after upgrading. I searched a lot but couldn't find a solution. What is the problem? How can I solve it? I appreciate your help in advance.

CodePudding user response:

check "null-safety" checks dude.

CodePudding user response:

Seems like you didn't updated the dependencies of your project. Take look at your pubspec.yaml and update all third-party dependencies. Also try to run "flutter pub outdated" from the root of your project.

  • Related