Skip to content Skip to sidebar Skip to footer

Flutter Error: Could Not Find The Correct Provider Above This Settingsform Widget

When I run my flutter project it shows this in my debug console: Error: Could not find the correct Provider above this SettingsForm Widget Debug Console : Error: Could not find the

Solution 1:

add this in main.dart

  Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.@override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider.value(
          value: MyUser(),
        ),
      ],
      child: MaterialApp(
        home: Wrapper(),
      ),
    );
  }
}

make file for provider

classMyUserextendsChangeNotifier {

// your code
    notifyListeners();
  }
}

Post a Comment for "Flutter Error: Could Not Find The Correct Provider Above This Settingsform Widget"