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 5 years ago
commit be76c2f21f

@ -8,6 +8,7 @@ class DeliverdOrderModel {
String mobileNo;
String longitude;
String latitude;
String firstName;
DeliverdOrderModel(
{this.driverID,
@ -18,7 +19,8 @@ class DeliverdOrderModel {
this.userID,
this.mobileNo,
this.longitude,
this.latitude});
this.latitude,
this.firstName});
DeliverdOrderModel.fromJson(Map<String, dynamic> json) {
driverID = json['DriverID'];
@ -30,6 +32,7 @@ class DeliverdOrderModel {
mobileNo = json['MobileNo'];
longitude = json['Longitude'];
latitude = json['Latitude'];
firstName = json['FirstName'];
}
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/uitl/utils.dart';
import 'package:location/location.dart';
import 'package:driverapp/core/model/orders/deliverd_order_res_model.dart';
class OrdersService extends BaseService {
List<PendingOrdersRes> _orders = List();
List<PendingOrdersRes> _nextOrdersList = List();
List<DeliverdOrderModel> _deliverdOrderList = List();
List<DeliverdOrderResModel> _deliverdOrderList = List();
List<PendingOrdersRes> get orders => _orders;
List<DeliverdOrderModel> get deliverdOrderList => _deliverdOrderList;
List<DeliverdOrderResModel> get deliverdOrderList => _deliverdOrderList;
List<PendingOrdersRes> get nextOrdersList => _nextOrdersList;
bool isOrderInserted;
@ -126,7 +127,7 @@ class OrdersService extends BaseService {
onSuccess: (dynamic response, int statusCode) {
_deliverdOrderList.clear();
response['PatientER_Delivery_GetAllDeliverdOrderList'].forEach((order) {
_deliverdOrderList.add(DeliverdOrderModel.fromJson(order));
_deliverdOrderList.add(DeliverdOrderResModel.fromJson(order));
});
}, onFailure: (String error, int statusCode) {
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/scan_qr/scan_qr_request_model.dart';
import 'package:driverapp/core/service/orders_service.dart';
import 'package:driverapp/core/model/orders/deliverd_order_res_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
@ -14,7 +14,7 @@ class OrdersViewModel extends BaseViewModel {
List<PendingOrdersRes> get orders => _ordersService.orders;
List<DeliverdOrderModel> get deliverdOrders =>
List<DeliverdOrderResModel> get deliverdOrders =>
_ordersService.deliverdOrderList;
List<PendingOrdersRes> get nextOrdersList => _ordersService.nextOrdersList;

@ -68,79 +68,82 @@ class DeliveryConfirmedPage extends StatelessWidget {
fontWeight: FontWeight.bold),
),
SizedBox(
height:
MediaQuery.of(context).size.width * 0.03,
),
Text(
TranslationBase.of(context).confirmationSent,
style: TextStyle(
color: Colors.white,
fontSize: 13,
height:
MediaQuery.of(context).size.width *
0.01,
),
),
],
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(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
topRight: Radius.circular(80)),
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.only(
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),
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(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
topRight: Radius.circular(80)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.only(
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(
Icons.mode_edit,
color: Colors.white,
SizedBox(
height: MediaQuery.of(context).size.width *
0.02, //20,
),
onPressed: () {},
),
SizedBox(
height:
MediaQuery.of(context).size.width * 0.02, //20,
),
Container(
margin: EdgeInsets.all(10),
Container(
margin: EdgeInsets.all(10),
child: SecondaryButton(
label: TranslationBase
.of(context)
.nextDelivery,
loading: model.state == ViewState.BusyLocal,
onTap: () {
getNextOrder(context, model);},
label: TranslationBase.of(context)
.nextDelivery,
loading: model.state == ViewState.BusyLocal,
onTap: () {
getNextOrder(context, model);
},
),
),
],

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

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

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

Loading…
Cancel
Save