LoginSignup
8
2

More than 3 years have passed since last update.

Flutter エラー 「Could not find the correct Provider」

Posted at

FlutterのProviderで同じところで何度もハマったので備忘録として。

Could not find the correct Providerのエラーでハマったら…

main.dart
void main() {
  runApp(
    MultiProvider(
      providers: [
        ChangeNotifierProvider(builder: (context) => hogeBloc()..nextPage()),
        ChangeNotifierProvider(builder: (context) => fooBloc()..nextPage()),
        //←←←ここに追加するProviderを記載する
      ],
      child: MyApp(),
    ),
  );
}

参照

Flutter公式 : Simple app state management

8
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
2