|
|
|
|
@ -13,7 +13,11 @@ import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.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
|
|
|
|
|
@ -45,7 +49,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),
|
|
|
|
|
@ -54,7 +58,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),
|
|
|
|
|
@ -115,7 +120,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),
|
|
|
|
|
@ -127,7 +132,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
fontSize: 25.0),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'Undeliverd\nPackages',
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.undeliveredPackages,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white, fontSize: 9.5),
|
|
|
|
|
)
|
|
|
|
|
@ -192,7 +198,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),
|
|
|
|
|
@ -204,7 +210,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
fontSize: 25.0),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'Succesful\nDeliveries',
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.deliveredPackages,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 10.0),
|
|
|
|
|
@ -255,7 +262,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),
|
|
|
|
|
@ -290,18 +300,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,
|
|
|
|
|
@ -320,30 +332,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)),
|
|
|
|
|
),
|
|
|
|
|
@ -355,13 +369,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => OrdersListScreen()),
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => OrdersListScreen()),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
NetworkBaseView(
|
|
|
|
|
@ -378,7 +394,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>[
|
|
|
|
|
@ -386,18 +405,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,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
@ -405,13 +441,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 +
|
|
|
|
|
' ' +
|
|
|
|
|
@ -438,31 +474,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),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
|