import 'dart:async'; import 'package:driverapp/app-icons/driver_app_icons.dart'; import 'package:driverapp/core/viewModels/project_view_model.dart'; import 'package:driverapp/root_page.dart'; import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class SplashScreenPage extends StatefulWidget { @override _SplashScreenPageState createState() => _SplashScreenPageState(); } class _SplashScreenPageState extends State { startTime() async { var _duration = new Duration(seconds: 5); return new Timer(_duration, navigationPage); } @override void initState() { super.initState(); startTime(); } @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: false, appBarColor: Color(0xff30B7B9), body: Container( decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment(1.0,0.0), end: Alignment(-0.0, 0.0), // 10% of the width, so there are ten blinds. colors: [const Color(0xFF1BB0B8), const Color(0xFF44BFBB)],//[const Color(0xff30B7B9), const Color(0xff3AB2AD)], // whitish to gray tileMode: TileMode.clamp, // repeats the gradient over the canvas ), ), child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ FractionallySizedBox( widthFactor: 0.80, child: Column( children: [ SizedBox( height: 200, ), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( child: Icon( DriverApp.logo, size: 120, color: Colors.white, ), margin: EdgeInsets.only( right: projectViewModel.isArabic ? 0 : MediaQuery.of(context).size.width * 0.20, left: !projectViewModel.isArabic ? 0 : MediaQuery.of(context).size.width * 0.10), ), ], ), SizedBox( height: 20, ), Column( children: [ Text( "Driver", style: TextStyle( fontSize: 70, fontWeight: FontWeight.bold, color: Colors.white), ), Text( "Delivery", style: TextStyle( fontSize: 50, letterSpacing: 1, color: Colors.white), ), Text( "APP", style: TextStyle( fontSize: 53, letterSpacing: 53, color: Colors.white, fontWeight: FontWeight.w400), ), ], ), SizedBox( height: 100, ) ], ), ), Center( child: FractionallySizedBox( widthFactor: 0.80, child: Column( children: [ Column( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center, children: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 0), child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Expanded( child: Center( child: Text( "Powered by Cloud Solutions", style: TextStyle( fontSize: 13, color: Colors.white), ), ), ), SizedBox( height: 10, ) ], ), ), ], ), ], ), ), ), ], ), ), ), ); } void navigationPage() { Navigator.pushReplacement( context, MaterialPageRoute( builder: (context) => RootPage(), ), ); } }