Skip to content

Instantly share code, notes, and snippets.

@ndungudedan
Last active May 14, 2022 21:13
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/f1904903b275797ae98ce467fee4f244 to your computer and use it in GitHub Desktop.
Save ndungudedan/f1904903b275797ae98ce467fee4f244 to your computer and use it in GitHub Desktop.
void main() {
runApp(TestingApp());
}
class TestingApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider<Favorites>(
create: (context) => Favorites(),
child: MaterialApp(
title: 'Testing Sample',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
routes: AppRoutes().generateRoutes(),
initialRoute: HomePage.routeName,
),
);
}
}
class AppRoutes {
generateRoutes() {
return {
HomePage.routeName: (context) => HomePage(),
FavoritesPage.routeName: (context) => FavoritesPage(),
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment