Merge branch 'master' of gitlab.com:Cloud_Solution/driver-app into setting_branch

setting_branch
enadhilal 5 years ago
commit 7f8b4e9d22

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

@ -81,6 +81,10 @@ class AuthenticationViewModel with ChangeNotifier {
}
logout() async {
isLoading = false;
isError = false;
isLogin = false;
await sharedPref.clear();
notifyListeners();
}
}

@ -3,6 +3,7 @@ import 'package:get_it/get_it.dart';
import 'core/service/authentication_service.dart';
import 'core/service/hospital_service.dart';
import 'core/service/orders_service.dart';
import 'core/viewModels/authentication_view_model.dart';
import 'core/viewModels/hospital_view_model.dart';
import 'core/viewModels/orders_view_model.dart';
@ -17,6 +18,6 @@ void setupLocator() {
/// View Model
locator.registerFactory(() => HospitalViewModel());
// locator.registerFactory(() => AuthenticationViewModel());
locator.registerFactory(() => AuthenticationViewModel());
locator.registerFactory(() => OrdersViewModel());
}

@ -184,50 +184,50 @@ class LoginPage extends StatelessWidget {
}
return null;
},
onSaved: (value) {
loginRequest.userID =
int.parse(value.trim());
},
),
),
SizedBox(
height: 20,
),
Container(
child: TextFields(
borderRadiusValue: 6,
hintText:
TranslationBase.of(context).enterPassword,
validator: (value) {
if (value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterPassword;
}
return null;
},
onSaved: (value) {
loginRequest.password = value;
},
type: 'password',
),
onSaved: (value) {
loginRequest.userID = int.parse(value.trim());
},
),
SizedBox(
height: 25,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Text(
TranslationBase.of(context).forgotPassword,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor),
),
],
),
SizedBox(
height: 20,
),
Container(
child: TextFields(
borderRadiusValue: 6,
hintText:
TranslationBase.of(context).enterPassword,
validator: (value) {
if (value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterPassword;
}
return null;
},
onSaved: (value) {
loginRequest.password = value;
},
type: 'password',
),
],
),
),
SizedBox(
height: 25,
),
//ToDo when forget page functions ready
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// Text(
// TranslationBase.of(context).forgotPassword,
// style: TextStyle(
// fontSize: 14,
// color: Theme.of(context).primaryColor),
// ),
// ],
// ),
],
),
),
],
),
),

@ -1,4 +1,5 @@
import 'package:barcode_scan/platform_wrapper.dart';
import 'package:driverapp/config/config.dart';
import 'package:driverapp/config/size_config.dart';
import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart';
@ -7,14 +8,13 @@ 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/pages/setting/setting_page.dart';
import 'package:driverapp/uitl/app_toast.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/uitl/utils.dart';
import 'package:driverapp/widgets/data_display/circle-container.dart';
import 'package:driverapp/widgets/order/order_info_card.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
@ -93,23 +93,27 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Column(
children: <Widget>[
InkWell(
child:CircleAvatar(
radius: 25.5,
backgroundColor: Color(0xff30B7B9),
child: CircleAvatar(
radius: 25.5,
backgroundColor: Color(0xff30B7B9),
maxRadius: 26.0,
child: Image.asset(
'assets/images/driver.png',
fit: BoxFit.contain,
),),
child: CircleAvatar(
backgroundColor: Color(0xff30B7B9),
maxRadius: 26.0,
child: Image.asset(
'assets/images/driver.png',
fit: BoxFit.contain,
),
),
),
onTap: (){
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
SettingPage(driverName:_authenticationViewModel.user.userName, driverID:_authenticationViewModel.user.userID)));
builder: (context) => SettingPage(
driverName: _authenticationViewModel
.user.userName,
driverID: _authenticationViewModel
.user.userID)));
},
),
],
@ -133,10 +137,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
width: MediaQuery.of(context).size.width * 0.44,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
gradient: LinearGradient(colors: [
Color(0xff17AFB8),
Color(0xff49C1BC)
]),
gradient: LINEAR_GRADIENT,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -243,10 +244,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
width: MediaQuery.of(context).size.width * 0.45,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
gradient: LinearGradient(colors: [
Color(0xff17AFB8),
Color(0xff49C1BC)
]),
gradient: LINEAR_GRADIENT,
),
child: InkWell(
onTap: () => Navigator.push(
@ -279,7 +277,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
),
Text(
'5',
'3',
style: TextStyle(
color: Colors.white,
fontSize:
@ -288,7 +286,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
Text(
TranslationBase.of(context)
.undeliveredPackages,
.deliveredPackages,
style: TextStyle(
color: Colors.white,
fontSize: MediaQuery.of(context)
@ -310,8 +308,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
width: 100,
height: 100,
decoration: BoxDecoration(
color: Colors.white10,
shape: BoxShape.circle),
color: Colors.white10,
shape: BoxShape.circle,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
@ -360,30 +359,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
_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(
colors: [
Hexcolor("#45B7AE"),
Hexcolor("#119FA9")
],
),
gradient: LINEAR_GRADIENT,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -396,32 +379,29 @@ 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>[
Padding(
padding: EdgeInsets.only(top: 8.0),
child: Text(
TranslationBase
.of(context)
.scan,
TranslationBase.of(context).scan,
style: TextStyle(
fontSize: MediaQuery
.of(context)
.orientation ==
Orientation.landscape
fontSize: MediaQuery.of(context)
.orientation ==
Orientation.landscape
? SizeConfig.textMultiplier * 6.0
: SizeConfig.textMultiplier * 4.0,
color: Colors.white,
@ -432,14 +412,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
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,
@ -465,8 +443,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: <Widget>[
Column(
children: <Widget>[
Text(
TranslationBase.of(context).nearestDropOffs,
Text(TranslationBase.of(context).nearestDropOffs,
style: TextStyle(
fontSize: 18.0,
color: Hexcolor("#343333"),
@ -492,12 +469,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
],
),
onTap: () =>
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => OrdersListScreen()),
),
onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => OrdersListScreen()),
),
),
],
),
@ -516,140 +492,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 0.2),
child: InkWell(
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: 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)
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),
),
),
Text(
model.orders[index].mobileNumber,
style: TextStyle(
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: 1.5,
child: Text(
model.orders[index].distanceInKilometers
.toString() +
'\nK.m\naway',
style: TextStyle(
color: Color(0xff42B6AD),
fontWeight: FontWeight.w800,
fontStyle: FontStyle.normal),
),
),
),
],
),
),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
InformationPage(model.orders[index])));
},
),
child: OrderInfoCard(
order: model.orders[index],
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => InformationPage(
model.orders[index])));
}),
);
},
),
@ -680,3 +531,5 @@ class _DashboardScreenState extends State<DashboardScreen> {
}
}
}

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

