Merge branch 'delivery_confirmed' of https://gitlab.com/Cloud_Solution/driver-app into merge_delivery_into_dev

 Conflicts:
	lib/pages/dashboard/dashboard_screen.dart
logut
Elham Rababah 4 years ago
commit 0de2156b1e

@ -1,5 +1,3 @@
import 'dart:ffi';
class PendingOrders {
int driverID;
String searchKey;

@ -4,12 +4,12 @@ import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/uitl/app_toast.dart';
import 'package:driverapp/uitl/utils.dart';
import 'package:driverapp/pages/delivery/information_page.dart';
import 'package:driverapp/pages/orders/pending_orders_page.dart';
import 'package:driverapp/widgets/others/rounded_container.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../base/base_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:driverapp/app-icons/driver_app_icons.dart';
import 'package:driverapp/widgets/others/rounded_container.dart';
import 'package:driverapp/pages/orders/pending_orders_page.dart';
class DashboardScreen extends StatefulWidget {
@override
@ -345,14 +345,20 @@ class _DashboardScreenState extends State<DashboardScreen> {
itemCount: //model.orders == null ? 0 : model.orders.length,
3,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 12.2),
child: RoundedContainer(
height: MediaQuery.of(context).size.height * 0.108,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
return InkWell(
onTap: () {
Navigator.push(
context, MaterialPageRoute(builder: (context) =>
InformationPage(model.orders[index])));
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.2),
child: RoundedContainer(
height: MediaQuery.of(context).size.height * 0.108,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@ -362,11 +368,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Image.asset(
'assets/images/location.png'),
)
],
],
),
),
),
if (model.orders.length != 0)
Expanded(
if (model.orders.length != 0)
Expanded(
flex: 3,
child: Column(
crossAxisAlignment:
@ -392,15 +398,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
TextStyle(color: Colors.black45),
),
)
],
],
),
),
),
Padding(
padding: EdgeInsets.all(10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
Padding(
padding: EdgeInsets.all(10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: CircleAvatar(
backgroundColor: Colors.black45,
radius: 28.0,
@ -423,7 +429,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
],
),
),
],
],
),
),
),
);

@ -0,0 +1,155 @@
import 'package:driverapp/widgets/delivery/customer_brief_card.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../widgets/others/app_scaffold_widget.dart';
class DeliveryConfirmedPage extends StatelessWidget {
final dynamic item;
DeliveryConfirmedPage(this.item);
@override
Widget build(BuildContext context) {
return AppScaffold(
body: SafeArea(
child: Container(
color: Color(0xff41bdbb),
child: ListView(
children: <Widget>[
Column(
children: <Widget>[
Column(
children: <Widget>[
Container(
child: Container(
alignment: Alignment.topLeft,
child: IconButton(
color: Colors.white,
iconSize: 40,
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
},
),
),
),
Container(
child: Column(
children: <Widget>[
Container(
width: 300,
height: 300,
padding: EdgeInsets.only(top:60),
decoration: BoxDecoration(
color: Colors.white10,
shape: BoxShape.circle
),
child: Column(
children: <Widget>[
Icon(
Icons.check_circle,
color: Colors.white,
size: 60,
),
Text(
'Delivery Confirmed',
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold),
),
Text(
'Confirmation email and SMS has been sent',
style: TextStyle(
color: Colors.white,
fontSize: 13,
),
),
],
),
),
],
),
),
],
),
Stack(
children: <Widget>[
Container(
width: 400,
height: 500,
),
Container(
width: 800,
height: 440,
margin: EdgeInsets.only(top: 60),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
topRight: Radius.circular(80)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: 50),
child: Column(
children: <Widget>[
FlatButton.icon(
padding: EdgeInsets.all(8),
color: Colors.orangeAccent,
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(10.0),
),
icon: Icon(
Icons.mode_edit,
color: Colors.white,
),
label: Text(
'Add Note',
style: TextStyle(color: Colors.white),
),
onPressed: () {},
),
SizedBox(height: 20,),
FlatButton(
color: Color(0xff41bdbb),
padding: EdgeInsets.only(right: 100, left: 100),
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(18.0),
side: BorderSide(color: Color(0xff41bdbb)),
),
child: Text(
'Next Delivery',
style: TextStyle(color: Colors.white),
),
onPressed: () {},
),
],
),
),
],
),
),
CustomerBrief(
itemId: item.driverID,
customerFirstName: item.firstName,
customerLastName: item.lastName,
mobileNo: item.mobileNumber
),
],
),
],
),
],
),
),
),
);
}
}

