add routing to see all

setting_branch
enadhilal 5 years ago
parent 208d903e0a
commit a61ecb8cec

@ -1,4 +1,5 @@
import 'package:driverapp/core/viewModels/orders_view_model.dart'; 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:driverapp/widgets/others/rounded_container.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -42,107 +43,118 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Padding( return InkWell(
padding: EdgeInsets.symmetric(horizontal: 12.2), onTap: () {
child: RoundedContainer( Navigator.push(
height: MediaQuery context, MaterialPageRoute(
.of(context) builder: (context) =>
.orientation == InformationPage(model.orders[index])));
Orientation.portrait },
? MediaQuery child: Padding(
.of(context) padding: EdgeInsets.symmetric(horizontal: 12.2),
.size child: RoundedContainer(
.height * 0.107 height: MediaQuery
: MediaQuery .of(context)
.of(context) .orientation ==
.size Orientation.portrait
.height * 0.18, ? MediaQuery
child: Row( .of(context)
mainAxisAlignment: MainAxisAlignment.spaceBetween, .size
children: <Widget>[ .height * 0.107
Expanded( : MediaQuery
flex: 1, .of(context)
child: Column( .size
mainAxisAlignment: MainAxisAlignment.center, .height * 0.18,
children: <Widget>[ child: Row(
Padding( mainAxisAlignment: MainAxisAlignment
padding: EdgeInsets.only(left: 22.0), .spaceBetween,
child: Image.asset( children: <Widget>[
'assets/images/location.png',
height:
MediaQuery
.of(context)
.size
.height *
0.101,
),
),
],
),
),
if (model.orders.length != 0)
Expanded( Expanded(
flex: 3, flex: 1,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment mainAxisAlignment: MainAxisAlignment
.start, .center,
children: <Widget>[ children: <Widget>[
Expanded( Padding(
child: Text( padding: EdgeInsets.only(left: 22.0),
model.orders[index].firstName + child: Image.asset(
' ' + 'assets/images/location.png',
model.orders[index].lastName, height:
style: TextStyle(fontSize: 18.0), 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( if (model.orders.length != 0)
padding: EdgeInsets.all(10.0), Expanded(
child: Column( flex: 3,
mainAxisAlignment: MainAxisAlignment.center, child: Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment
Expanded( .start,
child: CircleAvatar( children: <Widget>[
backgroundColor: Colors.black45, Expanded(
radius: 28.0, 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: <Widget>[
Expanded(
child: CircleAvatar( child: CircleAvatar(
backgroundColor: Colors.white, backgroundColor: Colors.black45,
maxRadius: 25.1, radius: 28.0,
child: Padding( child: CircleAvatar(
padding: const EdgeInsets.all( backgroundColor: Colors.white,
8.0), maxRadius: 25.1,
child: Text( child: Padding(
'3 K.m \n away', padding: const EdgeInsets.all(
style: TextStyle( 8.0),
color: Color(0xff30B7B9), child: Text(
fontSize: 12.5, '3 K.m \n away',
fontWeight: FontWeight style: TextStyle(
.w600), color: Color(0xff30B7B9),
fontSize: 12.5,
fontWeight: FontWeight
.w600),
),
), ),
), ),
), ),
), )
) ],
], ),
), ),
), ],
], ),
), ),
), ),
); );

Loading…
Cancel
Save