File diff suppressed because one or more lines are too long

@ -1,11 +1,9 @@
import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/pages/delivery/information_page.dart';
import 'package:driverapp/widgets/data_display/circle-container.dart';
import 'package:driverapp/widgets/order/order_info_card.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:driverapp/widgets/others/rounded_container.dart';
import 'package:driverapp/widgets/others/network_base_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../base/base_view.dart';
@ -29,123 +27,23 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
SizedBox(
height: 20,
),
Expanded(
child: ListView.builder(
shrinkWrap: true,
scrollDirection: Axis.vertical,
itemCount: model.deliverdOrders == null
? 0
: model.deliverdOrders.length,
itemBuilder: (BuildContext context, int index) {
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)
Expanded(
flex: 5,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 20.0),
child: Text(
model.deliverdOrders[index].firstName +
' ' +
model.orders[index].lastName,
style: TextStyle(
fontSize: 18.0,
color: Hexcolor("#343333"),
fontWeight: FontWeight.bold),
),
),
Text(
model.deliverdOrders[index].mobileNumber,
style: TextStyle(
color: Color(0xff30B7B9),
fontWeight: FontWeight.w600,
fontSize: 15.0,
),
),
Expanded(
child: Text(
model.deliverdOrders[index].orderID
.toString(),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w400,
letterSpacing: 8.0),
),
),
],
),
),
Padding(
padding: EdgeInsets.all(8.0),
child: CircleContainer(
child: Text(
model.deliverdOrders[index]
.distanceInKilometers
.toString() +
'\nK.m\naway',
style: TextStyle(
color: Color(0xff42B6AD),
fontWeight: FontWeight.w800,
fontStyle: FontStyle.normal),
),
),
),
],
),
),
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// InformationPage(model.orders[index])));
// },
),
);
},
NetworkBaseView(
baseViewModel: model,
child: Expanded(
child: ListView.builder(
shrinkWrap: true,
scrollDirection: Axis.vertical,
itemCount: model.deliverdOrders == null
? 0
: model.deliverdOrders.length,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 12.2),
child: OrderInfoCard(
order: model.deliverdOrders[index],
));
},
),
),
),
],