@ -0,0 +1,225 @@
import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart';
import 'package:driverapp/widgets/delivery/customer_brief_card.dart';
import 'package:driverapp/widgets/delivery/delivery_action_button.dart';
import 'package:driverapp/widgets/delivery/package_content.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../widgets/others/app_scaffold_widget.dart';
class InformationPage extends StatelessWidget {
final dynamic item;
InformationPage(this.item);
@override
Widget build(BuildContext context) {
// return AppScaffold(
// body: Center(
// child: InkWell(onTap: () {},
// child: Texts('Replay Page')),
// ),
// );
return AppScaffold(
body: Container(
color: Color(0xff41bdbb),
child: ListView(
children: <Widget>[
Column(
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.only(right: 50),
child: IconButton(
color: Colors.white,
iconSize: 50,
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
},
),
),
Container(
child: Text(
'Delivery information',
style: TextStyle(
color: Colors.white,
fontSize: 20,
),
),
),
],
),
Stack(
children: <Widget>[
Container(
width: 400,
height: 500,
),
Container(
width: 800,
height: 700,
margin: EdgeInsets.only(top: 100),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(45),
topRight: Radius.circular(45)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
height: 170,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
delivery_info_button(
btnColor: Color(0xfff44336),
btnIcon: Icon(
Icons.near_me,
size: 30,
color: Colors.white,
),
btnName: 'Location',
btnFunction: () {},
),
delivery_info_button(
btnColor: Colors.green,
btnIcon: Icon(
Icons.whatshot,
size: 30,
color: Colors.white,
),
btnName: 'Whatsapp',
btnFunction: () {},
),
delivery_info_button(
btnColor: Colors.orangeAccent,
btnIcon: Icon(
Icons.mail_outline,
size: 30,
color: Colors.white,
),
btnName: 'SMS',
btnFunction: () {},
),
delivery_info_button(
btnColor: Color(0xff41bdbb),
btnIcon: Icon(
Icons.phone,
size: 30,
color: Colors.white,
),
btnName: 'Call',
btnFunction: () {},
),
],
),
SizedBox(
height: 30,
),
Container(
margin: EdgeInsets.only(left: 15, right: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Package Content',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20),
),
SizedBox(
height: 20,
),
package_content(
packageName: 'Panadol Extra 50 tablet',
packageCount: '5 box',
),
SizedBox(
height: 10,
),
package_content(
packageName: 'Xeractan 20MG 30 Capsules',
packageCount: '1 PCS',
),
SizedBox(
height: 10,
),
package_content(
packageName: 'Oltment for Rash unbranded 50 ml',
packageCount: '1 tube',
),
SizedBox(
height: 10,
),
package_content(
packageName: 'Face Mask 50 Pieces',
packageCount: '1 box',
),
SizedBox(
height: 10,
),
package_content(
packageName: 'Panadol Extra 50 tablet',
packageCount: '5 box',
),
SizedBox(
height: 10,
),
],
),
),
SizedBox(
height: 30,
),
FlatButton(
color: Color(0xff41bdbb),
padding: EdgeInsets.only(
right: 100, left: 100, bottom: 15, top: 15),
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(30.0),
side: BorderSide(color: Color(0xff41bdbb)),
),
child: Text(
'Client Reached',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16),
),
onPressed: () {
Navigator.push(
context, MaterialPageRoute(
builder: (context) =>
DeliveryConfirmedPage(item)));
},
),
],
),
),
CustomerBrief(
itemId: item.driverID,
customerFirstName: item.firstName,
customerLastName: item.lastName,
mobileNo: item.mobileNumber
),
],
),
],
),
],
),
),
);
}
}

@ -1,10 +1,11 @@
import 'package:driverapp/pages/landing/replay_page.dart';
import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart';
import 'package:driverapp/pages/delivery/information_page.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:driverapp/widgets/drawer/app_drawer_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:driverapp/pages/dashboard/dashboard_screen.dart';
import 'home_page.dart';
class LandingPage extends StatefulWidget {
@ -55,7 +56,12 @@ class _LandingPageState extends State<LandingPage> {
body: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: [HomePage(), ReplayPage(), DashboardScreen(), Container()],
children: [
HomePage(),
InformationPage(null),
DeliveryConfirmedPage(null),
Container()
],
),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab),
);

