From a61ecb8cec15150a04d95c955c82a3573f277a0b Mon Sep 17 00:00:00 2001 From: enadhilal Date: Thu, 27 Aug 2020 09:05:56 +0300 Subject: [PATCH] add routing to see all --- lib/pages/orders/pending_orders_page.dart | 188 ++++++++++++---------- 1 file changed, 100 insertions(+), 88 deletions(-) diff --git a/lib/pages/orders/pending_orders_page.dart b/lib/pages/orders/pending_orders_page.dart index 16149b2..1e04320 100644 --- a/lib/pages/orders/pending_orders_page.dart +++ b/lib/pages/orders/pending_orders_page.dart @@ -1,4 +1,5 @@ import 'package:driverapp/core/viewModels/orders_view_model.dart'; +import 'package:driverapp/pages/delivery/information_page.dart'; import 'package:driverapp/widgets/others/rounded_container.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -42,107 +43,118 @@ class _OrdersListScreenState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, itemBuilder: (BuildContext context, int index) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 12.2), - child: RoundedContainer( - height: MediaQuery - .of(context) - .orientation == - Orientation.portrait - ? MediaQuery - .of(context) - .size - .height * 0.107 - : MediaQuery - .of(context) - .size - .height * 0.18, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.only(left: 22.0), - child: Image.asset( - 'assets/images/location.png', - height: - MediaQuery - .of(context) - .size - .height * - 0.101, - ), - ), - ], - ), - ), - if (model.orders.length != 0) + return InkWell( + onTap: () { + Navigator.push( + context, MaterialPageRoute( + builder: (context) => + InformationPage(model.orders[index]))); + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.2), + child: RoundedContainer( + height: MediaQuery + .of(context) + .orientation == + Orientation.portrait + ? MediaQuery + .of(context) + .size + .height * 0.107 + : MediaQuery + .of(context) + .size + .height * 0.18, + child: Row( + mainAxisAlignment: MainAxisAlignment + .spaceBetween, + children: [ Expanded( - flex: 3, + flex: 1, child: Column( - crossAxisAlignment: CrossAxisAlignment - .start, + mainAxisAlignment: MainAxisAlignment + .center, children: [ - Expanded( - child: Text( - model.orders[index].firstName + - ' ' + - model.orders[index].lastName, - style: TextStyle(fontSize: 18.0), + Padding( + padding: EdgeInsets.only(left: 22.0), + child: Image.asset( + 'assets/images/location.png', + height: + MediaQuery + .of(context) + .size + .height * + 0.101, ), ), - Text( - model.orders[index].mobileNumber, - style: TextStyle( - color: Color(0xff30B7B9), - fontWeight: FontWeight.w600, - fontSize: 15.0), - ), - Expanded( - child: Text( - 'Olaya ST, Behind kfc next to king ', - style: TextStyle( - color: Colors.black45), - ), - ) ], ), ), - Padding( - padding: EdgeInsets.all(10.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: CircleAvatar( - backgroundColor: Colors.black45, - radius: 28.0, + if (model.orders.length != 0) + Expanded( + flex: 3, + child: Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Expanded( + child: Text( + model.orders[index].firstName + + ' ' + + model.orders[index].lastName, + style: TextStyle(fontSize: 18.0), + ), + ), + Text( + model.orders[index].mobileNumber, + style: TextStyle( + color: Color(0xff30B7B9), + fontWeight: FontWeight.w600, + fontSize: 15.0), + ), + Expanded( + child: Text( + 'Olaya ST, Behind kfc next to king ', + style: TextStyle( + color: Colors.black45), + ), + ) + ], + ), + ), + Padding( + padding: EdgeInsets.all(10.0), + child: Column( + mainAxisAlignment: MainAxisAlignment + .center, + children: [ + Expanded( child: CircleAvatar( - backgroundColor: Colors.white, - maxRadius: 25.1, - child: Padding( - padding: const EdgeInsets.all( - 8.0), - child: Text( - '3 K.m \n away', - style: TextStyle( - color: Color(0xff30B7B9), - fontSize: 12.5, - fontWeight: FontWeight - .w600), + backgroundColor: Colors.black45, + radius: 28.0, + child: CircleAvatar( + backgroundColor: Colors.white, + maxRadius: 25.1, + child: Padding( + padding: const EdgeInsets.all( + 8.0), + child: Text( + '3 K.m \n away', + style: TextStyle( + color: Color(0xff30B7B9), + fontSize: 12.5, + fontWeight: FontWeight + .w600), + ), ), ), ), - ), - ) - ], + ) + ], + ), ), - ), - ], + ], + ), ), ), );