Merge branch 'development' into 'master'

Development

See merge request Cloud_Solution/driver-app!90
merge-requests/90/merge
Elham 6 years ago
commit 70f325f99f

@ -1,4 +1,5 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
/// End points /// End points
const BASE_URL = 'https://uat.hmgwebservices.com/Services'; const BASE_URL = 'https://uat.hmgwebservices.com/Services';
@ -23,3 +24,10 @@ const MAX_SMALL_SCREEN = 660;
class AppGlobal { class AppGlobal {
static BuildContext context; static BuildContext context;
} }
const LINEAR_GRADIENT = LinearGradient(
colors: [
Color(0xff49C1BC),
Color(0xff17AFB8),
],
);

@ -1,4 +1,5 @@
import 'package:barcode_scan/platform_wrapper.dart'; import 'package:barcode_scan/platform_wrapper.dart';
import 'package:driverapp/config/config.dart';
import 'package:driverapp/config/size_config.dart'; import 'package:driverapp/config/size_config.dart';
import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart'; import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart';
@ -102,14 +103,18 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Image.asset( child: Image.asset(
'assets/images/driver.png', 'assets/images/driver.png',
fit: BoxFit.contain, fit: BoxFit.contain,
),), ),
),
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) => SettingPage(
SettingPage(driverName:_authenticationViewModel.user.userName, driverID:_authenticationViewModel.user.userID))); driverName: _authenticationViewModel
.user.userName,
driverID: _authenticationViewModel
.user.userID)));
}, },
), ),
], ],
@ -133,10 +138,7 @@ 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(colors: [ gradient: LINEAR_GRADIENT,
Color(0xff17AFB8),
Color(0xff49C1BC)
]),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -243,10 +245,7 @@ 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(colors: [ gradient: LINEAR_GRADIENT,
Color(0xff17AFB8),
Color(0xff49C1BC)
]),
), ),
child: InkWell( child: InkWell(
onTap: () => Navigator.push( onTap: () => Navigator.push(
@ -279,7 +278,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
), ),
Text( Text(
'5', '3',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: fontSize:
@ -288,7 +287,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
Text( Text(
TranslationBase.of(context) TranslationBase.of(context)
.undeliveredPackages, .deliveredPackages,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: MediaQuery.of(context) fontSize: MediaQuery.of(context)
@ -311,7 +310,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
height: 100, height: 100,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white10, color: Colors.white10,
shape: BoxShape.circle), shape: BoxShape.circle,
),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
@ -360,30 +360,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
_scanQrAndGetPatient(context, model); _scanQrAndGetPatient(context, model);
}, },
child: Container( child: Container(
height: MediaQuery height: MediaQuery.of(context).orientation ==
.of(context)
.orientation ==
Orientation.portrait Orientation.portrait
? MediaQuery ? MediaQuery.of(context).size.height * 0.18
.of(context) : MediaQuery.of(context).size.height * 0.30,
.size width: MediaQuery.of(context).size.width * 0.50,
.height * 0.18
: MediaQuery
.of(context)
.size
.height * 0.30,
width: MediaQuery
.of(context)
.size
.width * 0.50,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0), borderRadius: BorderRadius.circular(15.0),
gradient: LinearGradient( gradient: LINEAR_GRADIENT,
colors: [
Hexcolor("#45B7AE"),
Hexcolor("#119FA9")
],
),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -414,12 +398,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: Text( child: Text(
TranslationBase TranslationBase.of(context).scan,
.of(context)
.scan,
style: TextStyle( style: TextStyle(
fontSize: MediaQuery fontSize: MediaQuery.of(context)
.of(context)
.orientation == .orientation ==
Orientation.landscape Orientation.landscape
? SizeConfig.textMultiplier * 6.0 ? SizeConfig.textMultiplier * 6.0
@ -432,12 +413,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
Padding( Padding(
padding: EdgeInsets.only(top: 0.0), padding: EdgeInsets.only(top: 0.0),
child: Text( child: Text(
TranslationBase TranslationBase.of(context)
.of(context)
.toAddPackageToQue, .toAddPackageToQue,
style: TextStyle( style: TextStyle(
fontSize: MediaQuery fontSize: MediaQuery.of(context)
.of(context)
.orientation == .orientation ==
Orientation.landscape Orientation.landscape
? SizeConfig.textMultiplier * 3.0 ? SizeConfig.textMultiplier * 3.0
@ -465,8 +444,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: <Widget>[ children: <Widget>[
Column( Column(
children: <Widget>[ children: <Widget>[
Text( Text(TranslationBase.of(context).nearestDropOffs,
TranslationBase.of(context).nearestDropOffs,
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,
color: Hexcolor("#343333"), color: Hexcolor("#343333"),
@ -492,8 +470,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
], ],
), ),
onTap: () => onTap: () => Navigator.push(
Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => OrdersListScreen()), builder: (context) => OrdersListScreen()),
@ -521,18 +498,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: RoundedContainer( child: RoundedContainer(
showShadow: true, showShadow: true,
raduis: 25.0, raduis: 25.0,
height: MediaQuery height: MediaQuery.of(context).orientation ==
.of(context)
.orientation ==
Orientation.portrait Orientation.portrait
? MediaQuery ? MediaQuery.of(context).size.height * 0.120
.of(context) : MediaQuery.of(context).size.height * 0.209,
.size
.height * 0.120
: MediaQuery
.of(context)
.size
.height * 0.209,
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
@ -550,31 +519,25 @@ class _DashboardScreenState extends State<DashboardScreen> {
left: 15.0, top: 14.0), left: 15.0, top: 14.0),
child: Image.asset( child: Image.asset(
'assets/images/location.png', 'assets/images/location.png',
height: MediaQuery height: MediaQuery.of(context)
.of(context)
.orientation == .orientation ==
Orientation.portrait Orientation.portrait
? MediaQuery ? MediaQuery.of(context)
.of(context)
.size .size
.height * .height *
0.06 0.06
: MediaQuery : MediaQuery.of(context)
.of(context)
.size .size
.height * .height *
0.11, 0.11,
width: MediaQuery width: MediaQuery.of(context)
.of(context)
.orientation == .orientation ==
Orientation.portrait Orientation.portrait
? MediaQuery ? MediaQuery.of(context)
.of(context)
.size .size
.width * .width *
0.05 0.05
: MediaQuery : MediaQuery.of(context)
.of(context)
.size .size
.width * .width *
0.09, 0.09,
@ -672,4 +635,3 @@ class _DashboardScreenState extends State<DashboardScreen> {
} }
} }
} }

@ -88,10 +88,10 @@ class DeliveryConfirmedPage extends StatelessWidget {
), ),
], ],
), ),
Container( // Container(
width: MediaQuery.of(context).size.width, // width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width, // height: MediaQuery.of(context).size.width,
), // ),
Container( Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width * 1.0, height: MediaQuery.of(context).size.width * 1.0,
@ -105,12 +105,15 @@ class DeliveryConfirmedPage extends StatelessWidget {
topRight: Radius.circular(80)), topRight: Radius.circular(80)),
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MediaQuery.of(context).orientation ==
Orientation.landscape
? MainAxisAlignment.center
: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
bottom: MediaQuery.of(context).size.width * 0.09, bottom: MediaQuery.of(context).size.width * 0.00,
), ),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[

File diff suppressed because one or more lines are too long

@ -1,6 +1,7 @@
import 'package:driverapp/core/viewModels/orders_view_model.dart'; import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/widgets/delivery/distance_in_kilometers.dart'; import 'package:driverapp/widgets/delivery/distance_in_kilometers.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/rounded_container.dart'; import 'package:driverapp/widgets/others/rounded_container.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -28,7 +29,9 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Expanded( NetworkBaseView(
baseViewModel: model,
child: Expanded(
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
@ -55,23 +58,31 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: padding: EdgeInsets.only(
EdgeInsets.only(left: 15.0, top: 14.0), left: 15.0, top: 14.0),
child: Image.asset( child: Image.asset(
'assets/images/location.png', 'assets/images/location.png',
height: MediaQuery.of(context) height: MediaQuery.of(context)
.orientation == .orientation ==
Orientation.portrait Orientation.portrait
? MediaQuery.of(context).size.height * ? MediaQuery.of(context)
.size
.height *
0.06 0.06
: MediaQuery.of(context).size.height * : MediaQuery.of(context)
.size
.height *
0.11, 0.11,
width: MediaQuery.of(context) width: MediaQuery.of(context)
.orientation == .orientation ==
Orientation.portrait Orientation.portrait
? MediaQuery.of(context).size.width * ? MediaQuery.of(context)
.size
.width *
0.05 0.05
: MediaQuery.of(context).size.width * : MediaQuery.of(context)
.size
.width *
0.09, 0.09,
), ),
) )
@ -82,12 +93,14 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
Expanded( Expanded(
flex: 5, flex: 5,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(top: 20.0), padding: EdgeInsets.only(top: 20.0),
child: Text( child: Text(
model.deliverdOrders[index].firstName + model.deliverdOrders[index]
.firstName +
' ' + ' ' +
model.orders[index].lastName, model.orders[index].lastName,
style: TextStyle( style: TextStyle(
@ -97,7 +110,8 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
), ),
), ),
Text( Text(
model.deliverdOrders[index].mobileNumber, model
.deliverdOrders[index].mobileNumber,
style: TextStyle( style: TextStyle(
color: Color(0xff30B7B9), color: Color(0xff30B7B9),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -123,16 +137,23 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
distanceInKilometers: model distanceInKilometers: model
.deliverdOrders[index].distanceInKilometers, .deliverdOrders[index].distanceInKilometers,
), ),
//
), ),
], ],
), ),
), ),
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// InformationPage(model.orders[index])));
// },
), ),
); );
}, },
), ),
), ),
),
], ],
), ),
), ),

