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

Warning: Operand of null-aware operation '!.' has type 'SchedulerBinding' which excludes null. #18

Closed
ValentinVignal opened this issue Jul 25, 2022 · 0 comments · Fixed by #19

Comments

@ValentinVignal
Copy link
Contributor

Describe the bug

When running the tests, I get the warning:

../../../.pub-cache/hosted/pub.dartlang.org/performance-0.1.0+1/lib/src/overlay.dart:223:22: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addTimingsCallback(_timingsCallback);
                     ^
../../../.pub-cache/hosted/pub.dartlang.org/performance-0.1.0+1/lib/src/overlay.dart:228:22: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.removeTimingsCallback(_timingsCallback);
                     ^
../../../.pub-cache/hosted/pub.dartlang.org/performance-0.1.0+1/lib/src/overlay.dart:251:22: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((timeStamp) {

To Reproduce

I'm using flutter 3.0.5.

Run flutter test on :

// ignore: unused_import
import 'package:performance/performance';
import 'package:flutter_test/flutter_test.dart';

void main() {
  testWidgets('Counter increments smoke test', (WidgetTester tester) async {});
}

Expected behavior

There should not be any compilation error

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