Merge branch 'fix_issues' into 'development'

add splash_screen_page

See merge request Cloud_Solution/driver-app!74
logut
Elham 5 years ago
commit bb5e3b5d71

@ -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:driverapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
@ -81,8 +81,9 @@ class MyApp extends StatelessWidget {
), ),
), ),
), ),
initialRoute: '/', home: SplashScreenPage(),
routes: {'/': (context) => RootPage()}, // initialRoute: '/',
// routes: {'/': (context) => RootPage()},
debugShowCheckedModeBanner: false, 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/authentication_view_model.dart';
import 'package:driverapp/core/viewModels/orders_view_model.dart'; 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/deliverd_orders_page.dart';
import 'package:driverapp/pages/orders/pending_orders_page.dart'; import 'package:driverapp/pages/orders/pending_orders_page.dart';
import 'package:driverapp/pages/setting/setting.dart'; import 'package:driverapp/pages/setting/setting.dart';
import 'package:driverapp/uitl/app_toast.dart'; import 'package:driverapp/uitl/app_toast.dart';
@ -18,7 +19,6 @@ 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:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:driverapp/pages/orders/deliverd_orders_page.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
@ -355,12 +355,26 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () {
_scanQrAndGetPatient(context, model);
},
child: Container( child: Container(
height: MediaQuery.of(context).orientation == height: MediaQuery
Orientation.portrait .of(context)
? MediaQuery.of(context).size.height * 0.18 .orientation ==
: MediaQuery.of(context).size.height * 0.30, Orientation.portrait
width: MediaQuery.of(context).size.width * 0.50, ? MediaQuery
.of(context)
.size
.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: LinearGradient(
@ -381,50 +395,50 @@ class _DashboardScreenState extends State<DashboardScreen> {
width: MediaQuery.of(context).size.width * width: MediaQuery.of(context).size.width *
0.26, 0.26,
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.14 0.14
: MediaQuery.of(context).size.height * : MediaQuery.of(context).size.height *
0.28, 0.28,
fit: BoxFit.contain, fit: BoxFit.contain,
) )
], ],
), ),
Column( Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceEvenly, MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
InkWell( Padding(
onTap: () { padding: EdgeInsets.only(top: 8.0),
_scanQrAndGetPatient(context, model); child: Text(
}, TranslationBase
child: Padding( .of(context)
padding: EdgeInsets.only(top: 8.0), .scan,
child: Text( style: TextStyle(
TranslationBase.of(context).scan, fontSize: MediaQuery
style: TextStyle( .of(context)
fontSize: MediaQuery.of(context) .orientation ==
.orientation == Orientation.landscape
Orientation.landscape ? SizeConfig.textMultiplier * 6.0
? SizeConfig.textMultiplier * 6.0 : SizeConfig.textMultiplier * 4.0,
: SizeConfig.textMultiplier * 4.0, color: Colors.white,
color: Colors.white, fontWeight: FontWeight.w400,
fontWeight: FontWeight.w400,
),
), ),
), ),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 0.0), padding: EdgeInsets.only(top: 0.0),
child: Text( child: Text(
TranslationBase.of(context) TranslationBase
.of(context)
.toAddPackageToQue, .toAddPackageToQue,
style: TextStyle( style: TextStyle(
fontSize: MediaQuery.of(context) fontSize: MediaQuery
.orientation == .of(context)
Orientation.landscape .orientation ==
Orientation.landscape
? SizeConfig.textMultiplier * 3.0 ? SizeConfig.textMultiplier * 3.0
: SizeConfig.textMultiplier * 2.0, : SizeConfig.textMultiplier * 2.0,
color: Colors.white, color: Colors.white,
@ -505,107 +519,129 @@ class _DashboardScreenState extends State<DashboardScreen> {
return Padding( return Padding(
padding: EdgeInsets.symmetric(horizontal: 12.2), padding: EdgeInsets.symmetric(horizontal: 12.2),
child: InkWell( child: InkWell(
child: RoundedContainer( child: Container(
raduis: 25.0, child: RoundedContainer(
height: MediaQuery.of(context).orientation == showShadow: true,
Orientation.portrait raduis: 25.0,
? MediaQuery.of(context).size.height * 0.120 height: MediaQuery
: MediaQuery.of(context).size.height * 0.209, .of(context)
child: Row( .orientation ==
mainAxisAlignment: MainAxisAlignment.spaceBetween, Orientation.portrait
children: <Widget>[ ? MediaQuery
Expanded( .of(context)
flex: 1, .size
child: Column( .height * 0.120
mainAxisAlignment: MainAxisAlignment.start, : MediaQuery
crossAxisAlignment: .of(context)
CrossAxisAlignment.start, .size
children: <Widget>[ .height * 0.209,
Padding( child: Row(
padding: EdgeInsets.only( mainAxisAlignment:
left: 15.0, top: 14.0), MainAxisAlignment.spaceBetween,
child: Image.asset( children: <Widget>[
'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)
Expanded( Expanded(
flex: 5, flex: 1,
child: Column( child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(top: 20.0), padding: EdgeInsets.only(
child: Text( left: 15.0, top: 14.0),
model.orders[index].firstName + child: Image.asset(
' ' + 'assets/images/location.png',
model.orders[index].lastName, height: MediaQuery
style: TextStyle(fontSize: 18.0), .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), if (model.orders.length != 0)
fontWeight: FontWeight.w600, Expanded(
fontSize: 15.0, 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),
),
), ),
), Text(
Expanded( model.orders[index].mobileNumber,
child: Text(
model.orders[index].orderID
.toString(),
style: TextStyle( style: TextStyle(
fontSize: 15.0, color: Color(0xff30B7B9),
fontWeight: FontWeight.w400, fontWeight: FontWeight.w600,
letterSpacing: 8.0), fontSize: 15.0,
),
), ),
), Expanded(
], child: Text(
model.orders[index].orderID
.toString(),
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.w400,
letterSpacing: 8.0),
),
),
],
),
), ),
), Padding(
Padding( padding: EdgeInsets.all(8.0),
padding: EdgeInsets.all(8.0), child: CircleContainer(
child: CircleContainer( borderWidth: 0.9,
borderWidth: 0.9, child: Text(
child: Text( model.orders[index].distanceInKilometers
model.orders[index].distanceInKilometers .toString() +
.toString() + '\nK.m\naway',
'\nK.m\naway', style: TextStyle(
style: TextStyle( color: Color(0xff42B6AD),
color: Color(0xff42B6AD), fontWeight: FontWeight.w800,
fontWeight: FontWeight.w800, fontStyle: FontStyle.normal),
fontStyle: FontStyle.normal), ),
), ),
), ),
), ],
], ),
), ),
), ),
onTap: () { onTap: () {

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

@ -1,11 +1,13 @@
import 'package:driverapp/core/viewModels/orders_view_model.dart'; 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/uitl/translations_delegate_base.dart';
import 'package:driverapp/widgets/data_display/circle-container.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/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';
import 'package:driverapp/uitl/translations_delegate_base.dart'; import 'package:hexcolor/hexcolor.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
class OrdersListScreen extends StatefulWidget { class OrdersListScreen extends StatefulWidget {
@ -85,7 +87,10 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
model.orders[index].firstName + model.orders[index].firstName +
' ' + ' ' +
model.orders[index].lastName, model.orders[index].lastName,
style: TextStyle(fontSize: 18.0), style: TextStyle(
fontSize: 18.0,
color: Hexcolor("#343333"),
fontWeight: FontWeight.bold),
), ),
), ),
Text( 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: 2);
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:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class RoundedContainer extends StatefulWidget { class RoundedContainer extends StatefulWidget {
final double width; final double width;
@ -16,6 +17,7 @@ class RoundedContainer extends StatefulWidget {
final double bottomLeft; final double bottomLeft;
final Widget child; final Widget child;
final double borderWidth; final double borderWidth;
final bool showShadow;
RoundedContainer( RoundedContainer(
{@required this.child, {@required this.child,
@ -32,12 +34,14 @@ class RoundedContainer extends StatefulWidget {
this.topRight = 0, this.topRight = 0,
this.bottomRight = 0, this.bottomRight = 0,
this.bottomLeft = 0, this.bottomLeft = 0,
this.borderWidth = 1}); this.borderWidth = 1,
this.showShadow = true});
@override @override
_RoundedContainerState createState() => _RoundedContainerState(); _RoundedContainerState createState() => _RoundedContainerState();
} }
class _RoundedContainerState extends State<RoundedContainer> { class _RoundedContainerState extends State<RoundedContainer> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -45,36 +49,40 @@ class _RoundedContainerState extends State<RoundedContainer> {
width: widget.width, width: widget.width,
height: widget.height, height: widget.height,
margin: EdgeInsets.all(widget.margin), margin: EdgeInsets.all(widget.margin),
decoration: widget.showBorder == true decoration:
? BoxDecoration( BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme
border: Border.all( .of(context)
color: widget.borderColor, width: widget.borderWidth), .primaryColor,
borderRadius: widget.customCornerRaduis
? BorderRadius.only( border: widget.showBorder == true ? Border.all(
topLeft: Radius.circular(widget.topLeft), color: widget.borderColor, width: widget.borderWidth) : null,
topRight: Radius.circular(widget.topRight), borderRadius: widget.customCornerRaduis
bottomRight: Radius.circular(widget.bottomRight), ? BorderRadius.only(
bottomLeft: Radius.circular(widget.bottomLeft)) topLeft: Radius.circular(widget.topLeft),
: BorderRadius.circular(widget.raduis), topRight: Radius.circular(widget.topRight),
boxShadow: [ bottomRight: Radius.circular(widget.bottomRight),
BoxShadow( bottomLeft: Radius.circular(widget.bottomLeft))
color: Colors.grey.withOpacity(0.1), : BorderRadius.circular(widget.raduis),
spreadRadius: 10,
blurRadius: 5, boxShadow: widget.showShadow ? [
offset: Offset(0, 5), // changes position of shadow BoxShadow(
), color: Hexcolor("#DBE5E6"),
]) spreadRadius: 15,
: null, blurRadius: 15,
offset: Offset(0, 7), // changes position of shadow
),
] : [])
,
child: Card( child: Card(
margin: EdgeInsets.all(0), margin: EdgeInsets.all(0),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: widget.customCornerRaduis borderRadius: widget.customCornerRaduis
? BorderRadius.only( ? BorderRadius.only(
topLeft: Radius.circular(widget.topLeft), topLeft: Radius.circular(widget.topLeft),
topRight: Radius.circular(widget.topRight), topRight: Radius.circular(widget.topRight),
bottomRight: Radius.circular(widget.bottomRight), bottomRight: Radius.circular(widget.bottomRight),
bottomLeft: Radius.circular(widget.bottomLeft)) bottomLeft: Radius.circular(widget.bottomLeft))
: BorderRadius.circular(widget.raduis), : BorderRadius.circular(widget.raduis),
), ),
color: widget.backgroundColor, color: widget.backgroundColor,

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

Loading…
Cancel
Save