Merge branch 'development' into 'master'

Development

See merge request Cloud_Solution/driver-app!29
setting_page
Mohammad Aljammal 6 years ago
commit a4b593f9c4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

@ -129,8 +129,8 @@ class PendingOrdersRes {
class ItemsQuantitiesList { class ItemsQuantitiesList {
String itemName; String itemName;
int productID; var productID;
int quantity; var quantity;
ItemsQuantitiesList({this.itemName, this.productID, this.quantity}); ItemsQuantitiesList({this.itemName, this.productID, this.quantity});

@ -6,6 +6,7 @@ import 'package:driverapp/core/service/base_service.dart';
class OrdersService extends BaseService { class OrdersService extends BaseService {
List<PendingOrdersRes> _orders = List(); List<PendingOrdersRes> _orders = List();
List<PendingOrdersRes> get orders => _orders; List<PendingOrdersRes> get orders => _orders;
bool isOrderInserted; bool isOrderInserted;

@ -1,7 +1,7 @@
import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/pending_orders/pending_orders_res_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 'package:driverapp/core/model/pending_orders/pending_orders_req_model.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';

@ -8,8 +8,6 @@ import 'config/size_config.dart';
import 'core/viewModels/project_view_model.dart'; import 'core/viewModels/project_view_model.dart';
import 'locator.dart'; import 'locator.dart';
void main() { void main() {
setupLocator(); setupLocator();
runApp(MyApp()); runApp(MyApp());
@ -44,6 +42,7 @@ class MyApp extends StatelessWidget {
const Locale('en', ''), // English const Locale('en', ''), // English
], ],
theme: ThemeData( theme: ThemeData(
fontFamily: 'Metropolis',
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light, brightness: Brightness.light,
@ -53,12 +52,11 @@ class MyApp extends StatelessWidget {
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
}, },
), ),
scaffoldBackgroundColor:Color.fromRGBO(239, 245, 245, 1) , scaffoldBackgroundColor: Color.fromRGBO(239, 245, 245, 1),
hintColor: Colors.grey[400], hintColor: Colors.grey[400],
disabledColor: Colors.grey[300], disabledColor: Colors.grey[300],
bottomSheetTheme: BottomSheetThemeData( bottomSheetTheme: BottomSheetThemeData(
backgroundColor: Color.fromRGBO(239, 245, 245, 1) backgroundColor: Color.fromRGBO(239, 245, 245, 1)),
),
errorColor: Color.fromRGBO(235, 80, 60, 1.0), errorColor: Color.fromRGBO(235, 80, 60, 1.0),
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Color.fromRGBO(80, 100, 253, 1.0), textSelectionHandleColor: Color.fromRGBO(80, 100, 253, 1.0),

@ -42,8 +42,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
'Have a great day ,', 'Have a great day,',
style: TextStyle(fontSize: 12.5), style: TextStyle(
fontSize: 14.5,
color: Color(0xff636363),
fontWeight: FontWeight.w300),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 4.5), padding: EdgeInsets.only(top: 4.5),
@ -91,8 +94,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 10.0), padding: EdgeInsets.symmetric(horizontal: 10.0),
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.15, height: MediaQuery
width: MediaQuery.of(context).size.width * 0.44, .of(context)
.size
.height * 0.16,
width: MediaQuery
.of(context)
.size
.width * 0.44,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0), borderRadius: BorderRadius.circular(15.0),
gradient: LinearGradient( gradient: LinearGradient(
@ -101,57 +110,64 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Padding( Expanded(
padding: EdgeInsets.all(10.0), child: Padding(
padding: EdgeInsets.all(2.0),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
Text( Text(
'You Have', 'You Have',
style: TextStyle(
color: Colors.white, fontSize: 10.0),
),
Text(
'5',
style: TextStyle(
color: Colors.white, fontSize: 25.0),
),
Expanded(
child: Text(
'Undelivered \n Packages',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 10.0), fontSize: 10.0),
), ),
) Text(
], '5',
style: TextStyle(
color: Colors.white,
fontSize: 25.0),
),
Text(
'Undeliverd\nPackages',
style: TextStyle(
color: Colors.white, fontSize: 9.5),
)
],
),
), ),
), ),
Expanded( Padding(
child: Padding( padding: EdgeInsets.only(right: 9.5),
padding: EdgeInsets.all(4.0), child: Container(
width: 110,
height: 110,
decoration: BoxDecoration(
color: Colors.white10,
shape: BoxShape.circle),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Padding( Image.asset(
padding: EdgeInsets.only(right: 9.5),
child: Image.asset(
'assets/images/closed_box.png', 'assets/images/closed_box.png',
height: MediaQuery.of(context) height: MediaQuery
.size .of(context)
.height * .size
0.09, .height *
width: MediaQuery.of(context) 0.10,
.size width: MediaQuery
.width * .of(context)
.size
.width *
0.20, 0.20,
//fit: BoxFit.cover, scale: 0.9,
)), fit: BoxFit.cover,
),
], ],
), ),
), ),
) ),
], ],
), ),
), ),
@ -159,27 +175,31 @@ class _DashboardScreenState extends State<DashboardScreen> {
], ],
), ),
), ),
Column( Expanded(
children: <Widget>[ child: Column(
Padding( children: <Widget>[
padding: EdgeInsets.symmetric(horizontal: 10.0), Padding(
child: Container( padding: EdgeInsets.symmetric(horizontal: 10.0),
height: MediaQuery.of(context).size.height * 0.15, child: Container(
width: MediaQuery.of(context).size.width * 0.44, height: MediaQuery.of(context).size.height * 0.16,
decoration: BoxDecoration( width: MediaQuery
borderRadius: BorderRadius.circular(15.0), .of(context)
gradient: LinearGradient( .size
colors: [Color(0xff17AFB8), Color(0xff49C1BC)]), .width * 0.45,
), decoration: BoxDecoration(
child: Row( borderRadius: BorderRadius.circular(15.0),
mainAxisAlignment: MainAxisAlignment.spaceBetween, gradient: LinearGradient(
children: <Widget>[ colors: [Color(0xff17AFB8), Color(0xff49C1BC)]),
Expanded( ),
child: Padding( child: Row(
padding: EdgeInsets.all(12.0), mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Padding(
padding: EdgeInsets.all(2.0),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceEvenly, MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
Text( Text(
'You Have', 'You Have',
@ -191,40 +211,48 @@ class _DashboardScreenState extends State<DashboardScreen> {
style: TextStyle( style: TextStyle(
color: Colors.white, fontSize: 25.0), color: Colors.white, fontSize: 25.0),
), ),
Expanded( Text(
child: Text( 'Succesful\nDeliveries',
'unWanted\n Packge',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 10.0), fontSize: 10.0),
), )
) ],
], ),
), ),
), ),
), Padding(
Padding( padding: EdgeInsets.only(right: 9.5),
padding: EdgeInsets.only(right: 9.5), child: Container(
child: Column( width: 110,
mainAxisAlignment: MainAxisAlignment.center, height: 110,
children: <Widget>[ decoration: BoxDecoration(
Image.asset( color: Colors.white10,
'assets/images/open_box.png', shape: BoxShape.circle),
height: MediaQuery.of(context).size.height * child: Column(
0.10, mainAxisAlignment: MainAxisAlignment.center,
width: MediaQuery.of(context).size.width * children: <Widget>[
0.20, Image.asset(
scale: 0.9, 'assets/images/opend_box.png',
fit: BoxFit.cover, height:
MediaQuery.of(context).size.height *
0.10,
width:
MediaQuery.of(context).size.width *
0.20,
scale: 0.9,
fit: BoxFit.cover,
),
],
), ),
], ),
), ),
), ],
], ),
), ),
), )
) ],
], ),
), ),
], ],
), ),
@ -235,8 +263,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
Expanded( Expanded(
child: InkWell( child: InkWell(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.16, height: MediaQuery
width: MediaQuery.of(context).size.width * 0.50, .of(context)
.size
.height * 0.18,
width: MediaQuery
.of(context)
.size
.width * 0.50,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0), borderRadius: BorderRadius.circular(15.0),
gradient: LinearGradient(colors: [ gradient: LinearGradient(colors: [
@ -252,10 +286,16 @@ class _DashboardScreenState extends State<DashboardScreen> {
Image.asset( Image.asset(
'assets/images/qr_code.png', 'assets/images/qr_code.png',
width: width:
MediaQuery.of(context).size.width * 0.25, MediaQuery
.of(context)
.size
.width * 0.26,
height: height:
MediaQuery.of(context).size.height * 0.14, MediaQuery
fit: BoxFit.cover, .of(context)
.size
.height * 0.14,
fit: BoxFit.contain,
) )
], ],
), ),
@ -270,7 +310,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Text( child: Text(
'SCAN', 'SCAN',
style: TextStyle( style: TextStyle(
fontSize: 35.0, color: Colors.white), fontSize: 35.0,
color: Colors.white,
fontWeight: FontWeight.w400),
), ),
), ),
Padding( Padding(
@ -296,7 +338,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
), ),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 1.0), padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 1.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
@ -319,19 +361,21 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: <Widget>[ children: <Widget>[
Text( Text(
'See All', 'See All',
style: TextStyle(fontSize: 14.5), style: TextStyle(
fontSize: 14.5, color: Color(0xff42B6AD)),
), ),
Icon( Icon(
Icons.arrow_forward_ios, Icons.arrow_forward_ios,
size: 15.0, size: 15.0,
color: Color(0xff42B6AD),
), ),
], ],
), ),
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => OrdersListScreen()), builder: (context) => OrdersListScreen()),
)), )),
], ],
), ),
], ],
@ -348,7 +392,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
padding: EdgeInsets.symmetric(horizontal: 12.2), padding: EdgeInsets.symmetric(horizontal: 12.2),
child: InkWell( child: InkWell(
child: RoundedContainer( child: RoundedContainer(
height: MediaQuery.of(context).size.height * 0.108, height: MediaQuery
.of(context)
.size
.height * 0.109,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
@ -358,14 +405,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(left: 22.0), padding: EdgeInsets.only(
left: 10.0, bottom: 5.0),
child: Image.asset( child: Image.asset(
'assets/images/location.png', 'assets/images/location.png',
height: height:
MediaQuery.of(context).size.height * MediaQuery.of(context).size.height *
0.10, 0.06,
width: MediaQuery.of(context).size.width * width: MediaQuery.of(context).size.width *
0.09, 0.05,
), ),
) )
], ],
@ -396,7 +444,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
Expanded( Expanded(
child: Text( child: Text(
'Olaya ST, Behind kfc next to king ,', 'Olaya ST, Behind kfc next to king , ',
style: TextStyle(color: Colors.black45), style: TextStyle(color: Colors.black45),
), ),
), ),
@ -421,8 +469,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
'3 K.m \n away', '3 K.m \n away',
style: TextStyle( style: TextStyle(
color: Color(0xff30B7B9), color: Color(0xff30B7B9),
fontSize: 12.5, fontSize: 10.5,
fontWeight: FontWeight.w600), fontWeight: FontWeight.w400),
), ),
), ),
), ),
@ -445,7 +493,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
); );
}, },
), ),
) ),
], ],
), ),
), ),

