_alreayCompletedSteps where was called on null
See original GitHub issueJust tried upgrading from 0.10.0 to 0.12.0 and receiving this exception:
[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The method 'where' was called on null.
Receiver: null
Tried calling: where(Closure: (String) => bool)
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1 Bloc._alreayCompletedSteps (package:feature_discovery/src/foundation/bloc.dart:159:10)
<asynchronous suspension>
#2 Bloc.discoverFeatures (package:feature_discovery/src/foundation/bloc.dart:111:28)
#3 FeatureDiscovery.discoverFeatures (package:feature_discovery/src/foundation/feature_discovery.dart:32:24)
#4 _HomeScreenState.initState.<anonymous closure> (package:kozzeted/screens/home_screen.dart:65:24)
#5 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1113:15)
#6 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1060:9)
#7 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:968:5)
#8 _rootRun (dart:async/zone.dart:1184:13)
#9 <…>
It appears that _alreayCompletedSteps
is trying to reference _steps
before it has been initialized.
Oh, and I presume _alreayCompletedSteps
should be _alreadyCompletedSteps
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
The method '[]' was called on null. Receiver: null Tried calling
First of all you should try putting some print statements (or better use debugger) near the line where you retrieve the data. if...
Read more >NoSuchMethodError: The Method was Called on null — Flutter
Learn what causes "Flutter Android Gradle tool issue: NoSuchMethodError: The method 'reinitialize' was called on null."
Read more >NoSuchMethodError: The method 'where' was called on null ...
Hi there, I am getting the following error printed out for every file in my project when running flutter pub run build_runner build...
Read more >The method 'contains' was called on null. Receiver - Reddit
I am new to flutter, and am using an api to keep people updated on the latest technology news, but am getting this...
Read more >Understanding null safety - Dart
If you run this Dart program without null safety, it throws a NoSuchMethodError exception on the call to .length . The null value...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your method
should actually return a
Future<void>
. Due to asynchronous matter of the code setting a local variable and working with it is problematic. You’d be better of doing something like:Keeping local state in a bloc is not recommended, since everything should be handled through
Sinks
andStreams
. You could handle your steps with the help of aStreamController
.Hey @ayalma, this doesn’t seem fixed. I’m getting the exact same error with
0.12.1
.