add MediaQuery into the design and make Package Content appear dynamic.

setting_branch
enadhilal 6 years ago
commit df0049cd35

@ -0,0 +1,153 @@
class PendingOrdersRes {
int rowID;
int orderID;
String firstName;
String middleName;
String lastName;
int gender;
String nationalityID;
String mobileNumber;
String preferredLanguage;
int driverID;
int statusID;
bool ispaused;
int groupID;
String description;
String descriptionN;
double longitude;
double latitude;
Null amount;
String orderCreatedOn;
Null ePharmacyOrderNo;
int projectID;
String appointmentNo;
String dischargeID;
String patientID;
bool patientOutSA;
int distanceInKilometers;
List<ItemsQuantitiesList> itemsQuantitiesList;
PendingOrdersRes(
{this.rowID,
this.orderID,
this.firstName,
this.middleName,
this.lastName,
this.gender,
this.nationalityID,
this.mobileNumber,
this.preferredLanguage,
this.driverID,
this.statusID,
this.ispaused,
this.groupID,
this.description,
this.descriptionN,
this.longitude,
this.latitude,
this.amount,
this.orderCreatedOn,
this.ePharmacyOrderNo,
this.projectID,
this.appointmentNo,
this.dischargeID,
this.patientID,
this.patientOutSA,
this.distanceInKilometers,
this.itemsQuantitiesList});
PendingOrdersRes.fromJson(Map<String, dynamic> json) {
rowID = json['RowID'];
orderID = json['OrderID'];
firstName = json['FirstName'];
middleName = json['MiddleName'];
lastName = json['LastName'];
gender = json['Gender'];
nationalityID = json['NationalityID'];
mobileNumber = json['MobileNumber'];
preferredLanguage = json['PreferredLanguage'];
driverID = json['DriverID'];
statusID = json['StatusID'];
ispaused = json['Ispaused'];
groupID = json['GroupID'];
description = json['Description'];
descriptionN = json['DescriptionN'];
longitude = json['Longitude'];
latitude = json['Latitude'];
amount = json['Amount'];
orderCreatedOn = json['OrderCreatedOn'];
ePharmacyOrderNo = json['ePharmacyOrderNo'];
projectID = json['ProjectID'];
appointmentNo = json['AppointmentNo'];
dischargeID = json['DischargeID'];
patientID = json['PatientID'];
patientOutSA = json['PatientOutSA'];
distanceInKilometers = json['DistanceInKilometers'];
if (json['ItemsQuantitiesList'] != null) {
itemsQuantitiesList = new List<ItemsQuantitiesList>();
json['ItemsQuantitiesList'].forEach((v) {
itemsQuantitiesList.add(new ItemsQuantitiesList.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['RowID'] = this.rowID;
data['OrderID'] = this.orderID;
data['FirstName'] = this.firstName;
data['MiddleName'] = this.middleName;
data['LastName'] = this.lastName;
data['Gender'] = this.gender;
data['NationalityID'] = this.nationalityID;
data['MobileNumber'] = this.mobileNumber;
data['PreferredLanguage'] = this.preferredLanguage;
data['DriverID'] = this.driverID;
data['StatusID'] = this.statusID;
data['Ispaused'] = this.ispaused;
data['GroupID'] = this.groupID;
data['Description'] = this.description;
data['DescriptionN'] = this.descriptionN;
data['Longitude'] = this.longitude;
data['Latitude'] = this.latitude;
data['Amount'] = this.amount;
data['OrderCreatedOn'] = this.orderCreatedOn;
data['ePharmacyOrderNo'] = this.ePharmacyOrderNo;
data['ProjectID'] = this.projectID;
data['AppointmentNo'] = this.appointmentNo;
data['DischargeID'] = this.dischargeID;
data['PatientID'] = this.patientID;
data['PatientOutSA'] = this.patientOutSA;
data['DistanceInKilometers'] = this.distanceInKilometers;
if (this.itemsQuantitiesList != null) {
data['ItemsQuantitiesList'] =
this.itemsQuantitiesList.map((v) => v.toJson()).toList();
}
return data;
}
}
class ItemsQuantitiesList {
String itemName;
var productID;
var quantity;
ItemsQuantitiesList({this.itemName, this.productID, this.quantity});
ItemsQuantitiesList.fromJson(Map<String, dynamic> json) {
itemName = json['ItemName'];
productID = json['ProductID'];
quantity = json['Quantity'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ItemName'] = this.itemName;
data['ProductID'] = this.productID;
data['Quantity'] = this.quantity;
return data;
}
}

@ -1,12 +1,13 @@
import 'package:driverapp/config/config.dart'; import 'package:driverapp/config/config.dart';
import 'package:driverapp/core/model/pending_orders/pending_orders_model.dart'; import 'package:driverapp/core/model/pending_orders/pending_orders_req_model.dart';
import 'package:driverapp/core/model/pending_orders/pending_orders_res_model.dart';
import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart'; import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart';
import 'package:driverapp/core/service/base_service.dart'; import 'package:driverapp/core/service/base_service.dart';
class OrdersService extends BaseService { class OrdersService extends BaseService {
List<PendingOrders> _orders = List(); List<PendingOrdersRes> _orders = List();
List<PendingOrders> get orders => _orders; List<PendingOrdersRes> get orders => _orders;
bool isOrderInserted; bool isOrderInserted;
PendingOrders _requestGetPendingOrders = PendingOrders( PendingOrders _requestGetPendingOrders = PendingOrders(
@ -26,7 +27,7 @@ class OrdersService extends BaseService {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_orders.clear(); _orders.clear();
response['PatientER_Delivery_GetAllOrderList'].forEach((order) { response['PatientER_Delivery_GetAllOrderList'].forEach((order) {
_orders.add(PendingOrders.fromJson(order)); _orders.add(PendingOrdersRes.fromJson(order));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -35,6 +36,7 @@ class OrdersService extends BaseService {
} catch (e) { } catch (e) {
hasError = true; hasError = true;
super.error = error; super.error = error;
throw e; throw e;
} }
} }

@ -1,5 +1,5 @@
import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/pending_orders/pending_orders_model.dart'; import 'package:driverapp/core/model/pending_orders/pending_orders_res_model.dart';
import 'package:driverapp/core/service/orders_service.dart'; import 'package:driverapp/core/service/orders_service.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -8,7 +8,7 @@ import 'base_view_model.dart';
class OrdersViewModel extends BaseViewModel { class OrdersViewModel extends BaseViewModel {
OrdersService _pendingOrdersService = locator<OrdersService>(); OrdersService _pendingOrdersService = locator<OrdersService>();
List<PendingOrders> get orders => _pendingOrdersService.orders; List<PendingOrdersRes> get orders => _pendingOrdersService.orders;
Future getPendingOrders() async { Future getPendingOrders() async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -20,7 +20,6 @@ class OrdersViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future insertOrder() async { Future insertOrder() async {
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
await _pendingOrdersService.insertOrder(); await _pendingOrdersService.insertOrder();

@ -23,8 +23,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
int orderId; int orderId;
return BaseView<OrdersViewModel>( return BaseView<OrdersViewModel>(
onModelReady: (model) => model.getPendingOrders(), onModelReady: (model) => model.getPendingOrders(),
builder: builder: (BuildContext context, OrdersViewModel model, Widget child) =>
(BuildContext context, OrdersViewModel model, Widget child) =>
AppScaffold( AppScaffold(
body: Column( body: Column(
// mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
@ -365,8 +364,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: //model.orders == null ? 0 : model.orders.length, itemCount: model.orders == null ? 0 : model.orders.length,
3, // 2,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Padding( return Padding(
padding: EdgeInsets.symmetric(horizontal: 12.2), padding: EdgeInsets.symmetric(horizontal: 12.2),
@ -388,7 +387,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
padding: EdgeInsets.only(left: 22.0), padding: EdgeInsets.only(left: 22.0),
child: Image.asset( child: Image.asset(
'assets/images/location.png', 'assets/images/location.png',
height: MediaQuery height:
MediaQuery
.of(context) .of(context)
.size .size
.height * .height *
@ -407,25 +407,28 @@ class _DashboardScreenState extends State<DashboardScreen> {
Expanded( Expanded(
flex: 3, flex: 3,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Padding(
model.orders[index].firstName + padding: EdgeInsets.only(top: 5.0),
' ' + child: Text(
model.orders[index].lastName, model.orders[index].firstName +
style: TextStyle(fontSize: 18.0), ' ' +
model.orders[index].lastName,
style: TextStyle(fontSize: 18.0),
),
), ),
Text( Text(
model.orders[index].mobileNumber, model.orders[index].mobileNumber,
style: TextStyle( style: TextStyle(
color: Color(0xff30B7B9), color: Color(0xff30B7B9),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 15.0), fontSize: 15.0,
),
), ),
Expanded( Expanded(
child: Text( child: Text(
'Olaya ST, Behind kfc next to king ,Olaya ST ', 'Olaya ST, Behind kfc next to king ,',
style: TextStyle(color: Colors.black45), style: TextStyle(color: Colors.black45),
), ),
), ),
@ -496,5 +499,4 @@ class _DashboardScreenState extends State<DashboardScreen> {
AppToast.showSuccessToast(message: "Order Added"); AppToast.showSuccessToast(message: "Order Added");
} }
} }
} }

@ -39,13 +39,25 @@ class DeliveryConfirmedPage extends StatelessWidget {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
width: 300, width: MediaQuery
height: 300, .of(context)
padding: EdgeInsets.only(top:60), .size
.width,
//300,
height: MediaQuery
.of(context)
.size
.width * 0.7,
//300,
padding: EdgeInsets.only(
top: MediaQuery
.of(context)
.size
.width * 0.2, //60,
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white10, color: Colors.white10,
shape: BoxShape.circle shape: BoxShape.circle),
),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Icon( Icon(
@ -79,16 +91,29 @@ class DeliveryConfirmedPage extends StatelessWidget {
), ),
], ],
), ),
Stack( Stack(
children: <Widget>[ children: <Widget>[
Container( Container(
width: 400, width: MediaQuery
height: 500, .of(context)
.size
.width, //400,
height: MediaQuery
.of(context)
.size
.width, //500,
), ),
Container( Container(
width: 800, width: MediaQuery
height: 440, .of(context)
.size
.width,
//800,
height: MediaQuery
.of(context)
.size
.width * 1.2,
//440,
margin: EdgeInsets.only(top: 60), margin: EdgeInsets.only(top: 60),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -101,14 +126,20 @@ class DeliveryConfirmedPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(bottom: 50), margin: EdgeInsets.only(
bottom: MediaQuery
.of(context)
.size
.width * 0.15, //50
),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
FlatButton.icon( FlatButton.icon(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
color: Colors.orangeAccent, color: Colors.orangeAccent,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(10.0), borderRadius:
new BorderRadius.circular(10.0),
), ),
icon: Icon( icon: Icon(
Icons.mode_edit, Icons.mode_edit,
@ -122,13 +153,30 @@ class DeliveryConfirmedPage extends StatelessWidget {
), ),
onPressed: () {}, onPressed: () {},
), ),
SizedBox(height: 20,), SizedBox(
height: MediaQuery
.of(context)
.size
.width * 0.1, //20,
),
FlatButton( FlatButton(
color: Color(0xff41bdbb), color: Color(0xff41bdbb),
padding: EdgeInsets.only(right: 100, left: 100), padding:
EdgeInsets.only(
right: MediaQuery
.of(context)
.size
.width * 0.25, //100,
left: MediaQuery
.of(context)
.size
.width * 0.25, //100
),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(18.0), borderRadius:
side: BorderSide(color: Color(0xff41bdbb)), new BorderRadius.circular(18.0),
side:
BorderSide(color: Color(0xff41bdbb)),
), ),
child: Text( child: Text(
TranslationBase TranslationBase
@ -145,10 +193,12 @@ class DeliveryConfirmedPage extends StatelessWidget {
), ),
), ),
CustomerBrief( CustomerBrief(
itemId: item.driverID, itemId: item.patientID,
customerFirstName: item.firstName, customerFirstName: item.firstName,
customerLastName: item.lastName, customerLastName: item.lastName,
mobileNo: item.mobileNumber mobileNo: item.mobileNumber,
totalPayment: item.amount,
deliveryTime: item.orderCreatedOn
), ),
], ],
), ),
@ -161,4 +211,3 @@ class DeliveryConfirmedPage extends StatelessWidget {
); );
} }
} }

@ -15,224 +15,267 @@ class InformationPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// return AppScaffold(
// body: Center(
// child: InkWell(onTap: () {},
// child: Texts('Replay Page')),
// ),
// );
return AppScaffold( return AppScaffold(
body: Container( body: Container(
color: Color(0xff41bdbb), color: Color(0xff41bdbb),
child: ListView( child: Container(
children: <Widget>[ color: Color(0xff41bdbb),
Column( child: ListView(
children: <Widget>[ children: <Widget>[
Row( Column(
crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[
children: <Widget>[ Row(
Container( crossAxisAlignment: CrossAxisAlignment.center,
margin: EdgeInsets.only(right: 50), children: <Widget>[
child: IconButton( Container(
color: Colors.white, margin: EdgeInsets.only(
iconSize: 50, right: MediaQuery
icon: Icon(Icons.arrow_back), .of(context)
onPressed: () { .size
Navigator.pop(context); .width * 0.15, //50
}, ),
), child: IconButton(
),
Container(
child: Text(
TranslationBase
.of(context)
.deliveryInfo,
style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 20, iconSize: 50,
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
},
), ),
), ),
), Container(
], child: Text(
), TranslationBase
Stack( .of(context)
children: <Widget>[ .deliveryInfo,
Container( style: TextStyle(
width: 400, color: Colors.white,
height: 500, fontSize: 20,
),
Container(
width: 800,
height: 700,
margin: EdgeInsets.only(top: 100),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(45),
topRight: Radius.circular(45)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
height: 170,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
delivery_info_button(
btnColor: Color(0xfff44336),
btnIcon: Icon(
Icons.near_me,
size: 30,
color: Colors.white,
),
btnName: TranslationBase
.of(context)
.location,
btnFunction: () {},
),
delivery_info_button(
btnColor: Colors.green,
btnIcon: Icon(
Icons.whatshot,
size: 30,
color: Colors.white,
),
btnName: 'Whatsapp',
btnFunction: () {},
),
delivery_info_button(
btnColor: Colors.orangeAccent,
btnIcon: Icon(
Icons.mail_outline,
size: 30,
color: Colors.white,
),
btnName: TranslationBase
.of(context)
.sms,
btnFunction: () {},
),
delivery_info_button(
btnColor: Color(0xff41bdbb),
btnIcon: Icon(
Icons.phone,
size: 30,
color: Colors.white,
),
btnName: TranslationBase
.of(context)
.call,
btnFunction: () {},
),
],
), ),
SizedBox( ),
height: 30, ),
), ],
Container( ),
margin: EdgeInsets.only(left: 15, right: 15), Stack(
child: Column( children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, Container(
width: MediaQuery
.of(context)
.size
.width, //400,
height: MediaQuery
.of(context)
.size
.width, //500,
),
Container(
width: MediaQuery
.of(context)
.size
.width * 1,
//800,
height: MediaQuery
.of(context)
.size
.width * 1.5,
//700,
margin: EdgeInsets.only(
top: MediaQuery
.of(context)
.size
.width * 0.3, //100
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(45),
topRight: Radius.circular(45)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
height: MediaQuery
.of(context)
.size
.width * 0.2, //170,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Text( delivery_info_button(
TranslationBase btnColor: Color(0xfff44336),
btnIcon: Icon(
Icons.near_me,
size: 30,
color: Colors.white,
),
btnName: TranslationBase
.of(context) .of(context)
.packageContent, .location,
style: TextStyle( btnFunction: () {},
fontWeight: FontWeight.bold,
fontSize: 20),
),
SizedBox(
height: 20,
),
package_content(
packageName: 'Panadol Extra 50 tablet',
packageCount: '5 box',
),
SizedBox(
height: 10,
), ),
package_content( delivery_info_button(
packageName: 'Xeractan 20MG 30 Capsules', btnColor: Colors.green,
packageCount: '1 PCS', btnIcon: Icon(
Icons.whatshot,
size: 30,
color: Colors.white,
),
btnName: 'Whatsapp',
btnFunction: () {},
), ),
SizedBox( delivery_info_button(
height: 10, btnColor: Colors.orangeAccent,
), btnIcon: Icon(
package_content( Icons.mail_outline,
packageName: 'Oltment for Rash unbranded 50 ml', size: 30,
packageCount: '1 tube', color: Colors.white,
), ),
SizedBox( btnName: TranslationBase
height: 10, .of(context)
), .sms,
package_content( btnFunction: () {},
packageName: 'Face Mask 50 Pieces',
packageCount: '1 box',
),
SizedBox(
height: 10,
),
package_content(
packageName: 'Panadol Extra 50 tablet',
packageCount: '5 box',
), ),
SizedBox( delivery_info_button(
height: 10, btnColor: Color(0xff41bdbb),
btnIcon: Icon(
Icons.phone,
size: 30,
color: Colors.white,
),
btnName: TranslationBase
.of(context)
.call,
btnFunction: () {},
), ),
], ],
), ),
), SizedBox(
SizedBox( height: MediaQuery
height: 30, .of(context)
), .size
FlatButton( .width * 0.1, //30,
color: Color(0xff41bdbb), ),
padding: EdgeInsets.only( Container(
right: 100, left: 100, bottom: 15, top: 15), margin: EdgeInsets.only(
shape: RoundedRectangleBorder( left: MediaQuery
borderRadius: new BorderRadius.circular(30.0), .of(context)
side: BorderSide(color: Color(0xff41bdbb)), .size
.width * 0.05, //15,
right: MediaQuery
.of(context)
.size
.width * 0.02, //15
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
TranslationBase
.of(context)
.packageContent,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20),
),
SizedBox(
height: MediaQuery
.of(context)
.size
.width * 0.05, //20,
),
Column(
children: List.generate(
item.itemsQuantitiesList.length,
(index) {
return package_content(
packageName: item
.itemsQuantitiesList[index]
.itemName
.toString(),
//'Panadol Extra 50 tablet',
packageCount: item
.itemsQuantitiesList[index]
.quantity
.toString(),
);
}),
),
SizedBox(
height: MediaQuery
.of(context)
.size
.width * 0.01, //10,
),
],
),
), ),
child: Text( SizedBox(
TranslationBase height: MediaQuery
.of(context) .of(context)
.clientReached, .size
style: TextStyle( .width * 0.1, //30,
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16),
), ),
onPressed: () { FlatButton(
Navigator.push( color: Color(0xff41bdbb),
context, MaterialPageRoute( padding: EdgeInsets.only(
builder: (context) => right: MediaQuery
DeliveryConfirmedPage(item))); .of(context)
}, .size
), .width * 0.3, //100,
], left: MediaQuery
.of(context)
.size
.width * 0.3, //100,
bottom: MediaQuery
.of(context)
.size
.width * 0.035, //15,
top: MediaQuery
.of(context)
.size
.width * 0.035, //15
),
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(30.0),
side: BorderSide(color: Color(0xff41bdbb)),
),
child: Text(
TranslationBase
.of(context)
.clientReached,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16),
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
DeliveryConfirmedPage(item)));
},
),
],
),
), ),
), CustomerBrief(
CustomerBrief( itemId: item.patientID,
itemId: item.driverID, customerFirstName: item.firstName,
customerFirstName: item.firstName, customerLastName: item.lastName,
customerLastName: item.lastName, mobileNo: item.mobileNumber,
mobileNo: item.mobileNumber totalPayment: item.amount,
), deliveryTime: item.orderCreatedOn),
], ],
), ),
], ],
), ),
], ],
),
), ),
), ),
); );
} }
} }

@ -16,8 +16,7 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<OrdersViewModel>( return BaseView<OrdersViewModel>(
onModelReady: (model) => model.getPendingOrders(), onModelReady: (model) => model.getPendingOrders(),
builder: builder: (BuildContext context, OrdersViewModel model, Widget child) =>
(BuildContext context, OrdersViewModel model, Widget child) =>
Scaffold( Scaffold(
appBar: AppBar( appBar: AppBar(
centerTitle: true, centerTitle: true,
@ -97,7 +96,8 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
crossAxisAlignment: CrossAxisAlignment crossAxisAlignment: CrossAxisAlignment
.start, .start,
children: <Widget>[ children: <Widget>[
Expanded( Padding(
padding: EdgeInsets.only(top: 10.0),
child: Text( child: Text(
model.orders[index].firstName + model.orders[index].firstName +
' ' + ' ' +

@ -119,4 +119,14 @@ class DateUtil {
else else
return ""; return "";
} }
static String convertStringToHours(String date) {
DateTime stringDate = convertStringToDate(date);
DateTime dateTime = DateTime.parse(stringDate.toString());
String hours = dateTime.toString();
hours = hours.substring(10, 16);
return hours;
}
} }

@ -1,9 +1,10 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../uitl/date_uitl.dart';
import '../../uitl/translations_delegate_base.dart'; import '../../uitl/translations_delegate_base.dart';
class CustomerBrief extends StatelessWidget { class CustomerBrief extends StatelessWidget {
final int itemId; final String itemId;
final String time; final String time;
final String customerFirstName; final String customerFirstName;
final String customerLastName; final String customerLastName;
@ -119,7 +120,7 @@ class CustomerBrief extends StatelessWidget {
width: 170, width: 170,
), ),
Text( Text(
'SAR 70', totalPayment.toString(), //'SAR 70',
style: TextStyle(fontWeight: FontWeight.bold), style: TextStyle(fontWeight: FontWeight.bold),
), ),
], ],
@ -137,7 +138,12 @@ class CustomerBrief extends StatelessWidget {
SizedBox( SizedBox(
width: 50, width: 50,
), ),
Text('05 Aug 20 - 10:00 AM', Text(
'${DateUtil.getMonthDayYearDateFormatted(
DateUtil.convertStringToDate(
deliveryTime))} ${(DateUtil
.convertStringToHours(deliveryTime))}',
//'05 Aug 20 - 10:00 AM',
style: TextStyle(fontWeight: FontWeight.bold)), style: TextStyle(fontWeight: FontWeight.bold)),
], ],
) )

Loading…
Cancel
Save