omarhurani/flutter_painter

Widgets binding error after upgrading flutter version to 2.13.0-0.1.pre

Opened this issue · 1 comments

I'm facing below warnings since I upgraded the flutter version to 2.13.0-0.1.pre.

Warnings:

Testing started at 10:59 AM ...
                      ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_painter-1.0.1/lib/src/views/widgets/text_widget.dart:32:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
                   ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_painter-1.0.1/lib/src/views/widgets/text_widget.dart:195:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
                   ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_painter-1.0.1/lib/src/views/widgets/text_widget.dart:205:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.addObserver(this);
                   ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_painter-1.0.1/lib/src/views/widgets/text_widget.dart:211:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.removeObserver(this);
                   ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_painter-1.0.1/lib/src/views/widgets/text_widget.dart:279:34: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../flutter/packages/flutter/lib/src/widgets/binding.dart').
    final value = WidgetsBinding.instance?.window.viewInsets.bottom;
                                 ^
../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_painter-1.0.1/lib/src/views/widgets/object_widget.dart:107:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.addPostFrameCallback((timestamp) {
                   ^
../../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.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../flutter/packages/flutter/lib/src/widgets/binding.dart').
      WidgetsBinding.instance?.addPostFrameCallback((_) {
                     ^
../../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.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../flutter/packages/flutter/lib/src/widgets/binding.dart').
      WidgetsBinding.instance?.addPostFrameCallback((_) {
                     ^

Flutter version:

Flutter 2.13.0-0.1.pre • channel unknown • unknown source
Framework • revision 13a2fb10b8 (8 days ago) • 2022-04-12 15:34:25 -0500
Engine • revision 499984f99c
ToolsDart 2.17.0 (build 2.17.0-266.1.beta) • DevTools 2.12.1
k-85 commented

Facing loss of background on renderImage(size). Seems related to WidgetsBinding issue as mentioned above. Started getting issue after flutter upgrade to 3.0

- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/home/system/snap/flutter/common/flutter/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
    WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
                   ^

/home/system/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_painter-1.0.1/lib/src/views/widgets/text_widget.dart:195:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/home/system/snap/flutter/common/flutter/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
    WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
                   ^
/home/system/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_painter-1.0.1/lib/src/views/widgets/text_widget.dart:205:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/home/system/snap/flutter/common/flutter/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
    WidgetsBinding.instance?.addObserver(this);
                   ^

/home/system/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_painter-1.0.1/lib/src/views/widgets/text_widget.dart:211:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/home/system/snap/flutter/common/flutter/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
    WidgetsBinding.instance?.removeObserver(this);
                   ^

/home/system/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_painter-1.0.1/lib/src/views/widgets/text_widget.dart:279:34: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/home/system/snap/flutter/common/flutter/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
    final value = WidgetsBinding.instance?.window.viewInsets.bottom;

                                 ^
/home/system/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_painter-1.0.1/lib/src/views/widgets/object_widget.dart:107:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/home/system/snap/flutter/common/flutter/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
    WidgetsBinding.instance?.addPostFrameCallback((timestamp) {
                   ^