Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<CameraDescription> cameras;
- Future<Null> main() async {
- cameras = await availableCameras();
- runApp(new MaterialApp(
- debugShowCheckedModeBanner: false,
- theme: new ThemeData(
- brightness: Brightness.light,
- primaryColor: Colors.green,
- secondaryHeaderColor: Colors.green,
- accentColor: Color(0xFF73bc42),
- ),
- home: new SplashScreen(),
- routes: <String, WidgetBuilder>{
- '/screens/LoginScreen': (BuildContext context) => new LoginScreen(),
- '/screens/SignUpScreen': (BuildContext context) => new SignUpBasicScreen(cameras)
- },
- ));
- }
- class SplashScreen extends StatefulWidget {
- @override
- _SplashScreenState createState() => new _SplashScreenState();
- }
- class _SplashScreenState extends State<SplashScreen>
- with SingleTickerProviderStateMixin {
- AnimationController _logoAnimationController;
- Animation<double> _logoAnimation;
- startTime() async {
- var _duration = new Duration(seconds: 3);
- return new Timer(_duration, navigationPage);
- }
- void navigationPage() {
- Navigator.of(context).pushReplacementNamed('/screens/LoginScreen');
- }
- @override
- void initState() {
- super.initState();
- _logoAnimationController = new AnimationController(
- vsync: this, duration: new Duration(milliseconds: 300));
- _logoAnimation = new CurvedAnimation(
- parent: _logoAnimationController, curve: Curves.easeOut);
- _logoAnimation.addListener(() => this.setState(() {}));
- _logoAnimationController.forward();
- startTime();
- }
- @override
- Widget build(BuildContext context) {
- return new Scaffold(
- backgroundColor: Colors.white,
- body: new Stack(
- fit: StackFit.expand,
- children: <Widget>[
- new Column(
- mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: <Widget>[
- new Image.asset('images/ic_logo_name.png',
- width: _logoAnimation.value * 200.0,
- height: _logoAnimation.value * 100.0)
- ],
- )
- ],
- )
- );
- }
- }
Add Comment
Please, Sign In to add comment