Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 3.92 KB | None | 0 0
  1. import 'dart:async';
  2.  
  3. import 'package:flutter/material.dart';
  4. import 'package:google_fonts/google_fonts.dart';
  5.  
  6. void main() => runApp(MyApp());
  7.  
  8. class MyApp extends StatelessWidget {
  9.   @override
  10.   Widget build(BuildContext context) {
  11.     return MaterialApp(
  12.       debugShowCheckedModeBanner: false,
  13.       title: "Dictionary Medicine App",
  14.       theme: ThemeData(
  15.         primarySwatch: Colors.blue,
  16.       ),
  17.       home: OnBoardingPage(),
  18.     );
  19.   }
  20. }
  21.  
  22. class SplashScren extends StatefulWidget {
  23.   @override
  24.   _SplashScrenState createState() => _SplashScrenState();
  25. }
  26.  
  27. class _SplashScrenState extends State<SplashScren> {
  28.   startTime() async {
  29.     return new Timer(Duration(milliseconds: 4500), navigatorPage);
  30.   }
  31.  
  32.   /// To navigate layout change
  33.   void navigatorPage() {
  34.     Navigator.push(context,
  35.         MaterialPageRoute(builder: (BuildContext context) => OnBoardingPage()));
  36.   }
  37.  
  38.   @override
  39.   void initState() {
  40.     super.initState();
  41.     startTime();
  42.   }
  43.  
  44.   @override
  45.   Widget build(BuildContext context) {
  46.     return Scaffold(
  47.       body: Center(
  48.         child: Card(
  49.           child: Container(
  50.             width: 70,
  51.             height: 70,
  52.             padding: EdgeInsets.all(12),
  53.             child: Image.asset('assets/dlogo.png'),
  54.           ),
  55.         ),
  56.       ),
  57.     );
  58.   }
  59. }
  60.  
  61. class OnBoardingPage extends StatelessWidget {
  62.   @override
  63.   Widget build(BuildContext context) {
  64.     return Scaffold(
  65.       body: Container(
  66.         width: MediaQuery.of(context).size.width,
  67.         height: MediaQuery.of(context).size.height,
  68.         decoration: BoxDecoration(
  69.           gradient: LinearGradient(
  70.             colors: [
  71.               Colors.blue[500],
  72.               Colors.blue[100],
  73.             ],
  74.             begin: Alignment.topCenter,
  75.             end: Alignment.bottomCenter,
  76.           ),
  77.         ),
  78.         child: Column(
  79.           children: <Widget>[
  80.             SizedBox(height: 100),
  81.             Card(
  82.               child: Container(
  83.                 width: 70,
  84.                 height: 70,
  85.                 padding: EdgeInsets.all(12),
  86.                 child: Image.asset('assets/dlogo.png'),
  87.               ),
  88.             ),
  89.             SizedBox(height: 25),
  90.             Container(
  91.               width: 270,
  92.               child: Text(
  93.                 "Welcome to Simple Dictionary Medicine Pro",
  94.                 textAlign: TextAlign.center,
  95.                 style: GoogleFonts.roboto(
  96.                     fontSize: 25,
  97.                     fontWeight: FontWeight.w400,
  98.                     textStyle: TextStyle(
  99.                       color: Colors.white,
  100.                     )),
  101.               ),
  102.             ),
  103.             SizedBox(height: 70),
  104.             Container(
  105.               width: 270,
  106.               child: Text(
  107.                 "The dictionary app you've been waiting for",
  108.                 textAlign: TextAlign.center,
  109.                 style: GoogleFonts.roboto(
  110.                   fontSize: 20,
  111.                   fontWeight: FontWeight.w300,
  112.                   textStyle: TextStyle(
  113.                     color: Colors.white,
  114.                   ),
  115.                 ),
  116.               ),
  117.             ),
  118.             SizedBox(height: 100),
  119.             SizedBox(
  120.               width: 270,
  121.               height: 50,
  122.               child: RaisedButton(
  123.                 color: Color(0xFF1BC0c5),
  124.                 onPressed: () {},
  125.                 shape: RoundedRectangleBorder(
  126.                   borderRadius: BorderRadius.circular(16),
  127.                 ),
  128.                 child: Text(
  129.                   "Get Started",
  130.                   style: GoogleFonts.nunito(
  131.                     fontSize: 25,
  132.                     fontWeight: FontWeight.w700,
  133.                     textStyle: TextStyle(
  134.                       color: Colors.white,
  135.                     ),
  136.                   ),
  137.                 ),
  138.               ),
  139.             )
  140.           ],
  141.         ),
  142.       ),
  143.     );
  144.   }
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement