Merge branch 'dashboard_landscape' of https://gitlab.com/Cloud_Solution/driver-app into merge_delivery_info_into_dev

 Conflicts:
	lib/pages/dashboard/dashboard_screen.dart
	lib/pages/orders/pending_orders_page.dart
logut
Elham Rababah 5 years ago
commit 16bb773c05

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

@ -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),
@ -94,7 +97,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
height: MediaQuery height: MediaQuery
.of(context) .of(context)
.size .size
.height * 0.15, .height * 0.16,
width: MediaQuery width: MediaQuery
.of(context) .of(context)
.size .size
@ -107,59 +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 height: MediaQuery
.of(context) .of(context)
.size .size
.height * .height *
0.09, 0.10,
width: MediaQuery width: MediaQuery
.of(context) .of(context)
.size .size
.width * .width *
0.20, 0.20,
//fit: BoxFit.cover, scale: 0.9,
)), fit: BoxFit.cover,
),
], ],
), ),
), ),
) ),
], ],
), ),
), ),
@ -167,27 +175,28 @@ 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(
height: MediaQuery.of(context).size.height * 0.16,
width: MediaQuery width: MediaQuery
.of(context) .of(context)
.size .size
.width * 0.44, .width * 0.45,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0), borderRadius: BorderRadius.circular(15.0),
gradient: LinearGradient( gradient: LinearGradient(
colors: [Color(0xff17AFB8), Color(0xff49C1BC)]), colors: [Color(0xff17AFB8), Color(0xff49C1BC)]),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Padding( child: Padding(
padding: EdgeInsets.all(12.0), padding: EdgeInsets.all(2.0),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceEvenly, MainAxisAlignment.spaceEvenly,
@ -202,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,
),
],
), ),
], ),
), ),
), ],
], ),
), ),
), )
) ],
], ),
), ),
], ],
), ),
@ -249,7 +266,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
height: MediaQuery height: MediaQuery
.of(context) .of(context)
.size .size
.height * 0.16, .height * 0.18,
width: MediaQuery width: MediaQuery
.of(context) .of(context)
.size .size
@ -272,13 +289,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
MediaQuery MediaQuery
.of(context) .of(context)
.size .size
.width * 0.25, .width * 0.26,
height: height:
MediaQuery MediaQuery
.of(context) .of(context)
.size .size
.height * 0.14, .height * 0.14,
fit: BoxFit.cover, fit: BoxFit.contain,
) )
], ],
), ),
@ -293,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(
@ -319,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>[
@ -342,11 +361,13 @@ 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),
), ),
], ],
), ),
@ -364,8 +385,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: model.orders == null ? 0 : model.orders.length, itemCount: //model.orders == null ? 0 : model.orders.length,
// 2, 3,
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),
@ -374,7 +395,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
height: MediaQuery height: MediaQuery
.of(context) .of(context)
.size .size
.height * 0.108, .height * 0.109,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
@ -384,20 +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 MediaQuery.of(context).size.height *
.of(context) 0.06,
.size width: MediaQuery.of(context).size.width *
.height * 0.05,
0.10,
width: MediaQuery
.of(context)
.size
.width *
0.09,
), ),
) )
], ],
@ -428,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),
), ),
), ),
@ -453,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),
), ),
), ),
), ),
@ -477,7 +493,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
); );
}, },
), ),
) ),
], ],
), ),
), ),

@ -1,10 +1,10 @@
import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/pages/delivery/information_page.dart';
import 'package:driverapp/widgets/others/rounded_container.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:driverapp/config/size_config.dart';
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:driverapp/widgets/others/rounded_container.dart';
import 'package:driverapp/pages/delivery/information_page.dart';
class OrdersListScreen extends StatefulWidget { class OrdersListScreen extends StatefulWidget {
@override @override
@ -18,151 +18,127 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
onModelReady: (model) => model.getPendingOrders(), onModelReady: (model) => model.getPendingOrders(),
builder: (BuildContext context, OrdersViewModel model, Widget child) => builder: (BuildContext context, OrdersViewModel model, Widget child) =>
Scaffold( Scaffold(
appBar: AppBar( appBar: AppBar(
centerTitle: true, centerTitle: true,
backgroundColor: Color(0xffF4F9FA), backgroundColor: Color(0xffF4F9FA),
title: Text( title: Text(
'Your Delivery Que', 'Your Delivery Que',
), ),
), ),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Center( Expanded(
child: Text( child: ListView.builder(
'Nearest', shrinkWrap: true,
style: TextStyle( scrollDirection: Axis.vertical,
color: Color(0xff30B7B9), itemCount: model.orders == null ? 0 : model.orders.length,
fontSize: 18.0, itemBuilder: (BuildContext context, int index) {
fontWeight: FontWeight.w400), return Padding(
), padding: EdgeInsets.symmetric(horizontal: 12.2),
), child: InkWell(
Expanded( child: RoundedContainer(
child: ListView.builder( height: MediaQuery.of(context).size.height * 0.109,
itemCount: model.orders == null ? 0 : model.orders.length, child: Row(
scrollDirection: Axis.vertical, mainAxisAlignment: MainAxisAlignment.spaceBetween,
shrinkWrap: true, children: <Widget>[
itemBuilder: (BuildContext context, int index) { Expanded(
return InkWell( flex: 1,
onTap: () { child: Column(
Navigator.push( mainAxisAlignment: MainAxisAlignment.center,
context, MaterialPageRoute(
builder: (context) =>
InformationPage(model.orders[index])));
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.2),
child: RoundedContainer(
height: MediaQuery
.of(context)
.orientation ==
Orientation.portrait
? MediaQuery
.of(context)
.size
.height * 0.107
: MediaQuery
.of(context)
.size
.height * 0.18,
child: Row(
mainAxisAlignment: MainAxisAlignment
.spaceBetween,
children: <Widget>[ children: <Widget>[
Expanded( Padding(
flex: 1, padding: EdgeInsets.only(
child: Column( left: 10.0, bottom: 5.0),
mainAxisAlignment: MainAxisAlignment child: Image.asset(
.center, 'assets/images/location.png',
children: <Widget>[ height:
Padding( MediaQuery.of(context).size.height *
padding: EdgeInsets.only(left: 22.0), 0.06,
child: Image.asset( width: MediaQuery.of(context).size.width *
'assets/images/location.png', 0.05,
height: ),
MediaQuery )
.of(context) ],
.size ),
.height * ),
0.101, if (model.orders.length != 0)
), Expanded(
), flex: 3,
], child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 5.0),
child: Text(
model.orders[index].firstName +
' ' +
model.orders[index].lastName,
style: TextStyle(fontSize: 18.0),
),
),
Text(
model.orders[index].mobileNumber,
style: TextStyle(
color: Color(0xff30B7B9),
fontWeight: FontWeight.w600,
fontSize: 15.0,
),
), ),
),
if (model.orders.length != 0)
Expanded( Expanded(
flex: 3, child: Text(
child: Column( 'Olaya ST, Behind kfc next to king ,',
crossAxisAlignment: CrossAxisAlignment style: TextStyle(color: Colors.black45),
.start, ),
children: <Widget>[ ),
Padding( ],
padding: EdgeInsets.only(top: 10.0), ),
child: Text( ),
model.orders[index].firstName + Padding(
' ' + padding: EdgeInsets.all(10.0),
model.orders[index].lastName, child: Column(
style: TextStyle(fontSize: 18.0), mainAxisAlignment: MainAxisAlignment.center,
), children: <Widget>[
), Expanded(
Text( child: CircleAvatar(
model.orders[index].mobileNumber, backgroundColor: Colors.black45,
radius: 28.0,
child: CircleAvatar(
backgroundColor: Colors.white,
maxRadius: 24.1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'3 K.m \n away',
style: TextStyle( style: TextStyle(
color: Color(0xff30B7B9), color: Color(0xff30B7B9),
fontWeight: FontWeight.w600, fontSize: 10.5,
fontSize: 15.0), fontWeight: FontWeight.w400),
), ),
Expanded( ),
child: Text(
'Olaya ST, Behind kfc next to king ',
style: TextStyle(
color: Colors.black45),
),
)
],
), ),
), ),
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.1,
child: Padding(
padding: const EdgeInsets.all(
8.0),
child: Text(
'3 K.m \n away',
style: TextStyle(
color: Color(0xff30B7B9),
fontSize: 12.5,
fontWeight: FontWeight
.w600),
),
),
),
),
)
],
),
),
], ],
), ),
), ),
), ],
); ),
}), ),
), onTap: () {
], Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
InformationPage(model.orders[index])));
},
),
);
},
),
), ),
), ],
),
),
); );
} }
} }

@ -98,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