Merge branch 'development' into 'design_changes'

# Conflicts:
#   lib/pages/orders/deliverd_orders_page.dart
merge-requests/87/merge
hussam alhababieh 5 years ago
commit f961e750f3

@ -1,4 +1,4 @@
import 'package:driverapp/root_page.dart';
import 'package:driverapp/pages/splash_screen_page.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
@ -81,8 +81,9 @@ class MyApp extends StatelessWidget {
),
),
),
initialRoute: '/',
routes: {'/': (context) => RootPage()},
home: SplashScreenPage(),
// initialRoute: '/',
// routes: {'/': (context) => RootPage()},
debugShowCheckedModeBanner: false,
),
),

@ -5,6 +5,7 @@ import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart';
import 'package:driverapp/core/viewModels/authentication_view_model.dart';
import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/pages/delivery/information_page.dart';
import 'package:driverapp/pages/orders/deliverd_orders_page.dart';
import 'package:driverapp/pages/orders/pending_orders_page.dart';
import 'package:driverapp/pages/setting/setting.dart';
import 'package:driverapp/uitl/app_toast.dart';
@ -18,7 +19,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'package:driverapp/pages/orders/deliverd_orders_page.dart';
import '../base/base_view.dart';
@ -355,12 +355,26 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: <Widget>[
Expanded(
child: InkWell(
onTap: () {
_scanQrAndGetPatient(context, model);
},
child: Container(
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.18
: MediaQuery.of(context).size.height * 0.30,
width: MediaQuery.of(context).size.width * 0.50,
height: MediaQuery
.of(context)
.orientation ==
Orientation.portrait
? MediaQuery
.of(context)
.size
.height * 0.18
: MediaQuery
.of(context)
.size
.height * 0.30,
width: MediaQuery
.of(context)
.size
.width * 0.50,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
gradient: LinearGradient(
@ -381,50 +395,50 @@ class _DashboardScreenState extends State<DashboardScreen> {
width: MediaQuery.of(context).size.width *
0.26,
height: MediaQuery.of(context)
.orientation ==
Orientation.portrait
.orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height *
0.14
0.14
: MediaQuery.of(context).size.height *
0.28,
0.28,
fit: BoxFit.contain,
)
],
),
Column(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
InkWell(
onTap: () {
_scanQrAndGetPatient(context, model);
},
child: Padding(
padding: EdgeInsets.only(top: 8.0),
child: Text(
TranslationBase.of(context).scan,
style: TextStyle(
fontSize: MediaQuery.of(context)
.orientation ==
Orientation.landscape
? SizeConfig.textMultiplier * 6.0
: SizeConfig.textMultiplier * 4.0,
color: Colors.white,
fontWeight: FontWeight.w400,
),
Padding(
padding: EdgeInsets.only(top: 8.0),
child: Text(
TranslationBase
.of(context)
.scan,
style: TextStyle(
fontSize: MediaQuery
.of(context)
.orientation ==
Orientation.landscape
? SizeConfig.textMultiplier * 6.0
: SizeConfig.textMultiplier * 4.0,
color: Colors.white,
fontWeight: FontWeight.w400,
),
),
),
Padding(
padding: EdgeInsets.only(top: 0.0),
child: Text(
TranslationBase.of(context)
TranslationBase
.of(context)
.toAddPackageToQue,
style: TextStyle(
fontSize: MediaQuery.of(context)
.orientation ==
Orientation.landscape
fontSize: MediaQuery
.of(context)
.orientation ==
Orientation.landscape
? SizeConfig.textMultiplier * 3.0
: SizeConfig.textMultiplier * 2.0,
color: Colors.white,
@ -443,25 +457,23 @@ class _DashboardScreenState extends State<DashboardScreen> {
],
),
),
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,
),
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,
),
],
),
),
],
),
if (model.state == ViewState.Idle)
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
@ -480,16 +492,16 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
],
),
onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => OrdersListScreen()),
),
onTap: () =>
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => OrdersListScreen()),
),
),
],
),
],
),
],
),
),
NetworkBaseView(
@ -505,107 +517,129 @@ class _DashboardScreenState extends State<DashboardScreen> {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 12.2),
child: InkWell(
child: RoundedContainer(
raduis: 25.0,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.120
: MediaQuery.of(context).size.height * 0.209,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
left: 15.0, top: 14.0),
child: Image.asset(
'assets/images/location.png',
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,
),
)
],
),
),
if (model.orders.length != 0)
child: Container(
child: RoundedContainer(
showShadow: true,
raduis: 25.0,
height: MediaQuery
.of(context)
.orientation ==
Orientation.portrait
? MediaQuery
.of(context)
.size
.height * 0.120
: MediaQuery
.of(context)
.size
.height * 0.209,
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 5,
flex: 1,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 20.0),
child: Text(
model.orders[index].firstName +
' ' +
model.orders[index].lastName,
style: TextStyle(fontSize: 18.0),
padding: EdgeInsets.only(
left: 15.0, top: 14.0),
child: Image.asset(
'assets/images/location.png',
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,
),
),
Text(
model.orders[index].mobileNumber,
style: TextStyle(
color: Color(0xff30B7B9),
fontWeight: FontWeight.w600,
fontSize: 15.0,
)
],
),
),
if (model.orders.length != 0)
Expanded(
flex: 5,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 20.0),
child: Text(
model.orders[index].firstName +
' ' +
model.orders[index].lastName,
style: TextStyle(
fontSize: 18.0,
color: Hexcolor("#343333"),
fontWeight: FontWeight.bold),
),
),
),
Expanded(
child: Text(
model.orders[index].orderID
.toString(),
Text(
model.orders[index].mobileNumber,
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.w400,
letterSpacing: 8.0),
color: Color(0xff30B7B9),
fontWeight: FontWeight.w600,
fontSize: 15.0,
),
),
),
],
Expanded(
child: Text(
model.orders[index].orderID
.toString(),
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.w400,
letterSpacing: 8.0),
),
),
],
),
),
),
Padding(
padding: EdgeInsets.all(8.0),
child: CircleContainer(
borderWidth: 0.9,
child: Text(
model.orders[index].distanceInKilometers
.toString() +
'\nK.m\naway',
style: TextStyle(
color: Color(0xff42B6AD),
fontWeight: FontWeight.w800,
fontStyle: FontStyle.normal),
Padding(
padding: EdgeInsets.all(8.0),
child: CircleContainer(
borderWidth: 0.9,
child: Text(
model.orders[index].distanceInKilometers
.toString() +
'\nK.m\naway',
style: TextStyle(
color: Color(0xff42B6AD),
fontWeight: FontWeight.w800,
fontStyle: FontStyle.normal),
),
),
),
),
],
],
),
),
),
onTap: () {

@ -6,6 +6,7 @@ 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:hexcolor/hexcolor.dart';
import '../base/base_view.dart';
@ -87,9 +88,11 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
child: Text(
model.deliverdOrders[index].firstName +
' ' +
model
.deliverdOrders[index].lastName,
style: TextStyle(fontSize: 18.0),
model.orders[index].lastName,
style: TextStyle(
fontSize: 18.0,
color: Hexcolor("#343333"),
fontWeight: FontWeight.bold),
),
),
Text(

@ -1,11 +1,13 @@
import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/pages/delivery/information_page.dart';
import 'package:driverapp/uitl/translations_delegate_base.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 'package:hexcolor/hexcolor.dart';
import '../base/base_view.dart';
class OrdersListScreen extends StatefulWidget {
@ -85,7 +87,10 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
model.orders[index].firstName +
' ' +
model.orders[index].lastName,
style: TextStyle(fontSize: 18.0),
style: TextStyle(
fontSize: 18.0,
color: Hexcolor("#343333"),
fontWeight: FontWeight.bold),
),
),
Text(

@ -0,0 +1,150 @@
import 'dart:async';
import 'package:driverapp/app-icons/driver_app_icons.dart';
import 'package:driverapp/core/viewModels/project_view_model.dart';
import 'package:driverapp/root_page.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class SplashScreenPage extends StatefulWidget {
@override
_SplashScreenPageState createState() => _SplashScreenPageState();
}
class _SplashScreenPageState extends State<SplashScreenPage> {
startTime() async {
var _duration = new Duration(seconds: 1);
return new Timer(_duration, navigationPage);
}
@override
void initState() {
super.initState();
startTime();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: false,
appBarColor: Color(0xff30B7B9),
body: SingleChildScrollView(
child: Center(
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
FractionallySizedBox(
widthFactor: 0.80,
child: Column(
children: <Widget>[
SizedBox(
height: 200,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Icon(
DriverApp.logo,
size: 110,
color: Colors.white,
),
margin: EdgeInsets.only(
right: projectViewModel.isArabic
? 0
: MediaQuery.of(context).size.width * 0.15,
left: !projectViewModel.isArabic
? 0
: MediaQuery.of(context).size.width * 0.15),
),
],
),
SizedBox(
height: 20,
),
Column(
children: <Widget>[
Text(
"Driver",
style: TextStyle(
fontSize: 70,
fontWeight: FontWeight.bold,
color: Colors.white),
),
Text(
"Delivery",
style: TextStyle(
fontSize: 50,
letterSpacing: 1,
color: Colors.white),
),
Text(
"APP",
style: TextStyle(
fontSize: 53,
letterSpacing: 53,
color: Colors.white,
fontWeight: FontWeight.w400),
),
],
),
SizedBox(
height: 280,
)
],
),
),
Center(
child: FractionallySizedBox(
widthFactor: 0.80,
child: Column(
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(horizontal: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
child: Center(
child: Text(
"Powered by Cloud Solutions",
style: TextStyle(
fontSize: 13, color: Colors.white),
),
),
),
SizedBox(
height: 10,
)
],
),
),
],
),
],
),
),
),
],
),
),
),
);
}
void navigationPage() {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => RootPage(),
),
);
}
}

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class RoundedContainer extends StatefulWidget {
final double width;
@ -16,6 +17,7 @@ class RoundedContainer extends StatefulWidget {
final double bottomLeft;
final Widget child;
final double borderWidth;
final bool showShadow;
RoundedContainer(
{@required this.child,
@ -32,12 +34,14 @@ class RoundedContainer extends StatefulWidget {
this.topRight = 0,
this.bottomRight = 0,
this.bottomLeft = 0,
this.borderWidth = 1});
this.borderWidth = 1,
this.showShadow = true});
@override
_RoundedContainerState createState() => _RoundedContainerState();
}
class _RoundedContainerState extends State<RoundedContainer> {
@override
Widget build(BuildContext context) {
@ -45,36 +49,40 @@ class _RoundedContainerState extends State<RoundedContainer> {
width: widget.width,
height: widget.height,
margin: EdgeInsets.all(widget.margin),
decoration: widget.showBorder == true
? BoxDecoration(
color: Theme.of(context).primaryColor,
border: Border.all(
color: widget.borderColor, width: widget.borderWidth),
borderRadius: widget.customCornerRaduis
? BorderRadius.only(
topLeft: Radius.circular(widget.topLeft),
topRight: Radius.circular(widget.topRight),
bottomRight: Radius.circular(widget.bottomRight),
bottomLeft: Radius.circular(widget.bottomLeft))
: BorderRadius.circular(widget.raduis),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.1),
spreadRadius: 10,
blurRadius: 5,
offset: Offset(0, 5), // changes position of shadow
),
])
: null,
decoration:
BoxDecoration(
color: Theme
.of(context)
.primaryColor,
border: widget.showBorder == true ? Border.all(
color: widget.borderColor, width: widget.borderWidth) : null,
borderRadius: widget.customCornerRaduis
? BorderRadius.only(
topLeft: Radius.circular(widget.topLeft),
topRight: Radius.circular(widget.topRight),
bottomRight: Radius.circular(widget.bottomRight),
bottomLeft: Radius.circular(widget.bottomLeft))
: BorderRadius.circular(widget.raduis),
boxShadow: widget.showShadow ? [
BoxShadow(
color: Hexcolor("#DBE5E6"),
spreadRadius: 15,
blurRadius: 15,
offset: Offset(0, 7), // changes position of shadow
),
] : [])
,
child: Card(
margin: EdgeInsets.all(0),
shape: RoundedRectangleBorder(
borderRadius: widget.customCornerRaduis
? BorderRadius.only(
topLeft: Radius.circular(widget.topLeft),
topRight: Radius.circular(widget.topRight),
bottomRight: Radius.circular(widget.bottomRight),
bottomLeft: Radius.circular(widget.bottomLeft))
topLeft: Radius.circular(widget.topLeft),
topRight: Radius.circular(widget.topRight),
bottomRight: Radius.circular(widget.bottomRight),
bottomLeft: Radius.circular(widget.bottomLeft))
: BorderRadius.circular(widget.raduis),
),
color: widget.backgroundColor,

@ -78,6 +78,8 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter

Loading…
Cancel
Save