dashboard updates

logut
hussam al-habibeh 5 years ago
parent 6143aeb700
commit 27a070f778

@ -28,59 +28,37 @@ const Map<String, Map<String, String>> localizedValues = {
},
'forgotPassword': {'en': 'Forgot Password?', 'ar': 'هل نسيت كلمة المرور ؟'},
'login': {'en': 'Login', 'ar': 'تسجيل الدخول'},
'haveGreatDay': {'en': 'have a great day ,', 'ar': 'أتمنى لك يوما جميلا '},
'haveGreatDay': {'en': 'have a great day,', 'ar': 'أتمنى لك يوما جميلا '},
'youHave': {'en': 'You Have', 'ar': 'يوجد لديك'},
'deliveredPackages': {'en': 'Delivered Packages', 'ar': 'الطرود المسلمة'},
'deliveredPackages': {'en': 'Delivered \nPackages', 'ar': 'الطرود\n المسلمة'},
'seeAll': {'en': 'See All', 'ar': 'اظهار الكل'},
'nearestDropOffs': {'en': 'nearest drop-offs', 'ar': 'أقرب نقطة إنزال'},
'nearestDropOffs': {'en': 'Nearest Drop-Offs', 'ar': 'أقرب نقطة إنزال'},
'undeliveredPackages': {
'en': 'Undelivered Packages',
'ar': 'الطرود التي لم يتم تسليمها'
},
'deliveryInfo': {
'en': 'Delivery information',
'ar': 'معلومات الشحنة'
'en': 'Undelivered\nPackages',
'ar': 'الطرود التي\n لم يتم تسليمها'
},
'deliveryInfo': {'en': 'Delivery information', 'ar': 'معلومات الشحنة'},
'confirmationSent': {
'en': 'Confirmation email and SMS has been sent',
'ar': 'تم إرسال التأكيد للبرييد الإلكتروني والرسائل النصية القصيرة'
},
'location': {
'en': 'Location',
'ar': 'الموقع'
},
'call': {
'en': 'Call',
'ar': 'اتصال'
},
'sms': {
'en': 'SMS',
'ar': 'رسالة نصية'
},
'packageContent': {
'en': 'Package Content',
'ar': 'محتوى الحزمة'
},
'payment': {
'en': 'Payment',
'ar': 'دفع'
},
'delivryTime': {
'en': 'Delivery Time',
'ar': 'وقت التوصيل'
},
'clientReached': {
'en': 'Client Reached',
'ar': 'الوصول الى العميل'
'location': {'en': 'Location', 'ar': 'الموقع'},
'call': {'en': 'Call', 'ar': 'اتصال'},
'sms': {'en': 'SMS', 'ar': 'رسالة نصية'},
'packageContent': {'en': 'Package Content', 'ar': 'محتوى الحزمة'},
'payment': {'en': 'Payment', 'ar': 'دفع'},
'delivryTime': {'en': 'Delivery Time', 'ar': 'وقت التوصيل'},
'clientReached': {'en': 'Client Reached', 'ar': 'الوصول الى العميل'},
'addNoteBtn': {'en': 'Add Note', 'ar': 'اضافة ملاحظة'},
'nextDelivery': {'en': 'Next Delivery', 'ar': 'الشحنة التالية'},
'scan': {'en': 'SCAN', 'ar': 'مسح'},
'away': {'en': 'away', 'ar': 'مسح'},
'yourDeliveryQue': {
'en': 'Your Delivery Que',
'ar': 'قائمة التسليم الخاصة بك'
},
'addNoteBtn': {
'en': 'Add Note',
'ar': 'اضافة ملاحظة'
'toAddPackageToQue': {
'en': 'To add package to que',
'ar': 'لإضافة حزمة إلى قائمة الانتظار'
},
'nextDelivery': {
'en': 'Next Delivery',
'ar': 'الشحنة التالية'
}
};

@ -13,7 +13,7 @@ class BaseViewModel extends ChangeNotifier {
String error = "";
AppSharedPreferences sharedPref = AppSharedPreferences();
BaseViewModel(){
BaseViewModel() {
getUser();
}

@ -10,9 +10,11 @@ import 'package:driverapp/widgets/others/network_base_view.dart';
import 'package:driverapp/widgets/others/rounded_container.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:driverapp/widgets/data_display/circle-container.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../base/base_view.dart';
import 'package:driverapp/config/shared_pref_kay.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
class DashboardScreen extends StatefulWidget {
@override
@ -44,7 +46,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Have a great day,',
TranslationBase.of(context).haveGreatDay,
style: TextStyle(
fontSize: 14.5,
color: Color(0xff636363),
@ -53,7 +55,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
Padding(
padding: EdgeInsets.only(top: 4.5),
child: Text(
'Driver Name',
'Drive Name',
//model.user.userName,
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 25.0),
@ -114,7 +117,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
MainAxisAlignment.spaceEvenly,
children: <Widget>[
Text(
'You Have',
TranslationBase.of(context).youHave,
style: TextStyle(
color: Colors.white,
fontSize: 10.0),
@ -126,7 +129,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
fontSize: 25.0),
),
Text(
'Undeliverd\nPackages',
TranslationBase.of(context)
.undeliveredPackages,
style: TextStyle(
color: Colors.white, fontSize: 9.5),
)
@ -191,7 +195,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
MainAxisAlignment.spaceEvenly,
children: <Widget>[
Text(
'You Have',
TranslationBase.of(context).youHave,
style: TextStyle(
color: Colors.white,
fontSize: 10.0),
@ -203,7 +207,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
fontSize: 25.0),
),
Text(
'Succesful\nDeliveries',
TranslationBase.of(context)
.deliveredPackages,
style: TextStyle(
color: Colors.white,
fontSize: 10.0),
@ -254,7 +259,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
Expanded(
child: InkWell(
child: Container(
height: MediaQuery.of(context).size.height * 0.18,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.18
: MediaQuery.of(context).size.height * 0.28,
width: MediaQuery.of(context).size.width * 0.50,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
@ -289,18 +297,20 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Padding(
padding: EdgeInsets.only(top: 8.0),
child: Text(
'SCAN',
TranslationBase.of(context).scan,
style: TextStyle(
fontSize: 35.0,
color: Colors.white,
fontWeight: FontWeight.w400),
fontSize: 35.0,
color: Colors.white,
fontWeight: FontWeight.w400,
),
),
),
),
Padding(
padding: EdgeInsets.only(top: 0.0),
child: Text(
'To add package to que ',
TranslationBase.of(context)
.toAddPackageToQue,
style: TextStyle(
fontSize: 15.0,
color: Colors.white,
@ -319,30 +329,32 @@ class _DashboardScreenState extends State<DashboardScreen> {
],
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 1.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
children: <Widget>[
Text(
'Nearest Drop-Offs',
style: TextStyle(
fontSize: 21.0,
fontWeight: FontWeight.w400,
NetworkBaseView(
baseViewModel: model,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 1.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
children: <Widget>[
Text(
TranslationBase.of(context).nearestDropOffs,
style: TextStyle(
fontSize: 21.0,
fontWeight: FontWeight.w400,
),
),
),
],
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
InkWell(
],
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
InkWell(
child: Row(
children: <Widget>[
Text(
'See All',
TranslationBase.of(context).seeAll,
style: TextStyle(
fontSize: 14.5, color: Color(0xff42B6AD)),
),
@ -354,13 +366,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
],
),
onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => OrdersListScreen()),
)),
],
),
],
context,
MaterialPageRoute(
builder: (context) => OrdersListScreen()),
),
),
],
),
],
),
),
),
NetworkBaseView(
@ -377,7 +391,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: InkWell(
child: RoundedContainer(
raduis: 25.0,
height: MediaQuery.of(context).size.height * 0.109,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.109
: MediaQuery.of(context).size.height * 0.209,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
@ -385,18 +402,35 @@ class _DashboardScreenState extends State<DashboardScreen> {
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
left: 10.0, bottom: 5.0, top: 10.0),
left: 15.0, top: 14.0),
child: Image.asset(
'assets/images/location.png',
height:
MediaQuery.of(context).size.height *
0.06,
width:
MediaQuery.of(context).size.width *
0.05,
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,
),
)
],
@ -404,13 +438,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
if (model.orders.length != 0)
Expanded(
flex: 3,
flex: 5,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 10.0),
padding: EdgeInsets.only(top: 20.0),
child: Text(
model.orders[index].firstName +
' ' +
@ -437,31 +471,17 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
),
Padding(
padding: EdgeInsets.all(10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: CircleAvatar(
backgroundColor: Color(0xff707070),
radius: 28.0,
child: CircleAvatar(
backgroundColor: Colors.white,
maxRadius: 25.0,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'3 K.m \n away',
style: TextStyle(
color: Color(0xff30B7B9),
fontSize: 10.5,
fontWeight: FontWeight.w400),
),
),
),
),
)
],
padding: EdgeInsets.all(8.0),
child: CircleContainer(
child: Text(
model.orders[index].distanceInKilometers
.toString() +
' K.m\naway',
style: TextStyle(
color: Color(0xff42B6AD),
fontWeight: FontWeight.w800,
fontStyle: FontStyle.normal),
),
),
),
],

@ -9,6 +9,8 @@ import 'package:driverapp/widgets/delivery/package_content.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:maps_launcher/maps_launcher.dart';
import '../../uitl/translations_delegate_base.dart';
import '../../widgets/others/app_scaffold_widget.dart';
@ -34,10 +36,7 @@ class InformationPage extends StatelessWidget {
children: <Widget>[
Container(
margin: EdgeInsets.only(
right: MediaQuery
.of(context)
.size
.width * 0.15, //50
right: MediaQuery.of(context).size.width * 0.15, //50
),
child: IconButton(
color: Colors.white,
@ -50,9 +49,7 @@ class InformationPage extends StatelessWidget {
),
Container(
child: Text(
TranslationBase
.of(context)
.deliveryInfo,
TranslationBase.of(context).deliveryInfo,
style: TextStyle(
color: Colors.white,
fontSize: 20,
@ -64,31 +61,16 @@ class InformationPage extends StatelessWidget {
Stack(
children: <Widget>[
Container(
width: MediaQuery
.of(context)
.size
.width, //400,
height: MediaQuery
.of(context)
.size
.width, //500,
width: MediaQuery.of(context).size.width, //400,
height: MediaQuery.of(context).size.width, //500,
),
Container(
width: MediaQuery
.of(context)
.size
.width * 1,
width: MediaQuery.of(context).size.width * 1,
//800,
height: MediaQuery
.of(context)
.size
.width * 1.5,
height: MediaQuery.of(context).size.width * 1.5,
//700,
margin: EdgeInsets.only(
top: MediaQuery
.of(context)
.size
.width * 0.3, //100
top: MediaQuery.of(context).size.width * 0.3, //100
),
decoration: BoxDecoration(
color: Colors.white,
@ -100,10 +82,8 @@ class InformationPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
height: MediaQuery
.of(context)
.size
.width * 0.2, //170,
height: MediaQuery.of(context).size.width *
0.2, //170,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
@ -115,10 +95,11 @@ class InformationPage extends StatelessWidget {
size: 30,
color: Colors.white,
),
btnName: TranslationBase
.of(context)
.location,
btnFunction: () {},
btnName: TranslationBase.of(context).location,
btnFunction: () {
MapsLauncher.launchCoordinates(
item.latitude, item.longitude);
},
),
delivery_info_button(
btnColor: Colors.green,
@ -137,9 +118,7 @@ class InformationPage extends StatelessWidget {
size: 30,
color: Colors.white,
),
btnName: TranslationBase
.of(context)
.sms,
btnName: TranslationBase.of(context).sms,
btnFunction: () {},
),
delivery_info_button(
@ -149,107 +128,80 @@ class InformationPage extends StatelessWidget {
size: 30,
color: Colors.white,
),
btnName: TranslationBase
.of(context)
.call,
btnFunction: () {},
btnName: TranslationBase.of(context).call,
btnFunction: () =>
launch("tel://" + item.mobileNumber),
),
],
),
SizedBox(
height: MediaQuery
.of(context)
.size
.width * 0.1, //30,
height:
MediaQuery.of(context).size.width * 0.1, //30,
),
Container(
margin: EdgeInsets.only(
left: MediaQuery
.of(context)
.size
.width * 0.05, //15,
right: MediaQuery
.of(context)
.size
.width * 0.02, //15
left: MediaQuery.of(context).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,
TranslationBase.of(context).packageContent,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20),
),
SizedBox(
height: MediaQuery
.of(context)
.size
.width * 0.05, //20,
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(),
);
}),
(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,
height: MediaQuery.of(context).size.width *
0.01, //10,
),
],
),
),
SizedBox(
height: MediaQuery
.of(context)
.size
.width * 0.1, //30,
height:
MediaQuery.of(context).size.width * 0.1, //30,
),
FlatButton(
color: Color(0xff41bdbb),
padding: EdgeInsets.only(
right: MediaQuery
.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
right: MediaQuery.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,
TranslationBase.of(context).clientReached,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
@ -267,12 +219,15 @@ class InformationPage extends StatelessWidget {
),
),
CustomerBrief(
itemId: item.patientID,
customerFirstName: item.firstName,
customerLastName: item.lastName,
mobileNo: item.mobileNumber,
totalPayment: item.amount,
deliveryTime: item.orderCreatedOn),
itemId: item.patientID,
customerFirstName: item.firstName,
customerLastName: item.lastName,
mobileNo: item.mobileNumber,
totalPayment: item.amount,
deliveryTime: item.orderCreatedOn,
longitude: item.longitude,
latitude: item.latitude,
),
],
),
],

@ -1,10 +1,11 @@
import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/pages/delivery/information_page.dart';
import 'package:driverapp/widgets/data_display/circle-container.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:driverapp/widgets/others/rounded_container.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import '../base/base_view.dart';
class OrdersListScreen extends StatefulWidget {
@ -20,7 +21,7 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
builder: (BuildContext context, OrdersViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: 'Your Delivery Que',
appBarTitle: TranslationBase.of(context).yourDeliveryQue,
titleColor: Colors.black,
body: Column(
children: <Widget>[
@ -35,7 +36,10 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
child: InkWell(
child: RoundedContainer(
raduis: 25.0,
height: MediaQuery.of(context).size.height * 0.109,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.109
: MediaQuery.of(context).size.height * 0.209,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
@ -43,17 +47,27 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
left: 10.0, bottom: 5.0, top: 10.0),
padding:
EdgeInsets.only(left: 15.0, top: 14.0),
child: Image.asset(
'assets/images/location.png',
height:
MediaQuery.of(context).size.height *
0.06,
width: MediaQuery.of(context).size.width *
0.05,
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,
),
)
],
@ -61,12 +75,12 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
),
if (model.orders.length != 0)
Expanded(
flex: 3,
flex: 5,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 10.0),
padding: EdgeInsets.only(top: 20.0),
child: Text(
model.orders[index].firstName +
' ' +
@ -84,7 +98,7 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
),
Expanded(
child: Text(
'Olaya ST, Behind kfc next to king , ',
'Olaya ST, Behind kfc next to king',
style:
TextStyle(color: Color(0xff636363)),
),
@ -93,31 +107,17 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
),
),
Padding(
padding: EdgeInsets.all(10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: CircleAvatar(
backgroundColor: Colors.black45,
radius: 28.0,
child: CircleAvatar(
backgroundColor: Colors.white,
maxRadius: 25.0,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'3 K.m \n away',
style: TextStyle(
color: Color(0xff30B7B9),
fontSize: 10.5,
fontWeight: FontWeight.w400),
),
),
),
),
)
],
padding: EdgeInsets.all(8.0),
child: CircleContainer(
child: Text(
model.orders[index].distanceInKilometers
.toString() +
' K.m\naway',
style: TextStyle(
color: Color(0xff42B6AD),
fontWeight: FontWeight.w800,
fontStyle: FontStyle.normal),
),
),
),
],

@ -103,6 +103,10 @@ class TranslationBase {
String get confirmationSent =>
localizedValues['confirmationSent'][locale.languageCode];
String get yourDeliveryQue =>
localizedValues['yourDeliveryQue'][locale.languageCode];
String get toAddPackageToQue =>
localizedValues['toAddPackageToQue'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save