Merge branch 'merge_delivery_into_dev' into 'development'

Merge delivery into dev

See merge request Cloud_Solution/driver-app!38
logut
Elham 6 years ago
commit e84602a208

@ -1,3 +1,4 @@
import 'package:driverapp/widgets/buttons/secondary_button.dart';
import 'package:driverapp/widgets/delivery/customer_brief_card.dart'; import 'package:driverapp/widgets/delivery/customer_brief_card.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -15,7 +16,7 @@ class DeliveryConfirmedPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
body: SafeArea( body: SafeArea(
child: Container( child: Container(
color: Color(0xff41bdbb), color: Theme.of(context).primaryColor,
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
Column( Column(
@ -39,21 +40,11 @@ class DeliveryConfirmedPage extends StatelessWidget {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context) height: MediaQuery.of(context).size.width * 0.7,
.size
.width,
//300,
height: MediaQuery
.of(context)
.size
.width * 0.7,
//300,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: MediaQuery top: MediaQuery.of(context).size.width *
.of(context) 0.2,
.size
.width * 0.2, //60,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white10, color: Colors.white10,
@ -66,17 +57,14 @@ class DeliveryConfirmedPage extends StatelessWidget {
size: 60, size: 60,
), ),
Text( Text(
TranslationBase TranslationBase.of(context).deliveryInfo,
.of(context)
.deliveryInfo,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
Text( Text(
TranslationBase TranslationBase.of(context)
.of(context)
.confirmationSent, .confirmationSent,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
@ -94,25 +82,13 @@ class DeliveryConfirmedPage extends StatelessWidget {
Stack( Stack(
children: <Widget>[ children: <Widget>[
Container( Container(
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context) height: MediaQuery.of(context).size.width,
.size
.width, //400,
height: MediaQuery
.of(context)
.size
.width, //500,
), ),
Container( Container(
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context)
.size
.width,
//800, //800,
height: MediaQuery height: MediaQuery.of(context).size.width * 1.2,
.of(context)
.size
.width * 1.2,
//440, //440,
margin: EdgeInsets.only(top: 60), margin: EdgeInsets.only(top: 60),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -127,10 +103,8 @@ class DeliveryConfirmedPage extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
bottom: MediaQuery bottom: MediaQuery.of(context).size.width *
.of(context) 0.15, //50
.size
.width * 0.15, //50
), ),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -139,52 +113,29 @@ 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),
),
label: Text(
TranslationBase.of(context).addNoteBtn,
style: TextStyle(color: Colors.white),
), ),
icon: Icon( icon: Icon(
Icons.mode_edit, Icons.mode_edit,
color: Colors.white, color: Colors.white,
), ),
label: Text(
TranslationBase
.of(context)
.addNoteBtn,
style: TextStyle(color: Colors.white),
),
onPressed: () {}, onPressed: () {},
), ),
SizedBox( SizedBox(
height: MediaQuery height: MediaQuery.of(context).size.width *
.of(context) 0.1, //20,
.size
.width * 0.1, //20,
), ),
FlatButton( Container(
color: Color(0xff41bdbb), margin: EdgeInsets.all(10),
padding: child: SecondaryButton(
EdgeInsets.only( label: TranslationBase.of(context)
right: MediaQuery
.of(context)
.size
.width * 0.25, //100,
left: MediaQuery
.of(context)
.size
.width * 0.25, //100
),
shape: RoundedRectangleBorder(
borderRadius:
new BorderRadius.circular(18.0),
side:
BorderSide(color: Color(0xff41bdbb)),
),
child: Text(
TranslationBase
.of(context)
.nextDelivery, .nextDelivery,
style: TextStyle(color: Colors.white), onTap: () {},
), ),
onPressed: () {},
), ),
], ],
), ),
@ -192,14 +143,13 @@ class DeliveryConfirmedPage extends StatelessWidget {
], ],
), ),
), ),
CustomerBrief( CustomerBriefCard(
itemId: item.patientID, itemId: item.patientID,
customerFirstName: item.firstName, customerFirstName: item.firstName,
customerLastName: item.lastName, customerLastName: item.lastName,
mobileNo: item.mobileNumber, mobileNo: item.mobileNumber,
totalPayment: item.amount, totalPayment: item.amount,
deliveryTime: item.orderCreatedOn deliveryTime: item.orderCreatedOn),
),
], ],
), ),
], ],

