From 8589212a207144943cfcf2d803c00ce9342f6e88 Mon Sep 17 00:00:00 2001 From: Rahul_Vijay Date: Thu, 25 Jun 2020 16:23:34 +0530 Subject: [PATCH 1/4] wait till load --- lib/screens/storesList.dart | 94 ++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/lib/screens/storesList.dart b/lib/screens/storesList.dart index 7574012..f51774d 100644 --- a/lib/screens/storesList.dart +++ b/lib/screens/storesList.dart @@ -181,59 +181,59 @@ class _StoresScreenState extends State { ), ), body: _buildArrayFromFuture(), - floatingActionButton: Container( - height: 60.0, - width: double.infinity, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Delivery Address:", - style: TextStyle( - fontFamily: "Raleway", - fontWeight: FontWeight.w700, - color: ThemeColoursSeva().black, - fontSize: 14.0), - ), - SizedBox(height: 10.0), - FutureBuilder( - future: _fetchUserAddress(), - builder: (context, data) { - if (data.hasData) { - return Container( + floatingActionButton: FutureBuilder( + future: _fetchUserAddress(), + builder: (context, data) { + if (data.hasData) { + return Container( + height: 60.0, + width: double.infinity, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Delivery Address:", + style: TextStyle( + fontFamily: "Raleway", + fontWeight: FontWeight.w700, + color: ThemeColoursSeva().black, + fontSize: 14.0), + ), + SizedBox(height: 10.0), + Container( width: MediaQuery.of(context).size.width * 0.6, child: Text( data.data, overflow: TextOverflow.ellipsis, ), + ), + ], + ), + RaisedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => GoogleLocationScreen( + userEmail: _email, + )), ); - } else - return Container(); - }), - ], - ), - RaisedButton( - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => GoogleLocationScreen( - userEmail: _email, - )), - ); - }, - child: Text( - "Change", - style: TextStyle(color: Colors.white), - ), - color: ThemeColoursSeva().dkGreen, - ) - ], - ), - ), + }, + child: Text( + "Change", + style: TextStyle(color: Colors.white), + ), + color: ThemeColoursSeva().dkGreen, + ) + ], + ), + ); + } else + return Container(); + }), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat); } } From 4a9078aee1687ca731b44dc38cce6acb620da9d7 Mon Sep 17 00:00:00 2001 From: Rahul_Vijay Date: Thu, 25 Jun 2020 16:32:41 +0530 Subject: [PATCH 2/4] orders screen diff --- lib/screens/common/customOrdersCard.dart | 8 ++++++-- lib/screens/orders.dart | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/screens/common/customOrdersCard.dart b/lib/screens/common/customOrdersCard.dart index 18cf46e..7218829 100644 --- a/lib/screens/common/customOrdersCard.dart +++ b/lib/screens/common/customOrdersCard.dart @@ -48,7 +48,9 @@ class _CustomOrdersCardState extends State { SizedBox(height: 10.0), widget.order.otp != '0' ? Text( - "OTP ${widget.order.otp}", + widget.order.orderType != "Delivery" + ? "OTP ${widget.order.otp}" + : "No OTP", style: TextStyle( fontFamily: "Raleway", fontSize: 16.5, @@ -94,7 +96,9 @@ class _CustomOrdersCardState extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Text( - "TOKEN ${widget.order.tokenNumber}", + widget.order.orderType != "Delivery" + ? "TOKEN ${widget.order.tokenNumber}" + : "No TOKEN", style: TextStyle( fontFamily: "Raleway", fontSize: 13.5, diff --git a/lib/screens/orders.dart b/lib/screens/orders.dart index a905bdf..e11a94b 100644 --- a/lib/screens/orders.dart +++ b/lib/screens/orders.dart @@ -76,7 +76,7 @@ class _OrdersScreenState extends State { CustomOrdersCard( order: ordersArr[index], ), - SizedBox(height: 30.0) + SizedBox(height: 55.0) ], ); }); From 67b1e69b85a303379aeb1110a176c66973f2051d Mon Sep 17 00:00:00 2001 From: Rahul_Vijay Date: Thu, 25 Jun 2020 16:33:59 +0530 Subject: [PATCH 3/4] change at order details --- lib/screens/orderDetails.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/screens/orderDetails.dart b/lib/screens/orderDetails.dart index 7f19c62..182ad05 100644 --- a/lib/screens/orderDetails.dart +++ b/lib/screens/orderDetails.dart @@ -70,7 +70,10 @@ class OrderDetailsScreen extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ - Text("Token No. ${order.tokenNumber}", + Text( + order.orderType != "Delivery" + ? "TOKEN ${order.tokenNumber}" + : "", style: TextStyle( fontFamily: "Raleway", fontSize: 16.5, From 9ef84938c2141e38479f8ac0c49eaf20636e973f Mon Sep 17 00:00:00 2001 From: Rahul_Vijay Date: Thu, 25 Jun 2020 16:36:08 +0530 Subject: [PATCH 4/4] loading address --- lib/screens/storesList.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/screens/storesList.dart b/lib/screens/storesList.dart index f51774d..a8df9b5 100644 --- a/lib/screens/storesList.dart +++ b/lib/screens/storesList.dart @@ -232,7 +232,9 @@ class _StoresScreenState extends State { ), ); } else - return Container(); + return Container( + child: Text("Loading Address ...") + ); }), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat); }