Skip to content

Instantly share code, notes, and snippets.

@ndungudedan
Last active May 14, 2022 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndungudedan/72cdeb7f7c4c43c5fa32f6df997ee2c7 to your computer and use it in GitHub Desktop.
Save ndungudedan/72cdeb7f7c4c43c5fa32f6df997ee2c7 to your computer and use it in GitHub Desktop.
//We create a helper function to return a material app for us.
//Since we using Provider for state management,
//we initialize it here also
Widget createHomeScreen() => ChangeNotifierProvider<Favorites>(
create: (context) => Favorites(),
child: MaterialApp(
routes: AppRoutes().generateRoutes(),
initialRoute: HomePage.routeName,
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment