Merge branches 'development' and 'merge_fix_issues_into_dev' of https://gitlab.com/Cloud_Solution/driver-app into merge_fix_issues_into_dev

 Conflicts:
	lib/pages/orders/deliverd_orders_page.dart
logut
Elham Rababah 6 years ago
commit be76c2f21f

@ -8,6 +8,7 @@ class DeliverdOrderModel {
String mobileNo; String mobileNo;
String longitude; String longitude;
String latitude; String latitude;
String firstName;
DeliverdOrderModel( DeliverdOrderModel(
{this.driverID, {this.driverID,
@ -18,7 +19,8 @@ class DeliverdOrderModel {
this.userID, this.userID,
this.mobileNo, this.mobileNo,
this.longitude, this.longitude,
this.latitude}); this.latitude,
this.firstName});
DeliverdOrderModel.fromJson(Map<String, dynamic> json) { DeliverdOrderModel.fromJson(Map<String, dynamic> json) {
driverID = json['DriverID']; driverID = json['DriverID'];
@ -30,6 +32,7 @@ class DeliverdOrderModel {
mobileNo = json['MobileNo']; mobileNo = json['MobileNo'];
longitude = json['Longitude']; longitude = json['Longitude'];
latitude = json['Latitude']; latitude = json['Latitude'];
firstName = json['FirstName'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {

@ -0,0 +1,158 @@
class DeliverdOrderResModel {
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;
int ePharmacyOrderNo;
int projectID;
String appointmentNo;
String dischargeID;
String patientID;
bool patientOutSA;
int channel;
double distanceInKilometers;
List<ItemsQuantitiesList> itemsQuantitiesList;
DeliverdOrderResModel(
{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.channel,
this.distanceInKilometers,
this.itemsQuantitiesList});
DeliverdOrderResModel.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'];
channel = json['Channel'];
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['Channel'] = this.channel;
data['DistanceInKilometers'] = this.distanceInKilometers;
if (this.itemsQuantitiesList != null) {
data['ItemsQuantitiesList'] =
this.itemsQuantitiesList.map((v) => v.toJson()).toList();
}
return data;
}
}
class ItemsQuantitiesList {
String itemName;
String itemNameN;
int productID;
int quantity;
ItemsQuantitiesList(
{this.itemName, this.itemNameN, this.productID, this.quantity});
ItemsQuantitiesList.fromJson(Map<String, dynamic> json) {
itemName = json['ItemName'];
itemNameN = json['ItemNameN'];
productID = json['ProductID'];
quantity = json['Quantity'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ItemName'] = this.itemName;
data['ItemNameN'] = this.itemNameN;
data['ProductID'] = this.productID;
data['Quantity'] = this.quantity;
return data;
}
}

@ -8,13 +8,14 @@ import 'package:driverapp/core/service/base_service.dart';
import 'package:driverapp/core/model/orders/deliverd_order_req_model.dart'; import 'package:driverapp/core/model/orders/deliverd_order_req_model.dart';
import 'package:driverapp/uitl/utils.dart'; import 'package:driverapp/uitl/utils.dart';
import 'package:location/location.dart'; import 'package:location/location.dart';
import 'package:driverapp/core/model/orders/deliverd_order_res_model.dart';
class OrdersService extends BaseService { class OrdersService extends BaseService {
List<PendingOrdersRes> _orders = List(); List<PendingOrdersRes> _orders = List();
List<PendingOrdersRes> _nextOrdersList = List(); List<PendingOrdersRes> _nextOrdersList = List();
List<DeliverdOrderModel> _deliverdOrderList = List(); List<DeliverdOrderResModel> _deliverdOrderList = List();
List<PendingOrdersRes> get orders => _orders; List<PendingOrdersRes> get orders => _orders;
List<DeliverdOrderModel> get deliverdOrderList => _deliverdOrderList; List<DeliverdOrderResModel> get deliverdOrderList => _deliverdOrderList;
List<PendingOrdersRes> get nextOrdersList => _nextOrdersList; List<PendingOrdersRes> get nextOrdersList => _nextOrdersList;
bool isOrderInserted; bool isOrderInserted;
@ -126,7 +127,7 @@ class OrdersService extends BaseService {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_deliverdOrderList.clear(); _deliverdOrderList.clear();
response['PatientER_Delivery_GetAllDeliverdOrderList'].forEach((order) { response['PatientER_Delivery_GetAllDeliverdOrderList'].forEach((order) {
_deliverdOrderList.add(DeliverdOrderModel.fromJson(order)); _deliverdOrderList.add(DeliverdOrderResModel.fromJson(order));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -5,7 +5,7 @@ import 'package:driverapp/core/model/orders/pending_orders_res_model.dart';
import 'package:driverapp/core/model/orders/update_order_status_request_model.dart'; import 'package:driverapp/core/model/orders/update_order_status_request_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/orders_service.dart'; import 'package:driverapp/core/service/orders_service.dart';
import 'package:driverapp/core/model/orders/deliverd_order_res_model.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
@ -14,7 +14,7 @@ class OrdersViewModel extends BaseViewModel {
List<PendingOrdersRes> get orders => _ordersService.orders; List<PendingOrdersRes> get orders => _ordersService.orders;
List<DeliverdOrderModel> get deliverdOrders => List<DeliverdOrderResModel> get deliverdOrders =>
_ordersService.deliverdOrderList; _ordersService.deliverdOrderList;
List<PendingOrdersRes> get nextOrdersList => _ordersService.nextOrdersList; List<PendingOrdersRes> get nextOrdersList => _ordersService.nextOrdersList;

@ -68,79 +68,82 @@ class DeliveryConfirmedPage extends StatelessWidget {
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
SizedBox( SizedBox(
height: height:
MediaQuery.of(context).size.width * 0.03, MediaQuery.of(context).size.width *
), 0.01,
Text(
TranslationBase.of(context).confirmationSent,
style: TextStyle(
color: Colors.white,
fontSize: 13,
), ),
), Text(
], TranslationBase.of(context)
.confirmationSent,
style: TextStyle(
color: Colors.white,
fontSize: 13,
),
),
],
),
), ),
), ],
], ),
), ),
), ],
],
),
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width,
),
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width * 1.0,
margin: EdgeInsets.only(
top: MediaQuery.of(context).size.width * 0.75,
), ),
decoration: BoxDecoration( Container(
color: Colors.white, width: MediaQuery.of(context).size.width,
borderRadius: BorderRadius.only( height: MediaQuery.of(context).size.width,
topLeft: Radius.circular(80),
topRight: Radius.circular(80)),
), ),
child: Column( Container(
mainAxisAlignment: MainAxisAlignment.end, width: MediaQuery.of(context).size.width,
crossAxisAlignment: CrossAxisAlignment.center, height: MediaQuery.of(context).size.width * 1.0,
children: <Widget>[ margin: EdgeInsets.only(
Container( top: MediaQuery.of(context).size.width * 0.75,
margin: EdgeInsets.only( ),
bottom: MediaQuery.of(context).size.width * 0.09, decoration: BoxDecoration(
), color: Colors.white,
child: Column( borderRadius: BorderRadius.only(
children: <Widget>[ topLeft: Radius.circular(80),
FlatButton.icon( topRight: Radius.circular(80)),
padding: EdgeInsets.all(8), ),
color: Colors.orangeAccent, child: Column(
shape: RoundedRectangleBorder( mainAxisAlignment: MainAxisAlignment.end,
borderRadius: new BorderRadius.circular(10.0), crossAxisAlignment: CrossAxisAlignment.center,
), children: <Widget>[
label: Text( Container(
TranslationBase.of(context).addNoteBtn, margin: EdgeInsets.only(
style: TextStyle(color: Colors.white), bottom: MediaQuery.of(context).size.width * 0.09,
),
child: Column(
children: <Widget>[
FlatButton.icon(
padding: EdgeInsets.all(8),
color: Colors.orangeAccent,
shape: RoundedRectangleBorder(
borderRadius:
new BorderRadius.circular(10.0),
),
label: Text(
TranslationBase.of(context).addNoteBtn,
style: TextStyle(color: Colors.white),
),
icon: Icon(
Icons.mode_edit,
color: Colors.white,
),
onPressed: () {},
), ),
icon: Icon( SizedBox(
Icons.mode_edit, height: MediaQuery.of(context).size.width *
color: Colors.white, 0.02, //20,
), ),
onPressed: () {}, Container(
), margin: EdgeInsets.all(10),
SizedBox(
height:
MediaQuery.of(context).size.width * 0.02, //20,
),
Container(
margin: EdgeInsets.all(10),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase label: TranslationBase.of(context)
.of(context) .nextDelivery,
.nextDelivery, loading: model.state == ViewState.BusyLocal,
loading: model.state == ViewState.BusyLocal, onTap: () {
onTap: () { getNextOrder(context, model);
getNextOrder(context, model);}, },
), ),
), ),
], ],

@ -22,8 +22,7 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
builder: (BuildContext context, OrdersViewModel model, Widget child) => builder: (BuildContext context, OrdersViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: appBarTitle: 'Delivered List',
"UnDelivered Packages " /*TranslationBase.of(context).yourDeliveryQue*/,
titleColor: Colors.black, titleColor: Colors.black,
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
@ -34,7 +33,9 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
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.deliverdOrders == null
? 0
: model.deliverdOrders.length,
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),
@ -87,7 +88,7 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
Padding( Padding(
padding: EdgeInsets.only(top: 20.0), padding: EdgeInsets.only(top: 20.0),
child: Text( child: Text(
model.orders[index].firstName + model.deliverdOrders[index].firstName +
' ' + ' ' +
model.orders[index].lastName, model.orders[index].lastName,
style: TextStyle( style: TextStyle(
@ -97,7 +98,7 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
), ),
), ),
Text( Text(
model.orders[index].mobileNumber, model.deliverdOrders[index].mobileNumber,
style: TextStyle( style: TextStyle(
color: Color(0xff30B7B9), color: Color(0xff30B7B9),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -106,7 +107,8 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
), ),
Expanded( Expanded(
child: Text( child: Text(
model.orders[index].orderID.toString(), model.deliverdOrders[index].orderID
.toString(),
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
@ -120,9 +122,10 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: CircleContainer( child: CircleContainer(
child: Text( child: Text(
model.orders[index].distanceInKilometers model.deliverdOrders[index]
.distanceInKilometers
.toString() + .toString() +
' K.m\naway', '\nK.m\naway',
style: TextStyle( style: TextStyle(
color: Color(0xff42B6AD), color: Color(0xff42B6AD),
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
@ -133,13 +136,13 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
], ],
), ),
), ),
onTap: () { // onTap: () {
Navigator.push( // Navigator.push(
context, // context,
MaterialPageRoute( // MaterialPageRoute(
builder: (context) => // builder: (context) =>
InformationPage(model.orders[index]))); // InformationPage(model.orders[index])));
}, // },
), ),
); );
}, },

@ -63,7 +63,8 @@ class ActionSheetButton extends StatelessWidget {
padding: EdgeInsets.only(top: 5.0), padding: EdgeInsets.only(top: 5.0),
child: Text( child: Text(
label, label,
style: TextStyle(fontSize: 22.0, style: TextStyle(
fontSize: 22.0,
fontFamily: "Metropolis-Bold", fontFamily: "Metropolis-Bold",
color: Hexcolor("##1A1818")), color: Hexcolor("##1A1818")),
), ),

@ -22,7 +22,7 @@ class CustomDialog extends StatelessWidget {
builder: (_, model, w) => Center( builder: (_, model, w) => Center(
child: Container( child: Container(
height: SizeConfig.isPortrait height: SizeConfig.isPortrait
? MediaQuery.of(context).size.height * 0.43 ? MediaQuery.of(context).size.height * 0.49
: MediaQuery.of(context).size.height * 0.90, : MediaQuery.of(context).size.height * 0.90,
width: MediaQuery.of(context).size.width * 0.95, width: MediaQuery.of(context).size.width * 0.95,
child: Dialog( child: Dialog(
@ -58,9 +58,7 @@ class CustomDialog extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Texts( Texts(
TranslationBase TranslationBase.of(context).areYouSure,
.of(context)
.areYouSure,
color: Colors.black, color: Colors.black,
fontSize: 20, fontSize: 20,
), ),
@ -72,21 +70,18 @@ class CustomDialog extends StatelessWidget {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SecondaryButton( SecondaryButton(
label: TranslationBase label: TranslationBase.of(context).confirm,
.of(context)
.confirm,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
onTap: () { onTap: () {
model.setState(ViewState.BusyLocal); model.setState(ViewState.BusyLocal);
callService(); callService();
}, },
), SizedBox( ),
SizedBox(
height: 10, height: 10,
), ),
SecondaryButton( SecondaryButton(
label: TranslationBase label: TranslationBase.of(context).canceled,
.of(context)
.canceled,
onTap: () { onTap: () {
model.hideBottomSheet(); model.hideBottomSheet();
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -95,7 +90,6 @@ class CustomDialog extends StatelessWidget {
], ],
), ),
), ),
], ],
), ),
) )

Loading…
Cancel
Save