Skip to content

Instantly share code, notes, and snippets.

@littleironical
Last active November 28, 2020 08:26
Show Gist options
  • Save littleironical/4cec8001cf3212a02b8983f5a97e306c to your computer and use it in GitHub Desktop.
Save littleironical/4cec8001cf3212a02b8983f5a97e306c to your computer and use it in GitHub Desktop.
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:orderac/screens/root.dart';
class SplashScreen extends StatefulWidget {
@override
_SplashScreenState createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
@override
void initState() {
super.initState();
Timer(
Duration(milliseconds: 1500),
() => Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => Root()))
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Center(
child: SizedBox(height: 60.0, width: 60.0,
child: Image.asset('assets/icon/icon.png')
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment