Merge branch 'development' into 'master'

Development

See merge request Cloud_Solution/driver-app!79
master_hussam
Mohammad Aljammal 6 years ago
commit 56b9fbabf9

@ -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;
}
}

@ -6,26 +6,21 @@ import 'package:driverapp/core/model/orders/update_order_status_request_model.da
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';
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: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;
bool isOrderStatusUpdated; bool isOrderStatusUpdated;
PendingOrders _requestGetPendingOrders = PendingOrders(
searchKey: "",
pageSize: 0,
pageIndex: 0,
latitude: "24.640000",
longitude: "46.753000",
);
DeliverdOrderModel _requestGetDeliverdOrders = DeliverdOrderModel( DeliverdOrderModel _requestGetDeliverdOrders = DeliverdOrderModel(
searchKey: "", searchKey: "",
pageSize: 0, pageSize: 0,
@ -35,6 +30,14 @@ class OrdersService extends BaseService {
); );
Future getPendingOrders() async { Future getPendingOrders() async {
LocationData loc = await Utils.getLocation();
PendingOrders _requestGetPendingOrders = PendingOrders(
searchKey: "",
pageSize: 0,
pageIndex: 0,
latitude: loc.latitude.toString(),
longitude: loc.longitude.toString(),
);
hasError = false; hasError = false;
try { try {
await baseAppClient.post(GET_ALL_ORDERS, await baseAppClient.post(GET_ALL_ORDERS,
@ -110,13 +113,21 @@ class OrdersService extends BaseService {
} }
Future getDeliverdList() async { Future getDeliverdList() async {
LocationData loc = await Utils.getLocation();
PendingOrders _requestGetPendingOrders = PendingOrders(
searchKey: "",
pageSize: 0,
pageIndex: 0,
latitude: loc.latitude.toString(),
longitude: loc.longitude.toString(),
);
hasError = false; hasError = false;
try { try {
await baseAppClient.post(GET_ALL_DELIVERD_ORDER, await baseAppClient.post(GET_ALL_DELIVERD_ORDER,
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;

@ -1,4 +1,4 @@
import 'package:driverapp/root_page.dart'; import 'package:driverapp/pages/splash_screen_page.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart'; import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
@ -81,8 +81,9 @@ class MyApp extends StatelessWidget {
), ),
), ),
), ),
initialRoute: '/', home: SplashScreenPage(),
routes: {'/': (context) => RootPage()}, // initialRoute: '/',
// routes: {'/': (context) => RootPage()},
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
), ),
), ),

@ -5,6 +5,7 @@ import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart';
import 'package:driverapp/core/viewModels/authentication_view_model.dart'; import 'package:driverapp/core/viewModels/authentication_view_model.dart';
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/pages/delivery/information_page.dart';
import 'package:driverapp/pages/orders/deliverd_orders_page.dart';
import 'package:driverapp/pages/orders/pending_orders_page.dart'; import 'package:driverapp/pages/orders/pending_orders_page.dart';
import 'package:driverapp/pages/setting/setting.dart'; import 'package:driverapp/pages/setting/setting.dart';
import 'package:driverapp/uitl/app_toast.dart'; import 'package:driverapp/uitl/app_toast.dart';
@ -18,7 +19,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:driverapp/pages/orders/deliverd_orders_page.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
@ -76,8 +76,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Text( child: Text(
_authenticationViewModel.user.userName, _authenticationViewModel.user.userName,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w400, fontSize: 22.0,
fontSize: 25.0), color: Hexcolor("#343333"),
fontWeight: FontWeight.bold),
), ),
), ),
], ],
@ -355,12 +356,26 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () {
_scanQrAndGetPatient(context, model);
},
child: Container( child: Container(
height: MediaQuery.of(context).orientation == height: MediaQuery
Orientation.portrait .of(context)
? MediaQuery.of(context).size.height * 0.18 .orientation ==
: MediaQuery.of(context).size.height * 0.30, Orientation.portrait
width: MediaQuery.of(context).size.width * 0.50, ? MediaQuery
.of(context)
.size
.height * 0.18
: MediaQuery
.of(context)
.size
.height * 0.30,
width: MediaQuery
.of(context)
.size
.width * 0.50,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0), borderRadius: BorderRadius.circular(15.0),
gradient: LinearGradient( gradient: LinearGradient(
@ -381,50 +396,50 @@ class _DashboardScreenState extends State<DashboardScreen> {
width: MediaQuery.of(context).size.width * width: MediaQuery.of(context).size.width *
0.26, 0.26,
height: MediaQuery.of(context) height: MediaQuery.of(context)
.orientation == .orientation ==
Orientation.portrait Orientation.portrait
? MediaQuery.of(context).size.height * ? MediaQuery.of(context).size.height *
0.14 0.14
: MediaQuery.of(context).size.height * : MediaQuery.of(context).size.height *
0.28, 0.28,
fit: BoxFit.contain, fit: BoxFit.contain,
) )
], ],
), ),
Column( Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceEvenly, MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
InkWell( Padding(
onTap: () { padding: EdgeInsets.only(top: 8.0),
_scanQrAndGetPatient(context, model); child: Text(
}, TranslationBase
child: Padding( .of(context)
padding: EdgeInsets.only(top: 8.0), .scan,
child: Text( style: TextStyle(
TranslationBase.of(context).scan, fontSize: MediaQuery
style: TextStyle( .of(context)
fontSize: MediaQuery.of(context) .orientation ==
.orientation == Orientation.landscape
Orientation.landscape ? SizeConfig.textMultiplier * 6.0
? SizeConfig.textMultiplier * 6.0 : SizeConfig.textMultiplier * 4.0,
: SizeConfig.textMultiplier * 4.0, color: Colors.white,
color: Colors.white, fontWeight: FontWeight.w400,
fontWeight: FontWeight.w400,
),
), ),
), ),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 0.0), padding: EdgeInsets.only(top: 0.0),
child: Text( child: Text(
TranslationBase.of(context) TranslationBase
.of(context)
.toAddPackageToQue, .toAddPackageToQue,
style: TextStyle( style: TextStyle(
fontSize: MediaQuery.of(context) fontSize: MediaQuery
.orientation == .of(context)
Orientation.landscape .orientation ==
Orientation.landscape
? SizeConfig.textMultiplier * 3.0 ? SizeConfig.textMultiplier * 3.0
: SizeConfig.textMultiplier * 2.0, : SizeConfig.textMultiplier * 2.0,
color: Colors.white, color: Colors.white,
@ -443,25 +458,22 @@ class _DashboardScreenState extends State<DashboardScreen> {
], ],
), ),
), ),
NetworkBaseView( Padding(
baseViewModel: model, padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 1.0),
child: Padding( child: Row(
padding: mainAxisAlignment: MainAxisAlignment.spaceBetween,
EdgeInsets.symmetric(horizontal: 20.0, vertical: 1.0), children: <Widget>[
child: Row( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
children: <Widget>[ Text(
Column(
children: <Widget>[
Text(
TranslationBase.of(context).nearestDropOffs, TranslationBase.of(context).nearestDropOffs,
style: TextStyle( style: TextStyle(
fontSize: 21.0, fontSize: 18.0,
fontWeight: FontWeight.w400, color: Hexcolor("#343333"),
), fontWeight: FontWeight.bold)),
), ],
], ),
), if (model.state == ViewState.Idle)
Column( Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
@ -480,16 +492,16 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
], ],
), ),
onTap: () => Navigator.push( onTap: () =>
context, Navigator.push(
MaterialPageRoute( context,
builder: (context) => OrdersListScreen()), MaterialPageRoute(
), builder: (context) => OrdersListScreen()),
),
), ),
], ],
), ),
], ],
),
), ),
), ),
NetworkBaseView( NetworkBaseView(
@ -503,109 +515,131 @@ class _DashboardScreenState extends State<DashboardScreen> {
: model.orders.length < 3 ? model.orders.length : 3, : model.orders.length < 3 ? model.orders.length : 3,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Padding( return Padding(
padding: EdgeInsets.symmetric(horizontal: 12.2), padding: EdgeInsets.symmetric(horizontal: 0.2),
child: InkWell( child: InkWell(
child: RoundedContainer( child: Container(
raduis: 25.0, child: RoundedContainer(
height: MediaQuery.of(context).orientation == showShadow: true,
Orientation.portrait raduis: 25.0,
? MediaQuery.of(context).size.height * 0.120 height: MediaQuery
: MediaQuery.of(context).size.height * 0.209, .of(context)
child: Row( .orientation ==
mainAxisAlignment: MainAxisAlignment.spaceBetween, Orientation.portrait
children: <Widget>[ ? MediaQuery
Expanded( .of(context)
flex: 1, .size
child: Column( .height * 0.120
mainAxisAlignment: MainAxisAlignment.start, : MediaQuery
crossAxisAlignment: .of(context)
CrossAxisAlignment.start, .size
children: <Widget>[ .height * 0.209,
Padding( child: Row(
padding: EdgeInsets.only( mainAxisAlignment:
left: 15.0, top: 14.0), MainAxisAlignment.spaceBetween,
child: Image.asset( children: <Widget>[
'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)
Expanded( Expanded(
flex: 5, flex: 1,
child: Column( child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(top: 20.0), padding: EdgeInsets.only(
child: Text( left: 15.0, top: 14.0),
model.orders[index].firstName + child: Image.asset(
' ' + 'assets/images/location.png',
model.orders[index].lastName, height: MediaQuery
style: TextStyle(fontSize: 18.0), .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.orders[index].mobileNumber, ),
style: TextStyle( ),
color: Color(0xff30B7B9), if (model.orders.length != 0)
fontWeight: FontWeight.w600, Expanded(
fontSize: 15.0, flex: 5,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 20.0),
child: Text(
model.orders[index].firstName +
' ' +
model.orders[index].lastName,
style: TextStyle(
fontSize: 18.0,
color: Hexcolor("#343333"),
fontWeight: FontWeight.bold),
),
), ),
), Text(
Expanded( model.orders[index].mobileNumber,
child: Text(
model.orders[index].orderID
.toString(),
style: TextStyle( style: TextStyle(
fontSize: 15.0, color: Color(0xff30B7B9),
fontWeight: FontWeight.w400, fontWeight: FontWeight.w600,
letterSpacing: 8.0), fontSize: 15.0,
),
), ),
), Expanded(
], child: Text(
model.orders[index].orderID
.toString(),
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.w400,
letterSpacing: 8.0),
),
),
],
),
), ),
), Padding(
Padding( padding: EdgeInsets.all(8.0),
padding: EdgeInsets.all(8.0), child: CircleContainer(
child: CircleContainer( borderWidth: 1.5,
borderWidth: 0.9, child: Text(
child: Text( model.orders[index].distanceInKilometers
model.orders[index].distanceInKilometers .toString() +
.toString() + '\nK.m\naway',
'\nK.m\naway', style: TextStyle(
style: TextStyle( color: Color(0xff42B6AD),
color: Color(0xff42B6AD), fontWeight: FontWeight.w800,
fontWeight: FontWeight.w800, fontStyle: FontStyle.normal),
fontStyle: FontStyle.normal), ),
), ),
), ),
), ],
], ),
), ),
), ),
onTap: () { onTap: () {

@ -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);}, },
), ),
), ),
], ],

