Skip to content

Instantly share code, notes, and snippets.

@lucalves
Last active October 15, 2019 13:10
Show Gist options
  • Save lucalves/6a361b664305fbb68d07e5da7f2f5f96 to your computer and use it in GitHub Desktop.
Save lucalves/6a361b664305fbb68d07e5da7f2f5f96 to your computer and use it in GitHub Desktop.
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:splashscreen/splashscreen.dart';
import 'home_screen.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Splash Screen',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Splash Screen Flutter'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return _introScreen();
}
}
Widget _introScreen() {
return Stack(
children: <Widget>[
SplashScreen(
seconds: 5,
gradientBackground: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [
Color(0xffED213A),
Color(0xff93291E)
],
),
navigateAfterSeconds: HomeScreen(),
loaderColor: Colors.transparent,
),
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/logo.png"),
fit: BoxFit.none,
),
),
),
],
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment