From 421aa5ba675e313c9b1c92a412433801f6443e6c Mon Sep 17 00:00:00 2001 From: "bm.abir" Date: Wed, 8 Apr 2020 04:54:05 +0600 Subject: [PATCH] splash screen added --- lib/app.dart | 30 ++++++++++++++++++++++++++++-- pubspec.lock | 7 +++++++ pubspec.yaml | 3 ++- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/lib/app.dart b/lib/app.dart index b58f617..ace2809 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import "package:tran_dao/ui/reliefMapPage.dart"; - +import 'package:splashscreen/splashscreen.dart'; class TranDao extends StatefulWidget { @override @@ -12,7 +12,7 @@ class _TranDaoState extends State { Widget build(BuildContext context) { dynamic _initPage; - _initPage=ReliefMapPage(); + _initPage=MySplashScreen(); return MaterialApp( home: _initPage, @@ -31,4 +31,30 @@ class _TranDaoState extends State { }, ); } +} +// https://pub.dev/packages/splashscreen#-readme-tab- +class MySplashScreen extends StatefulWidget{ + + _MySplashScreenState createState() => new _MySplashScreenState(); +} + +class _MySplashScreenState extends State { + Widget build(BuildContext context){ + return new SplashScreen( + seconds: 5, + navigateAfterSeconds: new ReliefMapPage(), + title: new Text('ত্রান দাও', + style: new TextStyle( + fontWeight: FontWeight.bold, + fontSize: 35.0, + ),), + backgroundColor: Colors.white, + styleTextUnderTheLoader: new TextStyle(), + photoSize: 100.0, + onClick: ()=>print("Flutter BD"), + loaderColor: Colors.green + ); + + } + } \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index a2346d5..66d1062 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -252,6 +252,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.5.5" + splashscreen: + dependency: "direct main" + description: + name: splashscreen + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" stack_trace: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index f662528..51c10a1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,7 +27,8 @@ dependencies: google_maps_flutter_heatmap: ^0.1.1+1 geolocator: ^5.3.1 firebase_core: ^0.4.0+9 - cloud_firestore: ^0.13.0+1 + cloud_firestore: ^0.13.0+1 + splashscreen: ^1.2.0 # The following adds the Cupertino Icons font to your application.