@ -39,9 +39,22 @@ 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),
@ -81,12 +94,26 @@ 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,
@ -99,7 +126,12 @@ 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(
@ -107,7 +139,7 @@ class DeliveryConfirmedPage extends StatelessWidget {
color: Colors.orangeAccent, color: Colors.orangeAccent,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: borderRadius:
new BorderRadius.circular(10.0), new BorderRadius.circular(10.0),
), ),
icon: Icon( icon: Icon(
Icons.mode_edit, Icons.mode_edit,
@ -122,17 +154,29 @@ class DeliveryConfirmedPage extends StatelessWidget {
onPressed: () {}, onPressed: () {},
), ),
SizedBox( SizedBox(
height: 20, height: MediaQuery
.of(context)
.size
.width * 0.1, //20,
), ),
FlatButton( FlatButton(
color: Color(0xff41bdbb), color: Color(0xff41bdbb),
padding: padding:
EdgeInsets.only(right: 100, left: 100), 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: borderRadius:
new BorderRadius.circular(18.0), new BorderRadius.circular(18.0),
side: side:
BorderSide(color: Color(0xff41bdbb)), BorderSide(color: Color(0xff41bdbb)),
), ),
child: Text( child: Text(
TranslationBase TranslationBase
@ -149,10 +193,13 @@ 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
),
], ],
), ),
], ],

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

