1

I'm trying to implement integration testing for my flutter app but I'm getting this error when writing something very straightforward.

ERROR: ../../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/scroll_to_index-2.1.1/lib/scroll_to_index.dart:358:57: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.

Please help me in resolving this error.

Nik
  • 187
  • 3
  • 17

1 Answers1

1

This might be because of Flutter SDK upgrade, it you are using Flutter SDK 3.0 then scroll_to_index is still not upgradable or if you are using Flutter 2.0 then you can simply run this command flutter pub upgrade

Harish Sharma
  • 1,189
  • 1
  • 8
  • 19
  • Flutter 3.1.0-0.0.pre.731 is what I'm using. How can I fix this? – Nik Jun 23 '22 at 10:40
  • Also I don even have scroll_to_index in my dependencies ;-; – Nik Jun 23 '22 at 10:41
  • 1
    @Nike then this may be issue because of pub cache, did you try to delete pubspec.lock file and `flutter clean` and then `flutter pub get` – Harish Sharma Jun 23 '22 at 10:57
  • If above issue still not fixing your problem then you can repair your cache but it will re download all the package are available inn cache, for more about cache clear you can look into this question - https://stackoverflow.com/questions/55399209/update-flutter-dependencies-in-pub-cache – Harish Sharma Jun 23 '22 at 10:59