File diff suppressed because one or more lines are too long

@ -1,11 +1,11 @@
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/pages/delivery/information_page.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/widgets/data_display/circle-container.dart'; import 'package:driverapp/widgets/data_display/circle-container.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; import 'package:driverapp/widgets/others/app_scaffold_widget.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';
import 'package:hexcolor/hexcolor.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
@ -22,15 +22,20 @@ 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: TranslationBase.of(context).yourDeliveryQue, appBarTitle: 'Delivered List',
titleColor: Colors.black, titleColor: Colors.black,
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
SizedBox(
height: 20,
),
Expanded( Expanded(
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),
@ -83,14 +88,17 @@ 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(fontSize: 18.0), style: TextStyle(
fontSize: 18.0,
color: Hexcolor("#343333"),
fontWeight: FontWeight.bold),
), ),
), ),
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,
@ -99,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,
@ -112,11 +121,11 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
Padding( Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: CircleContainer( child: CircleContainer(
borderWidth: 0.8,
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,
@ -127,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])));
}, // },
), ),
); );
}, },

@ -1,11 +1,13 @@
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/pages/delivery/information_page.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/widgets/data_display/circle-container.dart'; import 'package:driverapp/widgets/data_display/circle-container.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; import 'package:driverapp/widgets/others/app_scaffold_widget.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';
import 'package:driverapp/uitl/translations_delegate_base.dart'; import 'package:hexcolor/hexcolor.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
class OrdersListScreen extends StatefulWidget { class OrdersListScreen extends StatefulWidget {
@ -25,6 +27,9 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
titleColor: Colors.black, titleColor: Colors.black,
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
SizedBox(
height: 20,
),
Expanded( Expanded(
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
@ -85,7 +90,10 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
model.orders[index].firstName + model.orders[index].firstName +
' ' + ' ' +
model.orders[index].lastName, model.orders[index].lastName,
style: TextStyle(fontSize: 18.0), style: TextStyle(
fontSize: 18.0,
color: Hexcolor("#343333"),
fontWeight: FontWeight.bold),
), ),
), ),
Text( Text(
@ -111,7 +119,6 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
Padding( Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: CircleContainer( child: CircleContainer(
borderWidth: 0.8,
child: Text( child: Text(
model.orders[index].distanceInKilometers model.orders[index].distanceInKilometers
.toString() + .toString() +

@ -0,0 +1,150 @@
import 'dart:async';
import 'package:driverapp/app-icons/driver_app_icons.dart';
import 'package:driverapp/core/viewModels/project_view_model.dart';
import 'package:driverapp/root_page.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class SplashScreenPage extends StatefulWidget {
@override
_SplashScreenPageState createState() => _SplashScreenPageState();
}
class _SplashScreenPageState extends State<SplashScreenPage> {
startTime() async {
var _duration = new Duration(seconds: 1);
return new Timer(_duration, navigationPage);
}
@override
void initState() {
super.initState();
startTime();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: false,
appBarColor: Color(0xff30B7B9),
body: SingleChildScrollView(
child: Center(
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
FractionallySizedBox(
widthFactor: 0.80,
child: Column(
children: <Widget>[
SizedBox(
height: 200,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Icon(
DriverApp.logo,
size: 110,
color: Colors.white,
),
margin: EdgeInsets.only(
right: projectViewModel.isArabic
? 0
: MediaQuery.of(context).size.width * 0.15,
left: !projectViewModel.isArabic
? 0
: MediaQuery.of(context).size.width * 0.15),
),
],
),
SizedBox(
height: 20,
),
Column(
children: <Widget>[
Text(
"Driver",
style: TextStyle(
fontSize: 70,
fontWeight: FontWeight.bold,
color: Colors.white),
),
Text(
"Delivery",
style: TextStyle(
fontSize: 50,
letterSpacing: 1,
color: Colors.white),
),
Text(
"APP",
style: TextStyle(
fontSize: 53,
letterSpacing: 53,
color: Colors.white,
fontWeight: FontWeight.w400),
),
],
),
SizedBox(
height: 280,
)
],
),
),
Center(
child: FractionallySizedBox(
widthFactor: 0.80,
child: Column(
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(horizontal: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
child: Center(
child: Text(
"Powered by Cloud Solutions",
style: TextStyle(
fontSize: 13, color: Colors.white),
),
),
),
SizedBox(
height: 10,
)
],
),
),
],
),
],
),
),
),
],
),
),
),
);
}
void navigationPage() {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => RootPage(),
),
);
}
}