@ -4,6 +4,7 @@ import 'package:driverapp/core/viewModels/orders_view_model.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:driverapp/widgets/others/rounded_container.dart'; import 'package:driverapp/widgets/others/rounded_container.dart';
import 'package:driverapp/pages/delivery/information_page.dart';
class OrdersListScreen extends StatefulWidget { class OrdersListScreen extends StatefulWidget {
@override @override
@ -26,28 +27,17 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
), ),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Center(
child: Text(
'Nearest',
style: TextStyle(
color: Color(0xff30B7B9),
fontSize: 18.0,
fontWeight: FontWeight.w400),
),
),
Expanded( Expanded(
child: ListView.builder( child: ListView.builder(
itemCount: model.orders == null ? 0 : model.orders.length, shrinkWrap: true,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, itemCount: model.orders == null ? 0 : model.orders.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),
child: InkWell(
child: RoundedContainer( child: RoundedContainer(
height: MediaQuery.of(context).orientation == height: MediaQuery.of(context).size.height * 0.109,
Orientation.portrait
? MediaQuery.of(context).size.height * 0.107
: MediaQuery.of(context).size.height * 0.18,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
@ -57,14 +47,17 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(left: 22.0), padding: EdgeInsets.only(
left: 10.0, bottom: 5.0),
child: Image.asset( child: Image.asset(
'assets/images/location.png', 'assets/images/location.png',
height: height:
MediaQuery.of(context).size.height * MediaQuery.of(context).size.height *
0.101, 0.06,
width: MediaQuery.of(context).size.width *
0.05,
), ),
), )
], ],
), ),
), ),
@ -75,7 +68,7 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(top: 10.0), padding: EdgeInsets.only(top: 5.0),
child: Text( child: Text(
model.orders[index].firstName + model.orders[index].firstName +
' ' + ' ' +
@ -86,16 +79,17 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
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, Behind kfc next to king ,',
style: TextStyle(color: Colors.black45), style: TextStyle(color: Colors.black45),
), ),
) ),
], ],
), ),
), ),
@ -110,15 +104,15 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
radius: 28.0, radius: 28.0,
child: CircleAvatar( child: CircleAvatar(
backgroundColor: Colors.white, backgroundColor: Colors.white,
maxRadius: 25.1, maxRadius: 24.1,
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Text(
'3 K.m \n away', '3 K.m \n away',
style: TextStyle( style: TextStyle(
color: Color(0xff30B7B9), color: Color(0xff30B7B9),
fontSize: 12.5, fontSize: 10.5,
fontWeight: FontWeight.w600), fontWeight: FontWeight.w400),
), ),
), ),
), ),
@ -130,8 +124,17 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
], ],
), ),
), ),
); onTap: () {
}), Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
InformationPage(model.orders[index])));
},
),
);
},
),
), ),
], ],
), ),

