Created
June 26, 2019 12:08
-
-
Save marcel-ploch/5e6e865e7bb3d07972ddb2dcb9d85409 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyApp extends StatelessWidget { | |
final materialApp = MaterialApp( | |
title: UIData.appName, | |
theme: ThemeData( | |
primaryColor: Colors.green, | |
fontFamily: UIData.quickFont, | |
primarySwatch: Colors.amber), | |
home: HomePage(), | |
initialRoute: null, | |
//routes | |
onGenerateRoute: (RouteSettings settings) { | |
switch(settings.name) { | |
case '/plan': { | |
return PageTransition(child: PlanPage(), type: PageTransitionType.leftToRight); | |
} | |
case '/teams': { | |
return PageTransition(child: TeamsPage(), type: PageTransitionType.leftToRight); | |
} | |
case '/cities': { | |
return PageTransition(child: CitiesPage(), type: PageTransitionType.leftToRight); | |
} | |
case '/impression': { | |
return PageTransition(child: ImpressionPage(), type: PageTransitionType.leftToRight); | |
} | |
case '/twitter': { | |
return PageTransition(child: TwitterPage(), type: PageTransitionType.leftToRight); | |
} | |
case '/quiz': { | |
return PageTransition(child: QuizPage(), type: PageTransitionType.leftToRight); | |
} | |
default: { | |
return PageTransition(child: HomePage(), type: PageTransitionType.leftToRight); | |
} | |
} | |
}, | |
); | |
@override | |
Widget build(BuildContext context) { | |
return materialApp; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment