From ae8af0ab434a9065e8a5a172f5ff7a754c016a18 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 9 Sep 2020 11:38:57 +0300 Subject: [PATCH] Fix 2 loader inside the dashboard_screen --- lib/pages/dashboard/dashboard_screen.dart | 48 +++++++++++------------ lib/pages/splash_screen_page.dart | 2 +- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index 6952710..19d4ef3 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -457,25 +457,23 @@ class _DashboardScreenState extends State { ], ), ), - NetworkBaseView( - baseViewModel: model, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.0, vertical: 1.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - children: [ - Text( - TranslationBase.of(context).nearestDropOffs, - style: TextStyle( - fontSize: 21.0, - fontWeight: FontWeight.w400, - ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 1.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + children: [ + Text( + TranslationBase.of(context).nearestDropOffs, + style: TextStyle( + fontSize: 21.0, + fontWeight: FontWeight.w400, ), - ], - ), + ), + ], + ), + if (model.state == ViewState.Idle) Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -494,16 +492,16 @@ class _DashboardScreenState extends State { ), ], ), - onTap: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => OrdersListScreen()), - ), + onTap: () => + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => OrdersListScreen()), + ), ), ], ), - ], - ), + ], ), ), NetworkBaseView( diff --git a/lib/pages/splash_screen_page.dart b/lib/pages/splash_screen_page.dart index 68f766d..038b982 100644 --- a/lib/pages/splash_screen_page.dart +++ b/lib/pages/splash_screen_page.dart @@ -14,7 +14,7 @@ class SplashScreenPage extends StatefulWidget { class _SplashScreenPageState extends State { startTime() async { - var _duration = new Duration(seconds: 2); + var _duration = new Duration(seconds: 1); return new Timer(_duration, navigationPage); }