@ -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;
@ -11,16 +12,20 @@ class CustomerBrief extends StatelessWidget {
final String direction; final String direction;
final String totalPayment; final String totalPayment;
final String deliveryTime; final String deliveryTime;
final double longitude;
final double latitude;
CustomerBrief( CustomerBrief(
{this.itemId, {this.itemId,
this.time, this.time,
this.customerFirstName, this.customerFirstName,
this.customerLastName, this.customerLastName,
this.mobileNo, this.mobileNo,
this.direction, this.direction,
this.totalPayment, this.totalPayment,
this.deliveryTime}); this.deliveryTime,
this.longitude,
this.latitude});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -111,15 +116,13 @@ class CustomerBrief extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
Text( Text(
TranslationBase TranslationBase.of(context).payment,
.of(context)
.payment,
), ),
SizedBox( SizedBox(
width: 170, width: 170,
), ),
Text( Text(
'SAR 70', totalPayment.toString(), //'SAR 70',
style: TextStyle(fontWeight: FontWeight.bold), style: TextStyle(fontWeight: FontWeight.bold),
), ),
], ],
@ -130,14 +133,17 @@ class CustomerBrief extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
Text( Text(
TranslationBase TranslationBase.of(context).delivryTime,
.of(context)
.delivryTime,
), ),
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)),
], ],
) )
@ -149,4 +155,4 @@ class CustomerBrief extends StatelessWidget {
), ),
); );
} }
} }

@ -67,6 +67,8 @@ dependencies:
# Qr code Scanner # Qr code Scanner
barcode_scan: ^3.0.1 barcode_scan: ^3.0.1
#mape
map_launcher: ^0.12.0
@ -96,3 +98,9 @@ flutter:
- family: DriverApp - family: DriverApp
fonts: fonts:
- asset: lib/app-icons/fonts/DriverApp.ttf - asset: lib/app-icons/fonts/DriverApp.ttf
- family: Metropolis
fonts:
- asset: assets/fonts/Metropolis/Metropolis-Regular.otf
- asset: assets/fonts/Metropolis/Metropolis-Bold.otf
- asset: assets/fonts/Metropolis/Metropolis-Light.otf

Loading…
Cancel
Save