@ -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")),
), ),

@ -6,7 +6,7 @@ class CircleContainer extends StatelessWidget {
{this.child, {this.child,
this.color = Colors.white, this.color = Colors.white,
this.borderColor, this.borderColor,
this.borderWidth = 2.0, this.borderWidth = 1.5,
this.onTap}); this.onTap});
final Widget child; final Widget child;

@ -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 {
], ],
), ),
), ),
], ],
), ),
) )

@ -1,6 +1,6 @@
import 'package:driverapp/widgets/data_display/circle-container.dart'; import 'package:driverapp/widgets/data_display/circle-container.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:driverapp/config/size_config.dart';
import '../../uitl/date_uitl.dart'; import '../../uitl/date_uitl.dart';
import '../../uitl/translations_delegate_base.dart'; import '../../uitl/translations_delegate_base.dart';
@ -36,9 +36,9 @@ class CustomerBriefCard extends StatelessWidget {
return Center( return Center(
child: Container( child: Container(
width: MediaQuery.of(context).orientation == Orientation.landscape width: MediaQuery.of(context).orientation == Orientation.landscape
? 580 ? SizeConfig.widthMultiplier * 125.0
: 370, : SizeConfig.widthMultiplier * 90.0,
height: 270, height: 290,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@ -76,7 +76,6 @@ class CustomerBriefCard extends StatelessWidget {
child: Padding( child: Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: CircleContainer( child: CircleContainer(
borderWidth: 0.9,
child: Text( child: Text(
'0 K.m\naway', '0 K.m\naway',
style: TextStyle( style: TextStyle(

@ -33,7 +33,8 @@ class AppScaffold extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.context = context; AppGlobal.context = context;
return SafeArea( return SafeArea(
bottom: false, // top: false,
// bottom: false,
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor:
appBarColor ?? Theme.of(context).scaffoldBackgroundColor, appBarColor ?? Theme.of(context).scaffoldBackgroundColor,
@ -43,8 +44,8 @@ class AppScaffold extends StatelessWidget {
backgroundColor: Theme.of(context).appBarTheme.color, backgroundColor: Theme.of(context).appBarTheme.color,
textTheme: TextTheme( textTheme: TextTheme(
headline6: TextStyle( headline6: TextStyle(
color: titleColor ?? Colors.white, color: titleColor ?? Colors.white,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
title: Text(appBarTitle.toUpperCase()), title: Text(appBarTitle.toUpperCase()),
leading: Builder( leading: Builder(

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class RoundedContainer extends StatefulWidget { class RoundedContainer extends StatefulWidget {
final double width; final double width;
@ -16,6 +17,7 @@ class RoundedContainer extends StatefulWidget {
final double bottomLeft; final double bottomLeft;
final Widget child; final Widget child;
final double borderWidth; final double borderWidth;
final bool showShadow;
RoundedContainer( RoundedContainer(
{@required this.child, {@required this.child,
@ -32,12 +34,14 @@ class RoundedContainer extends StatefulWidget {
this.topRight = 0, this.topRight = 0,
this.bottomRight = 0, this.bottomRight = 0,
this.bottomLeft = 0, this.bottomLeft = 0,
this.borderWidth = 1}); this.borderWidth = 1,
this.showShadow = true});
@override @override
_RoundedContainerState createState() => _RoundedContainerState(); _RoundedContainerState createState() => _RoundedContainerState();
} }
class _RoundedContainerState extends State<RoundedContainer> { class _RoundedContainerState extends State<RoundedContainer> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -45,36 +49,40 @@ class _RoundedContainerState extends State<RoundedContainer> {
width: widget.width, width: widget.width,
height: widget.height, height: widget.height,
margin: EdgeInsets.all(widget.margin), margin: EdgeInsets.all(widget.margin),
decoration: widget.showBorder == true decoration:
? BoxDecoration( BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme
border: Border.all( .of(context)
color: widget.borderColor, width: widget.borderWidth), .primaryColor,
borderRadius: widget.customCornerRaduis
? BorderRadius.only( border: widget.showBorder == true ? Border.all(
topLeft: Radius.circular(widget.topLeft), color: widget.borderColor, width: widget.borderWidth) : null,
topRight: Radius.circular(widget.topRight), borderRadius: widget.customCornerRaduis
bottomRight: Radius.circular(widget.bottomRight), ? BorderRadius.only(
bottomLeft: Radius.circular(widget.bottomLeft)) topLeft: Radius.circular(widget.topLeft),
: BorderRadius.circular(widget.raduis), topRight: Radius.circular(widget.topRight),
boxShadow: [ bottomRight: Radius.circular(widget.bottomRight),
BoxShadow( bottomLeft: Radius.circular(widget.bottomLeft))
color: Colors.grey.withOpacity(0.1), : BorderRadius.circular(widget.raduis),
spreadRadius: 10,
blurRadius: 5, boxShadow: widget.showShadow ? [
offset: Offset(0, 5), // changes position of shadow BoxShadow(
), color: Hexcolor("#DBE5E6"),
]) spreadRadius: 15,
: null, blurRadius: 15,
offset: Offset(0, 7), // changes position of shadow
),
] : [])
,
child: Card( child: Card(
margin: EdgeInsets.all(0), margin: EdgeInsets.all(0),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: widget.customCornerRaduis borderRadius: widget.customCornerRaduis
? BorderRadius.only( ? BorderRadius.only(
topLeft: Radius.circular(widget.topLeft), topLeft: Radius.circular(widget.topLeft),
topRight: Radius.circular(widget.topRight), topRight: Radius.circular(widget.topRight),
bottomRight: Radius.circular(widget.bottomRight), bottomRight: Radius.circular(widget.bottomRight),
bottomLeft: Radius.circular(widget.bottomLeft)) bottomLeft: Radius.circular(widget.bottomLeft))
: BorderRadius.circular(widget.raduis), : BorderRadius.circular(widget.raduis),
), ),
color: widget.backgroundColor, color: widget.backgroundColor,

@ -78,6 +78,8 @@ dependencies:
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter

Loading…
Cancel
Save