Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.2.0 Null check operator used on a null value #457

Closed
HongxiangShe opened this issue Apr 7, 2021 · 4 comments
Closed

V2.2.0 Null check operator used on a null value #457

HongxiangShe opened this issue Apr 7, 2021 · 4 comments

Comments

@HongxiangShe
Copy link

2.2.0版本

 if (_enableFirstRefresh) {
      _firstRefreshHeader = FirstRefreshHeader(widget.firstRefreshWidget!);
      SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
        callRefresh();
      });
    }

当开启firstRefresh后, widget.firstRefreshWidget! 这里会因为把null强制非空而报错, 建议不用‘!’, 除非你非常非常确定他非null值

@HongxiangShe HongxiangShe changed the title version 2.2.0 Null check operator used on a null value V2.2.0 Null check operator used on a null value Apr 7, 2021
@wh8817221
Copy link

我也有同样的问题,作者改一下吧

@sobriver
Copy link

sobriver commented Apr 9, 2021

我也是

@xuelongqy
Copy link
Owner

v2.2.1已修复

@aldaspan
Copy link

aldaspan commented Jun 5, 2022

I have updated flutter_easyrefresh to v2.2.1 and the problem still exists.
`../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/header/refresh_indicator.dart:200:30: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.

  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    if (SchedulerBinding.instance!.schedulerPhase == SchedulerPhase.idle) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/header/refresh_indicator.dart:203:28: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/header/refresh_indicator.dart:675:24: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/header/refresh_indicator.dart:718:28: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    if (SchedulerBinding.instance!.schedulerPhase == SchedulerPhase.idle) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/header/refresh_indicator.dart:721:26: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/header/refresh_indicator.dart:766:30: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/header/refresh_indicator.dart:774:28: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/header/refresh_indicator.dart:788:32: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/header/header.dart:235:22: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/footer/footer.dart:244:22: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/footer/load_indicator.dart:198:30: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    if (SchedulerBinding.instance!.schedulerPhase == SchedulerPhase.idle) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/footer/load_indicator.dart:201:28: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/footer/load_indicator.dart:596:24: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/footer/load_indicator.dart:663:24: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/footer/load_indicator.dart:705:28: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    if (SchedulerBinding.instance!.schedulerPhase == SchedulerPhase.idle) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/footer/load_indicator.dart:708:26: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/footer/load_indicator.dart:751:30: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/footer/load_indicator.dart:759:28: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/footer/load_indicator.dart:770:32: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!
    ^
    ../../FlutterDev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_easyrefresh-2.2.1/lib/src/refresher.dart:293:24: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../FlutterDev/flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((Duration timestamp) {
    ^`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants