Hi@akhtar,
This problem is introduced when you upgrade Flutter. The reason behind this is you are waiting for some data or running an async function inside main(). I was initializing ScopedModel inside main() and inside that, I was waiting for some data. There is a very small fix to avoid this error. You have to initialize this module WidgetsFlutterBinding.ensureInitialized() inside void main() function, before you do runApp() as shown below.
void main() {
WidgetsFlutterBinding.ensureInitialized();
Firebase.initializeApp();
runApp(Mydb());
}
To know more about Flutter, join our Flutter Course today.