|
|
|
@ -5,7 +5,9 @@ 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/pending_orders_page.dart';
|
|
|
|
import 'package:driverapp/pages/orders/pending_orders_page.dart';
|
|
|
|
import 'package:driverapp/uitl/app_toast.dart';
|
|
|
|
import 'package:driverapp/uitl/app_toast.dart';
|
|
|
|
|
|
|
|
import 'package:driverapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:driverapp/uitl/utils.dart';
|
|
|
|
import 'package:driverapp/uitl/utils.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/network_base_view.dart';
|
|
|
|
import 'package:driverapp/widgets/others/network_base_view.dart';
|
|
|
|
import 'package:driverapp/widgets/others/rounded_container.dart';
|
|
|
|
import 'package:driverapp/widgets/others/rounded_container.dart';
|
|
|
|
@ -13,11 +15,7 @@ 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:driverapp/widgets/data_display/circle-container.dart';
|
|
|
|
|
|
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
|
|
|
|
import '../base/base_view.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 {
|
|
|
|
class DashboardScreen extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
@ -32,9 +30,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
onModelReady: (model) => model.getPendingOrders(),
|
|
|
|
onModelReady: (model) => model.getPendingOrders(),
|
|
|
|
builder: (BuildContext context, OrdersViewModel model, Widget child) =>
|
|
|
|
builder: (BuildContext context, OrdersViewModel model, Widget child) =>
|
|
|
|
AppScaffold(
|
|
|
|
AppScaffold(
|
|
|
|
body: Column(
|
|
|
|
body: Container(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
height: MediaQuery.of(context).size.height * .95,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
child: ListView(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
@ -106,8 +104,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
width: MediaQuery.of(context).size.width * 0.44,
|
|
|
|
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(colors: [
|
|
|
|
colors: [Color(0xff17AFB8), Color(0xff49C1BC)]),
|
|
|
|
Color(0xff17AFB8),
|
|
|
|
|
|
|
|
Color(0xff49C1BC)
|
|
|
|
|
|
|
|
]),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
@ -135,7 +135,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
TranslationBase.of(context)
|
|
|
|
TranslationBase.of(context)
|
|
|
|
.undeliveredPackages,
|
|
|
|
.undeliveredPackages,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white, fontSize: 9.5),
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontSize: 9.5),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -150,15 +151,18 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
color: Colors.white10,
|
|
|
|
color: Colors.white10,
|
|
|
|
shape: BoxShape.circle),
|
|
|
|
shape: BoxShape.circle),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
|
'assets/images/closed_box.png',
|
|
|
|
'assets/images/closed_box.png',
|
|
|
|
height:
|
|
|
|
height: MediaQuery.of(context)
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
.size
|
|
|
|
|
|
|
|
.height *
|
|
|
|
0.10,
|
|
|
|
0.10,
|
|
|
|
width:
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
MediaQuery.of(context).size.width *
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width *
|
|
|
|
0.20,
|
|
|
|
0.20,
|
|
|
|
scale: 0.9,
|
|
|
|
scale: 0.9,
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
@ -184,8 +188,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
width: MediaQuery.of(context).size.width * 0.45,
|
|
|
|
width: MediaQuery.of(context).size.width * 0.45,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(15.0),
|
|
|
|
borderRadius: BorderRadius.circular(15.0),
|
|
|
|
gradient: LinearGradient(
|
|
|
|
gradient: LinearGradient(colors: [
|
|
|
|
colors: [Color(0xff17AFB8), Color(0xff49C1BC)]),
|
|
|
|
Color(0xff17AFB8),
|
|
|
|
|
|
|
|
Color(0xff49C1BC)
|
|
|
|
|
|
|
|
]),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
@ -229,15 +235,18 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
color: Colors.white10,
|
|
|
|
color: Colors.white10,
|
|
|
|
shape: BoxShape.circle),
|
|
|
|
shape: BoxShape.circle),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
|
'assets/images/opend_box.png',
|
|
|
|
'assets/images/opend_box.png',
|
|
|
|
height:
|
|
|
|
height: MediaQuery.of(context)
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
.size
|
|
|
|
|
|
|
|
.height *
|
|
|
|
0.10,
|
|
|
|
0.10,
|
|
|
|
width:
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
MediaQuery.of(context).size.width *
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width *
|
|
|
|
0.20,
|
|
|
|
0.20,
|
|
|
|
scale: 0.9,
|
|
|
|
scale: 0.9,
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
@ -270,7 +279,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(15.0),
|
|
|
|
borderRadius: BorderRadius.circular(15.0),
|
|
|
|
gradient: LinearGradient(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
colors: [Hexcolor("#45B7AE"), Hexcolor("#119FA9")],
|
|
|
|
colors: [
|
|
|
|
|
|
|
|
Hexcolor("#45B7AE"),
|
|
|
|
|
|
|
|
Hexcolor("#119FA9")
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
@ -281,16 +293,17 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
|
'assets/images/qr_code.png',
|
|
|
|
'assets/images/qr_code.png',
|
|
|
|
width:
|
|
|
|
width: MediaQuery.of(context).size.width *
|
|
|
|
MediaQuery.of(context).size.width * 0.26,
|
|
|
|
0.26,
|
|
|
|
height:
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
MediaQuery.of(context).size.height * 0.14,
|
|
|
|
0.14,
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.spaceEvenly,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
@ -335,7 +348,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
NetworkBaseView(
|
|
|
|
NetworkBaseView(
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 20.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>[
|
|
|
|
@ -405,7 +419,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
flex: 1,
|
|
|
|
flex: 1,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
@ -506,6 +521,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|