Tuesday, March 5, 2019

Splash Screen

import 'dart:async';
import 'package:flutter/material.dart';
import 'homeScreen.dart';
import 'MyHome.dart';
import 'account.dart';


void main() {
  runApp(new MaterialApp(
    home: new MyApp(),
    debugShowCheckedModeBanner: false,
    routes: <String, WidgetBuilder>{
      '/HomeScreen': (BuildContext context) => new MyHome()
    },
  ));
}

class MyApp extends StatefulWidget {
  @override
  _SplashScreenState createState() => new _SplashScreenState();
}

class _SplashScreenState extends State<MyApp> {
  startTime() async {
    var _duration = new Duration(seconds: 2);
    return new Timer(_duration, navigationPage);
  }

  void navigationPage() {
    Navigator.of(context).pushReplacementNamed('/HomeScreen');
  }

  @override
  void initState() {
    super.initState();
    startTime();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      body: new Container(
        color: Colors.black,
        child: Center(
          child: SingleChildScrollView(
            child: new Container(
              child: new Column(
                children: <Widget>[
                  Text("Urbanvogue",style: TextStyle(fontSize: 40.0,fontStyle: FontStyle.italic,color: Colors.green,),)
                ],
              ),
            ),
          ),
        ),
       /* decoration: new BoxDecoration(
          image: new DecorationImage(
              image: new AssetImage("images/logo.png"), fit: BoxFit.cover),
        ),*/
      ),
    );
  }
}

No comments:

Post a Comment

How to save contact number in flutter

with contacts_service: 0.3.10 https://pub.dev/packages/contacts_service Future < void > contactSave (){ Contact contac...