Flutter: Binding has not yet been initialized
1,484
I found the solution for this error in Flutter version >= 3.0:
Add this line to your main():
void main() async { WidgetsFlutterBinding.ensureInitialized(); DartPluginRegistrant.ensureInitialized(); //<----FIX THE PROBLEM //.. }
Author by
MedCh
Updated on January 04, 2023Comments
-
MedCh over 1 year
After upgrading FLutter to 3.0.0 I got this error when using compute isolate, knowing that I have initialized in main.dart:
void main() async { WidgetsFlutterBinding.ensureInitialized();
-
Hardik Mehta almost 2 yearstry flutter clean. flutter pub update then try to run it
-
Javier C. almost 2 yearsi have the same problem
-
-
MedCh almost 2 yearsno effect => it's not a future
-
Javier C. almost 2 yearsfor me is not working
-
Xdg over 1 yearDartPluginRegistrant.ensureInitialized() NOT fixes the problem.