@ -1,12 +1,9 @@
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/order/order_info_card.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:hexcolor/hexcolor.dart';
import '../base/base_view.dart';
@ -38,109 +35,7 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
itemBuilder: (BuildContext context, int index) {
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)
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),
),
),
Text(
model.orders[index].mobileNumber,
style: TextStyle(
color: Color(0xff30B7B9),
fontWeight: FontWeight.w600,
fontSize: 15.0,
),
),
Expanded(
child: Text(
model.orders[index].orderID.toString(),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w400,
letterSpacing: 8.0),
),
),
],
),
),
Padding(
padding: EdgeInsets.all(8.0),
child: CircleContainer(
child: Text(
model.orders[index].distanceInKilometers
.toString() +
'\nK.m\naway',
style: TextStyle(
color: Color(0xff42B6AD),
fontWeight: FontWeight.w800,
fontStyle: FontStyle.normal),
),
),
),
],
),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
InformationPage(model.orders[index])));
},
),
child: OrderInfoCard(order: model.orders[index]),
);
},
),

@ -1,11 +1,12 @@
import 'package:driverapp/core/viewModels/authentication_view_model.dart';
import 'package:driverapp/pages/authentication/login_page.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../root_page.dart';
class SettingPage extends StatelessWidget {
final String driverName; //_authenticationViewModel.user.userName
final int driverID;
@ -79,11 +80,9 @@ class SettingPage extends StatelessWidget {
InkWell(
onTap: () async {
await _authenticationViewModel.logout();
Navigator.push(
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => LoginPage()
),
MaterialPageRoute(builder: (context) => RootPage()),
);
},
child: Column(

@ -49,4 +49,16 @@ class Utils {
LocationData currentLocation = await location.getLocation();
return currentLocation;
}
static formatName(String name) {
List<String> names = name.split(" ");
List<String> formattedNamesList = [];
names.forEach((name) {
name = name.toLowerCase();
name = name[0].toUpperCase() + name.substring(1);
formattedNamesList.add(name);
});
return formattedNamesList.join(' ');
}
}

@ -1,3 +1,4 @@
import 'package:driverapp/config/config.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
@ -13,19 +14,18 @@ import 'package:hexcolor/hexcolor.dart';
/// [borderColor] the button border color
/// [noBorderRadius] remove border radius
class SecondaryButton extends StatefulWidget {
SecondaryButton(
{Key key,
this.label = "",
this.icon,
this.iconOnly = false,
this.color,
this.textColor,
this.onTap,
this.loading: false,
this.small = false,
this.disabled = false,
this.borderColor,
this.noBorderRadius = false})
SecondaryButton({Key key,
this.label = "",
this.icon,
this.iconOnly = false,
this.color,
this.textColor,
this.onTap,
this.loading: false,
this.small = false,
this.disabled = false,
this.borderColor,
this.noBorderRadius = false})
: super(key: key);
final String label;
@ -148,7 +148,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
decoration: BoxDecoration(
border: widget.borderColor != null
? Border.all(
color: widget.borderColor.withOpacity(0.1), width: 2.0)
color: widget.borderColor.withOpacity(0.1), width: 2.0)
: null,
borderRadius: BorderRadius.all(Radius.circular(100.0)),
boxShadow: [
@ -191,14 +191,8 @@ class _SecondaryButtonState extends State<SecondaryButton>
height: MediaQuery.of(context).size.width * 2.2,
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: widget.color != null
? null
: LinearGradient(
colors: [
Hexcolor("#45B7AE"),
Hexcolor("#119FA9")
],
),
gradient:
widget.color != null ? null : LINEAR_GRADIENT,
color: widget.color != null
? widget.color
: Hexcolor("#000000"),
@ -226,29 +220,29 @@ class _SecondaryButtonState extends State<SecondaryButton>
children: <Widget>[
widget.loading
? Padding(
padding: EdgeInsets.all(2.6),
child: SizedBox(
height: 19.0,
width: 19.0,
child: CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[300],
),
),
),
)
padding: EdgeInsets.all(2.6),
child: SizedBox(
height: 19.0,
width: 19.0,
child: CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[300],
),
),
),
)
: Padding(
padding: EdgeInsets.only(
bottom: widget.small ? 4.0 : 2.0),
child: Text(widget.label,
style: TextStyle(
color: widget.textColor != null
? widget.textColor
: Colors.white,
fontSize: 17.0,
fontFamily: "WorkSans")),
)
padding: EdgeInsets.only(
bottom: widget.small ? 4.0 : 2.0),
child: Text(widget.label,
style: TextStyle(
color: widget.textColor != null
? widget.textColor
: Colors.white,
fontSize: 17.0,
fontFamily: "WorkSans")),
)
],
)
],

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