@ -8,8 +8,10 @@ class ReplayPage extends StatelessWidget {
Widget build(BuildContext context) {
return AppScaffold(
body: Center(
child: InkWell(onTap: () {}, child: Texts('Replay Page')),
child: InkWell(onTap: () {},
child: Texts('Replay Page')),
),
);
}
}

@ -0,0 +1,144 @@
import 'package:flutter/material.dart';
class CustomerBrief extends StatelessWidget {
final int itemId;
final String time;
final String customerFirstName;
final String customerLastName;
final String mobileNo;
final String direction;
final String totalPayment;
final String deliveryTime;
CustomerBrief(
{this.itemId,
this.time,
this.customerFirstName,
this.customerLastName,
this.mobileNo,
this.direction,
this.totalPayment,
this.deliveryTime});
@override
Widget build(BuildContext context) {
return Center(
child: Container(
width: 350,
height: 300,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(45),
topRight: Radius.circular(45),
bottomRight: Radius.circular(45),
bottomLeft: Radius.circular(45)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3),
),
],
),
child: Container(
padding: EdgeInsets.only(left: 30, top: 10, right: 30),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Expanded(
child: Text('ID: ${itemId}'),
),
Expanded(
child: Container(
margin: EdgeInsets.only(left: 83),
width: 10,
height: 60,
decoration: BoxDecoration(
border: Border.all(
width: 2.0,
color: Color(0xff41bdbb),
),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(45),
topRight: Radius.circular(45),
bottomRight: Radius.circular(45),
bottomLeft: Radius.circular(45),
),
),
child: Container(
margin: EdgeInsets.only(left: 12, top: 10),
child: Text(
'3 min away',
style: TextStyle(color: Color(0xff41bdbb)),
),
),
),
),
],
),
Text(
'${customerFirstName} ${customerLastName}',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
Text(
mobileNo,
style: TextStyle(color: Colors.lightBlue),
),
SizedBox(
height: 10,
),
Text(
'Olaya street, behind KFC resturant, next to kingdom towers 2ND floor ofice 277',
style: TextStyle(fontWeight: FontWeight.w600),
),
SizedBox(
height: 10,
),
Divider(
color: Colors.grey,
),
SizedBox(
height: 20,
),
Column(
children: <Widget>[
Row(
children: <Widget>[
Text(
'payment',
),
SizedBox(
width: 170,
),
Text(
'SAR 70',
style: TextStyle(fontWeight: FontWeight.bold),
),
],
),
SizedBox(
height: 20,
),
Row(
children: <Widget>[
Text('Delivery Time'),
SizedBox(
width: 50,
),
Text('05 Aug 20 - 10:00 AM',
style: TextStyle(fontWeight: FontWeight.bold)),
],
)
],
),
],
),
),
),
);
}
}

@ -0,0 +1,45 @@
import 'package:flutter/material.dart';
class delivery_info_button extends StatelessWidget {
final Color btnColor;
final Icon btnIcon;
final Function btnFunction;
final String btnName;
delivery_info_button(
{this.btnColor, this.btnIcon, this.btnFunction, this.btnName});
@override
Widget build(BuildContext context) {
print(btnColor);
return Padding(
padding: EdgeInsets.all(8.0),
child: Column(
children: <Widget>[
SizedBox(
height: 50,
width: 60, // specific value
child: RaisedButton(
padding: EdgeInsets.only(left: 2),
color: btnColor,
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(8.0),
),
child: btnIcon,
onPressed: btnFunction,
),
),
SizedBox(
height: 10,
),
Text(
btnName,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 10,
),
),
],
),
);
}
}

@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
class package_content extends StatelessWidget {
final String packageName;
final String packageCount;
package_content({this.packageName, this.packageCount});
@override
Widget build(BuildContext context) {
return Row(
children: <Widget>[
Expanded(
flex: 2,
child: Text(
packageName,
style: TextStyle(color: Colors.grey, fontWeight: FontWeight.w400),
),
),
Expanded(
child: Text(
packageCount,
textAlign: TextAlign.end,
style: TextStyle(color: Colors.grey, fontWeight: FontWeight.w400),
),
),
],
);
}
}
Loading…
Cancel
Save