@ -49,4 +49,6 @@ class Utils {
LocationData currentLocation = await location.getLocation(); LocationData currentLocation = await location.getLocation();
return currentLocation; return currentLocation;
} }
static nameFormat(String) {}
} }

@ -1,3 +1,4 @@
import 'package:driverapp/config/config.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -13,8 +14,7 @@ import 'package:hexcolor/hexcolor.dart';
/// [borderColor] the button border color /// [borderColor] the button border color
/// [noBorderRadius] remove border radius /// [noBorderRadius] remove border radius
class SecondaryButton extends StatefulWidget { class SecondaryButton extends StatefulWidget {
SecondaryButton( SecondaryButton({Key key,
{Key key,
this.label = "", this.label = "",
this.icon, this.icon,
this.iconOnly = false, this.iconOnly = false,
@ -191,14 +191,8 @@ class _SecondaryButtonState extends State<SecondaryButton>
height: MediaQuery.of(context).size.width * 2.2, height: MediaQuery.of(context).size.width * 2.2,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
gradient: widget.color != null gradient:
? null widget.color != null ? null : LINEAR_GRADIENT,
: LinearGradient(
colors: [
Hexcolor("#45B7AE"),
Hexcolor("#119FA9")
],
),
color: widget.color != null color: widget.color != null
? widget.color ? widget.color
: Hexcolor("#000000"), : Hexcolor("#000000"),

@ -6,7 +6,7 @@ class CircleContainer extends StatelessWidget {
{this.child, {this.child,
this.color = Colors.white, this.color = Colors.white,
this.borderColor, this.borderColor,
this.borderWidth = 1.5, this.borderWidth = 2,
this.onTap}); this.onTap});
final Widget child; final Widget child;

@ -17,8 +17,8 @@ class AppScaffold extends StatelessWidget {
final Color arrowColor; final Color arrowColor;
final Color appBarColor; final Color appBarColor;
AppScaffold( AppScaffold({
{@required this.body, @required this.body,
this.appBarTitle = '', this.appBarTitle = '',
this.isLoading = false, this.isLoading = false,
this.isShowAppBar = false, this.isShowAppBar = false,
@ -50,7 +50,9 @@ class AppScaffold extends StatelessWidget {
title: Text(appBarTitle.toUpperCase()), title: Text(appBarTitle.toUpperCase()),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return ArrowBack(arrowColor: arrowColor,); return ArrowBack(
arrowColor: arrowColor,
);
}, },
), ),
centerTitle: true, centerTitle: true,
@ -70,7 +72,8 @@ class AppScaffold extends StatelessWidget {
child: buildBodyWidget(), child: buildBodyWidget(),
baseViewModel: baseViewModel, baseViewModel: baseViewModel,
) )
: buildBodyWidget(), bottomSheet: bottomSheet, : buildBodyWidget(),
bottomSheet: bottomSheet,
), ),
); );
} }

Loading…
Cancel
Save