File diff suppressed because one or more lines are too long

@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import '../../uitl/date_uitl.dart'; import '../../uitl/date_uitl.dart';
import '../../uitl/translations_delegate_base.dart'; import '../../uitl/translations_delegate_base.dart';
class CustomerBrief extends StatelessWidget { class CustomerBriefCard extends StatelessWidget {
final String itemId; final String itemId;
final String time; final String time;
final String customerFirstName; final String customerFirstName;
@ -15,7 +15,7 @@ class CustomerBrief extends StatelessWidget {
final double longitude; final double longitude;
final double latitude; final double latitude;
CustomerBrief( CustomerBriefCard(
{this.itemId, {this.itemId,
this.time, this.time,
this.customerFirstName, this.customerFirstName,
@ -32,14 +32,14 @@ class CustomerBrief extends StatelessWidget {
return Center( return Center(
child: Container( child: Container(
width: 350, width: 350,
height: 300, height: 270,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(45), topLeft: Radius.circular(30),
topRight: Radius.circular(45), topRight: Radius.circular(30),
bottomRight: Radius.circular(45), bottomRight: Radius.circular(30),
bottomLeft: Radius.circular(45)), bottomLeft: Radius.circular(30)),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.3), color: Colors.grey.withOpacity(0.3),
@ -50,37 +50,35 @@ class CustomerBrief extends StatelessWidget {
], ],
), ),
child: Container( child: Container(
padding: EdgeInsets.only(left: 30, top: 10, right: 30), padding: EdgeInsets.only(left: 30, top: 20, right: 30),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Text('ID: ${itemId}'), flex: 3,
child: Text(
'ID: ${itemId}',
style: TextStyle(color: Color(0xFFADACAD)),
),
), ),
Expanded( Expanded(
child: Container( child: CircleAvatar(
margin: EdgeInsets.only(left: 83), backgroundColor: Colors.black45,
width: 10, radius: 28.0,
height: 60, child: CircleAvatar(
decoration: BoxDecoration( backgroundColor: Colors.white,
border: Border.all( maxRadius: 25.1,
width: 2.0, child: Padding(
color: Color(0xff41bdbb), padding: const EdgeInsets.only(left: 3),
), child: Text(
borderRadius: BorderRadius.only( '3 K.m \n away',
topLeft: Radius.circular(45), style: TextStyle(
topRight: Radius.circular(45), color: Color(0xff30B7B9),
bottomRight: Radius.circular(45), fontSize: 12.5,
bottomLeft: Radius.circular(45), fontWeight: FontWeight.w600),
), ),
),
child: Container(
margin: EdgeInsets.only(left: 12, top: 10),
child: Text(
'3 min away',
style: TextStyle(color: Color(0xff41bdbb)),
), ),
), ),
), ),
@ -89,24 +87,32 @@ class CustomerBrief extends StatelessWidget {
), ),
Text( Text(
'${customerFirstName} ${customerLastName}', '${customerFirstName} ${customerLastName}',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), style: TextStyle(fontSize: 20, fontWeight: FontWeight.w900),
), ),
Text( Text(
mobileNo, mobileNo,
style: TextStyle(color: Colors.lightBlue), style: TextStyle(color: Color(0xFF50BDC5)),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Text( Text(
'Olaya street, behind KFC resturant, next to kingdom towers 2ND floor ofice 277', 'Olaya street, behind KFC resturant, next to kingdom towers 2nd floor ofice 277',
style: TextStyle(fontWeight: FontWeight.w600), style: TextStyle(
color: Color(0xFF464748), fontWeight: FontWeight.w600),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Divider( SizedBox(
color: Colors.grey, height: 10.0,
child: Center(
child: Container(
margin: EdgeInsetsDirectional.only(start: 1.0, end: 1.0),
height: 1.0,
color: Colors.grey,
),
),
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -115,15 +121,22 @@ class CustomerBrief extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
Text( Expanded(
TranslationBase.of(context).payment, flex: 2,
child: Text(
TranslationBase.of(context).payment,
textAlign: TextAlign.start,
),
), ),
SizedBox( SizedBox(
width: 170, width: 170,
), ),
Text( Expanded(
totalPayment.toString(), //'SAR 70', child: Text(
style: TextStyle(fontWeight: FontWeight.bold), totalPayment.toString(),
textAlign: TextAlign.end,
style: TextStyle(fontWeight: FontWeight.w600),
),
), ),
], ],
), ),
@ -132,19 +145,19 @@ class CustomerBrief extends StatelessWidget {
), ),
Row( Row(
children: <Widget>[ children: <Widget>[
Text( Expanded(
TranslationBase.of(context).delivryTime, flex: 1,
child: Text(
TranslationBase.of(context).delivryTime,
textAlign: TextAlign.start,
),
), ),
SizedBox( Expanded(
width: 50, child: Text(
'${DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(deliveryTime))} ${(DateUtil.convertStringToHours(deliveryTime))}',
textAlign: TextAlign.end,
style: TextStyle(fontWeight: FontWeight.w600)),
), ),
Text(
'${DateUtil.getMonthDayYearDateFormatted(
DateUtil.convertStringToDate(
deliveryTime))} ${(DateUtil
.convertStringToHours(deliveryTime))}',
//'05 Aug 20 - 10:00 AM',
style: TextStyle(fontWeight: FontWeight.bold)),
], ],
) )
], ],

@ -1,12 +1,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class delivery_info_button extends StatelessWidget { class DeliveryInfoButton extends StatelessWidget {
final Color btnColor; final Color btnColor;
final Icon btnIcon; final Icon btnIcon;
final Function btnFunction; final Function btnFunction;
final String btnName; final String btnName;
delivery_info_button( DeliveryInfoButton(
{this.btnColor, this.btnIcon, this.btnFunction, this.btnName}); {this.btnColor, this.btnIcon, this.btnFunction, this.btnName});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -16,8 +16,14 @@ class delivery_info_button extends StatelessWidget {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 50, height: MediaQuery
width: 60, // specific value .of(context)
.size
.width * 0.14,
width: MediaQuery
.of(context)
.size
.width * 0.165, // specific value
child: RaisedButton( child: RaisedButton(
padding: EdgeInsets.only(left: 2), padding: EdgeInsets.only(left: 2),
color: btnColor, color: btnColor,
@ -29,7 +35,10 @@ class delivery_info_button extends StatelessWidget {
), ),
), ),
SizedBox( SizedBox(
height: 10, height: MediaQuery
.of(context)
.size
.width * 0.05,
), ),
Text( Text(
btnName, btnName,

@ -1,10 +1,10 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class package_content extends StatelessWidget { class packageContent extends StatelessWidget {
final String packageName; final String packageName;
final String packageCount; final String packageCount;
package_content({this.packageName, this.packageCount}); packageContent({this.packageName, this.packageCount});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -15,6 +15,7 @@ class AppScaffold extends StatelessWidget {
final Widget bottomSheet; final Widget bottomSheet;
final Color titleColor; final Color titleColor;
final Color arrowColor; final Color arrowColor;
final Color appBarColor;
AppScaffold( AppScaffold(
{@required this.body, {@required this.body,
@ -24,14 +25,16 @@ class AppScaffold extends StatelessWidget {
this.baseViewModel, this.baseViewModel,
this.bottomSheet, this.bottomSheet,
this.titleColor, this.titleColor,
this.arrowColor}); this.arrowColor,
this.appBarColor,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.context = context; AppGlobal.context = context;
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: appBarColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar appBar: isShowAppBar
? AppBar( ? AppBar(
elevation: 0, elevation: 0,

Loading…
Cancel
Save