@ -1,6 +1,7 @@
import 'package:driverapp/widgets/data_display/circle-container.dart';
import 'package:flutter/material.dart';
import 'package:driverapp/config/size_config.dart';
import 'package:driverapp/widgets/delivery/distance_in_kilometers.dart';
import 'package:flutter/material.dart';
import '../../uitl/date_uitl.dart';
import '../../uitl/translations_delegate_base.dart';
@ -75,14 +76,8 @@ class CustomerBriefCard extends StatelessWidget {
Expanded(
child: Padding(
padding: EdgeInsets.all(8.0),
child: CircleContainer(
child: Text(
'0 K.m\naway',
style: TextStyle(
color: Color(0xff42B6AD),
fontWeight: FontWeight.w800,
fontStyle: FontStyle.normal),
),
child: DistanceInKilometers(
distanceInKilometers: 0.0,
),
),
),

@ -0,0 +1,44 @@
import 'package:driverapp/widgets/data_display/circle-container.dart';
import 'package:flutter/material.dart';
class DistanceInKilometers extends StatelessWidget {
const DistanceInKilometers({
@required this.distanceInKilometers,
Key key,
}) : super(key: key);
final dynamic distanceInKilometers;
@override
Widget build(BuildContext context) {
return CircleContainer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
distanceInKilometers.toString(),
style: TextStyle(
color: Color(0xff42B6AD),
fontWeight: FontWeight.w800,
fontStyle: FontStyle.normal),
),
Text(
'K.m',
style: TextStyle(
color: Color(0xff42B6AD),
fontWeight: FontWeight.w800,
fontStyle: FontStyle.normal),
),
Text(
'away',
style: TextStyle(
color: Color(0xff42B6AD),
fontWeight: FontWeight.w800,
fontStyle: FontStyle.normal),
),
],
),
);
}
}

@ -27,4 +27,4 @@ class packageContent extends StatelessWidget {
],
);
}
}
}

@ -0,0 +1,100 @@
import 'package:driverapp/uitl/utils.dart';
import 'package:driverapp/widgets/delivery/distance_in_kilometers.dart';
import 'package:driverapp/widgets/others/rounded_container.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class OrderInfoCard extends StatelessWidget {
const OrderInfoCard({Key key, this.order, this.onTap}) : super(key: key);
final dynamic order;
final Function onTap;
@override
Widget build(BuildContext context) {
return InkWell(
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: 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,
),
)
],
),
),
Expanded(
flex: 5,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 20.0),
child: Text(
Utils.formatName(
order.firstName + ' ' + order.lastName),
style: TextStyle(
fontSize: 18.0,
color: Hexcolor("#343333"),
fontWeight: FontWeight.bold),
),
),
Text(
order.mobileNumber,
style: TextStyle(
color: Color(0xff30B7B9),
fontWeight: FontWeight.w600,
fontSize: 15.0,
),
),
Expanded(
child: Text(
order.orderID.toString(),
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.w400,
letterSpacing: 8.0),
),
),
],
),
),
Padding(
padding: EdgeInsets.all(8.0),
child: DistanceInKilometers(
distanceInKilometers: order.distanceInKilometers,
),
),
],
),
),
),
onTap: () {
onTap();
},
);
}
}

@ -17,17 +17,17 @@ class AppScaffold extends StatelessWidget {
final Color arrowColor;
final Color appBarColor;
AppScaffold(
{@required this.body,
this.appBarTitle = '',
this.isLoading = false,
this.isShowAppBar = false,
this.baseViewModel,
this.bottomSheet,
this.titleColor,
this.arrowColor,
this.appBarColor,
});
AppScaffold({
@required this.body,
this.appBarTitle = '',
this.isLoading = false,
this.isShowAppBar = false,
this.baseViewModel,
this.bottomSheet,
this.titleColor,
this.arrowColor,
this.appBarColor,
});
@override
Widget build(BuildContext context) {
@ -46,14 +46,16 @@ class AppScaffold extends StatelessWidget {
headline6: TextStyle(
color: titleColor ?? Colors.white,
fontWeight: FontWeight.bold),
),
title: Text(appBarTitle.toUpperCase()),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack(arrowColor: arrowColor,);
},
),
centerTitle: true,
),
title: Text(appBarTitle.toUpperCase()),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack(
arrowColor: arrowColor,
);
},
),
centerTitle: true,
// actions: <Widget>[
// IconButton(
// icon: Icon(FontAwesomeIcons.home),
@ -63,14 +65,15 @@ class AppScaffold extends StatelessWidget {
// },
// ),
// ],
)
)
: null,
body: baseViewModel != null
? NetworkBaseView(
child: buildBodyWidget(),
baseViewModel: baseViewModel,
)
: buildBodyWidget(), bottomSheet: bottomSheet,
child: buildBodyWidget(),
baseViewModel: baseViewModel,
)
: buildBodyWidget(),
bottomSheet: bottomSheet,
),
);
}

Loading…
Cancel
Save