|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import 'package:driverapp/core/viewModels/orders_view_model.dart';
|
|
|
|
|
import 'package:driverapp/widgets/delivery/distance_in_kilometers.dart';
|
|
|
|
|
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:driverapp/widgets/others/network_base_view.dart';
|
|
|
|
|
import 'package:driverapp/widgets/others/rounded_container.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
@ -28,109 +29,129 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
itemCount: model.deliverdOrders == null
|
|
|
|
|
? 0
|
|
|
|
|
: model.deliverdOrders.length,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.2),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
child: RoundedContainer(
|
|
|
|
|
raduis: 25.0,
|
|
|
|
|
height: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery.of(context).size.height * 0.120
|
|
|
|
|
: MediaQuery.of(context).size.height * 0.209,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Padding(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.only(left: 15.0, top: 14.0),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
'assets/images/location.png',
|
|
|
|
|
height: MediaQuery.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery.of(context).size.height *
|
|
|
|
|
0.06
|
|
|
|
|
: MediaQuery.of(context).size.height *
|
|
|
|
|
0.11,
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery.of(context).size.width *
|
|
|
|
|
0.05
|
|
|
|
|
: MediaQuery.of(context).size.width *
|
|
|
|
|
0.09,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (model.orders.length != 0)
|
|
|
|
|
NetworkBaseView(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child: Expanded(
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
itemCount: model.deliverdOrders == null
|
|
|
|
|
? 0
|
|
|
|
|
: model.deliverdOrders.length,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.2),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
child: RoundedContainer(
|
|
|
|
|
raduis: 25.0,
|
|
|
|
|
height: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery.of(context).size.height * 0.120
|
|
|
|
|
: MediaQuery.of(context).size.height * 0.209,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 5,
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 20.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
model.deliverdOrders[index].firstName +
|
|
|
|
|
' ' +
|
|
|
|
|
model.orders[index].lastName,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 18.0,
|
|
|
|
|
color: Hexcolor("#343333"),
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 15.0, top: 14.0),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
'assets/images/location.png',
|
|
|
|
|
height: MediaQuery.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.height *
|
|
|
|
|
0.06
|
|
|
|
|
: MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.height *
|
|
|
|
|
0.11,
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.05
|
|
|
|
|
: MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.09,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
model.deliverdOrders[index].mobileNumber,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Color(0xff30B7B9),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (model.orders.length != 0)
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 5,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 20.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
model.deliverdOrders[index]
|
|
|
|
|
.firstName +
|
|
|
|
|
' ' +
|
|
|
|
|
model.orders[index].lastName,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 18.0,
|
|
|
|
|
color: Hexcolor("#343333"),
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Text(
|
|
|
|
|
model.deliverdOrders[index].orderID
|
|
|
|
|
.toString(),
|
|
|
|
|
Text(
|
|
|
|
|
model
|
|
|
|
|
.deliverdOrders[index].mobileNumber,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 18.0,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
letterSpacing: 8.0),
|
|
|
|
|
color: Color(0xff30B7B9),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Text(
|
|
|
|
|
model.deliverdOrders[index].orderID
|
|
|
|
|
.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 18.0,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
letterSpacing: 8.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
child: DistanceInKilometers(
|
|
|
|
|
distanceInKilometers: model
|
|
|
|
|
.deliverdOrders[index].distanceInKilometers,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
child: DistanceInKilometers(
|
|
|
|
|
distanceInKilometers: model
|
|
|
|
|
.deliverdOrders[index].distanceInKilometers,
|
|
|
|
|
),
|
|
|
|
|
//
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// MaterialPageRoute(
|
|
|
|
|
// builder: (context) =>
|
|
|
|
|
// InformationPage(model.orders[index])));
|
|
|
|
|
// },
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
|