Skip to content

Instantly share code, notes, and snippets.

@maffan91
Last active September 15, 2019 14:40
Show Gist options
  • Save maffan91/da7c768b88c2d42919ed2cb24161f16d to your computer and use it in GitHub Desktop.
Save maffan91/da7c768b88c2d42919ed2cb24161f16d to your computer and use it in GitHub Desktop.
MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
initialRoute: '/',
routes: {
'/': (context) => MyHomePage(),
'/profile': (context) => Profile(),
},
onGenerateRoute: (settings) {
if (settings.name == '/detailed-profile') {
ProfileArguments args = settings.arguments;
return MaterialPageRoute(
builder: (context) => DetailedProfile(
name: args.name,
email: args.email,
));
}
return null;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment