Setting page design update

updates_new
hussam al-habibeh 5 years ago
parent 344e379882
commit 2d34d092e5

@ -57,7 +57,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
AppScaffold( AppScaffold(
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 1.6, height: MediaQuery.of(context).orientation == Orientation.landscape
? MediaQuery.of(context).size.height * 1.6
: MediaQuery.of(context).size.height * 1.0,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Row( Row(

@ -71,7 +71,7 @@ class InformationPage extends StatelessWidget {
), ),
FractionallySizedBox( FractionallySizedBox(
widthFactor: MediaQuery.of(context).orientation == widthFactor: MediaQuery.of(context).orientation ==
Orientation.portrait Orientation.portrait
? 0.9 ? 0.9
: 0.98, : 0.98,
child: Container( child: Container(
@ -168,39 +168,18 @@ class InformationPage extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.only(top: 75.0), padding: const EdgeInsets.only(top: 75.0),
child: Container( child: Container(
width: MediaQuery width: MediaQuery.of(context).size.width * 1.0,
.of(context) height: MediaQuery.of(context).orientation ==
.size
.width * 1.0,
height: MediaQuery
.of(context)
.orientation ==
Orientation.portrait
? MediaQuery
.of(context)
.size
.height * 0.70
: MediaQuery
.of(context)
.size
.height * 1.7,
margin: EdgeInsets.only(
top: MediaQuery
.of(context)
.orientation ==
Orientation.portrait Orientation.portrait
? MediaQuery ? MediaQuery.of(context).size.height * 0.70
.of(context) : MediaQuery.of(context).size.height * 1.7,
.size margin: EdgeInsets.only(
.width * 0.23 top: MediaQuery.of(context).orientation ==
: MediaQuery Orientation.portrait
.of(context) ? MediaQuery.of(context).size.width * 0.23
.size : MediaQuery.of(context).size.width * 0.13),
.width * 0.13),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme color: Theme.of(context).scaffoldBackgroundColor,
.of(context)
.scaffoldBackgroundColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(45), topLeft: Radius.circular(45),
topRight: Radius.circular(45)), topRight: Radius.circular(45)),
@ -209,142 +188,98 @@ class InformationPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: MediaQuery height: MediaQuery.of(context).orientation ==
.of(context) Orientation.portrait
.orientation == ? MediaQuery.of(context).size.height * 0.10
Orientation.portrait : MediaQuery.of(context).size.height * 0.29,
? MediaQuery
.of(context)
.size
.height *
0.10
: MediaQuery
.of(context)
.size
.height *
0.29,
//MediaQuery.of(context).size.width * 0.005, //MediaQuery.of(context).size.width * 0.005,
), ),
Padding( Padding(
padding: MediaQuery padding: MediaQuery.of(context).orientation ==
.of(context) Orientation.portrait
.orientation ==
Orientation.portrait
? EdgeInsets.only(top: 60.0) ? EdgeInsets.only(top: 60.0)
: EdgeInsets.only(top: 15.0), : EdgeInsets.only(top: 15.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
DeliveryInfoButton( DeliveryInfoButton(
btnColor: btnColor: Colors.white, //Color(0xffED1C24),
Colors.white, //Color(0xffED1C24),
btnIcon: Icon(DriverApp.location_1, btnIcon: Icon(DriverApp.location_1,
size: MediaQuery size: MediaQuery.of(context)
.of(context) .orientation ==
.orientation == Orientation.portrait
Orientation.portrait
? 50 ? 50
: 90, : 90,
color: Color(0xffED1C24)), color: Color(0xffED1C24)),
btnName: TranslationBase btnName:
.of(context) TranslationBase.of(context).location,
.location,
btnFunction: () { btnFunction: () {
MapsLauncher.launchCoordinates( MapsLauncher.launchCoordinates(
item.latitude, item.longitude); item.latitude, item.longitude);
}, },
), ),
DeliveryInfoButton( DeliveryInfoButton(
btnColor: btnColor: Colors.white, //Color(0xFF61B260),
Colors.white, //Color(0xFF61B260),
btnIcon: Icon( btnIcon: Icon(
DriverApp.whatsapp, DriverApp.whatsapp,
size: MediaQuery size:
.of(context) MediaQuery.of(context).orientation ==
.orientation == Orientation.portrait
Orientation.portrait ? 50
? 50 : 90,
: 90,
color: Color(0xFF5EA34A), color: Color(0xFF5EA34A),
), ),
btnName: 'Whatsapp', btnName: 'Whatsapp',
btnFunction: () {}, btnFunction: () {},
), ),
DeliveryInfoButton( DeliveryInfoButton(
btnColor: btnColor: Colors.white, //Color(0xFFFCB657),
Colors.white, //Color(0xFFFCB657),
btnIcon: Icon( btnIcon: Icon(
DriverApp.message, DriverApp.message,
size: MediaQuery size:
.of(context) MediaQuery.of(context).orientation ==
.orientation == Orientation.portrait
Orientation.portrait ? 50
? 50 : 90,
: 90,
color: Color(0xffFFA540), color: Color(0xffFFA540),
), ),
btnName: btnName: TranslationBase.of(context).sms,
TranslationBase
.of(context)
.sms,
btnFunction: () {}, btnFunction: () {},
), ),
DeliveryInfoButton( DeliveryInfoButton(
btnColor: Colors btnColor: Colors.white,
.white,
//Theme.of(context).primaryColor, //Theme.of(context).primaryColor,
btnIcon: Icon( btnIcon: Icon(
DriverApp.call, DriverApp.call,
size: MediaQuery size:
.of(context) MediaQuery.of(context).orientation ==
.orientation == Orientation.portrait
Orientation.portrait ? 50
? 50 : 90,
: 90, color: Theme.of(context).primaryColor,
color: Theme
.of(context)
.primaryColor,
), ),
btnName: btnName: TranslationBase.of(context).call,
TranslationBase
.of(context)
.call,
btnFunction: () => btnFunction: () =>
launch( launch("tel://" + item.mobileNumber),
"tel://" + item.mobileNumber),
), ),
], ],
), ),
), ),
SizedBox( SizedBox(
height: height: MediaQuery.of(context).size.width * 0.08,
MediaQuery
.of(context)
.size
.width * 0.08,
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: MediaQuery left: MediaQuery.of(context).size.width * 0.05,
.of(context) right: MediaQuery.of(context).size.width * 0.05,
.size
.width *
0.05,
right: MediaQuery
.of(context)
.size
.width *
0.05,
), ),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: const EdgeInsets.only(left: 8), padding: const EdgeInsets.only(left: 8),
child: Text( child: Text(
TranslationBase TranslationBase.of(context)
.of(context)
.packageContent, .packageContent,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
@ -352,21 +287,15 @@ class InformationPage extends StatelessWidget {
), ),
), ),
SizedBox( SizedBox(
height: height: MediaQuery.of(context).size.width *
MediaQuery
.of(context)
.size
.width *
0.05, 0.05,
), ),
Padding( Padding(
padding: padding: const EdgeInsets.only(left: 10),
const EdgeInsets.only(left: 10),
child: Column( child: Column(
children: List.generate( children: List.generate(
item.itemsQuantitiesList != null item.itemsQuantitiesList != null
? item.itemsQuantitiesList ? item.itemsQuantitiesList.length
.length
: 0, (index) { : 0, (index) {
return packageContent( return packageContent(
packageName: item packageName: item
@ -385,29 +314,21 @@ class InformationPage extends StatelessWidget {
), ),
), ),
SizedBox( SizedBox(
height: height: MediaQuery.of(context).size.width * 0.1,
MediaQuery
.of(context)
.size
.width * 0.1,
), ),
Container( Container(
margin: MediaQuery margin: MediaQuery.of(context).orientation ==
.of(context) Orientation.portrait
.orientation ==
Orientation.portrait
? EdgeInsets.all(8.0) ? EdgeInsets.all(8.0)
: EdgeInsets.symmetric(horizontal: 12.0), : EdgeInsets.symmetric(horizontal: 12.0),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase label:
.of(context) TranslationBase.of(context).clientReached,
.clientReached,
onTap: () { onTap: () {
showDeliveryOptions(model); showDeliveryOptions(model);
}, },
), ),
), ),
], ],
), ),
), ),
@ -421,6 +342,7 @@ class InformationPage extends StatelessWidget {
deliveryTime: item.orderCreatedOn, deliveryTime: item.orderCreatedOn,
longitude: item.longitude, longitude: item.longitude,
latitude: item.latitude, latitude: item.latitude,
distanceInKilometers: item.distanceInKilometers,
), ),
], ],
), ),
@ -437,19 +359,13 @@ class InformationPage extends StatelessWidget {
this._orderStatus = orderStatus; this._orderStatus = orderStatus;
switch (orderStatus) { switch (orderStatus) {
case 3: case 3:
orderStatusText = TranslationBase orderStatusText = TranslationBase.of(context).delivered;
.of(context)
.delivered;
break; break;
case 4: case 4:
orderStatusText = TranslationBase orderStatusText = TranslationBase.of(context).deliveredAccepted;
.of(context)
.deliveredAccepted;
break; break;
case 5: case 5:
orderStatusText = TranslationBase orderStatusText = TranslationBase.of(context).deliveredRejected;
.of(context)
.deliveredRejected;
break; break;
case 6: case 6:
orderStatusText = TranslationBase.of(context).canceled; orderStatusText = TranslationBase.of(context).canceled;
@ -470,11 +386,11 @@ class InformationPage extends StatelessWidget {
updateOrderStatus(BuildContext context, OrdersViewModel model) async { updateOrderStatus(BuildContext context, OrdersViewModel model) async {
UpdateOrderStatusRequestModel updateOrderStatusRequestModel = UpdateOrderStatusRequestModel updateOrderStatusRequestModel =
UpdateOrderStatusRequestModel( UpdateOrderStatusRequestModel(
deliveryOrderID: item.orderID, deliveryOrderID: item.orderID,
deliveryOrderStatus: _orderStatus, deliveryOrderStatus: _orderStatus,
rejectionReason: "NO Reason", rejectionReason: "NO Reason",
cancleReason: ""); cancleReason: "");
await model.updateOrderStatus(updateOrderStatusRequestModel); await model.updateOrderStatus(updateOrderStatusRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);

@ -23,13 +23,16 @@ class SettingPage extends StatelessWidget {
appBarColor: Color(0xFF1DA4AA), appBarColor: Color(0xFF1DA4AA),
arrowColor: Colors.white, arrowColor: Colors.white,
titleColor: Colors.white, titleColor: Colors.white,
isAppBarGradient: true,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment(0.0,0.0), // 10% of the width, so there are ten blinds.
end: Alignment(-1.5, 0.0), // 10% of the width, so there are ten blinds. colors: [
colors: [const Color(0xFF1DA4AA), const Color(0xFF3EB4AD)],//[const Color(0xff30B7B9), const Color(0xff3AB2AD)], // whitish to gray const Color(0xff45B7AE),
const Color(0xff119FA9)
], //[const Color(0xff30B7B9), const Color(0xff3AB2AD)], // whitish to gray
tileMode: TileMode.clamp, // repeats the gradient over the canvas tileMode: TileMode.clamp, // repeats the gradient over the canvas
), ),
), ),
@ -50,38 +53,40 @@ class SettingPage extends StatelessWidget {
maxRadius: 200.0, maxRadius: 200.0,
child: Image.asset( child: Image.asset(
'assets/images/driver.png', 'assets/images/driver.png',
height: MediaQuery.of(context).size.width * 1 , height: MediaQuery.of(context).size.width * 1,
width: MediaQuery.of(context).size.width * 1, width: MediaQuery.of(context).size.width * 1,
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
), ),
), ),
SizedBox(height: MediaQuery.of(context).size.width *0.05,), SizedBox(
height: MediaQuery.of(context).size.width * 0.05,
),
Container( Container(
child: Text( child: Text(
driverName, driverName,
style: TextStyle( style: TextStyle(
fontSize: 40, fontSize: 40,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.white color: Colors.white),
),
), ),
), ),
SizedBox(height: MediaQuery.of(context).size.width *0.05,), SizedBox(
height: MediaQuery.of(context).size.width * 0.05,
),
Container( Container(
child: Text( child: Text(
'ID: ${driverID.toString()}', 'ID: ${driverID.toString()}',
style: TextStyle( style: TextStyle(fontSize: 20, color: Colors.white),
fontSize: 20,
color: Colors.white
),
), ),
), ),
], ],
), ),
), ),
SizedBox(height: MediaQuery.of(context).size.width *0.1,), SizedBox(
height: MediaQuery.of(context).size.width * 0.1,
),
Container( Container(
margin: EdgeInsets.only(left: 35), margin: EdgeInsets.only(left: 35),
child: Column( child: Column(
@ -107,23 +112,26 @@ class SettingPage extends StatelessWidget {
size: 40, size: 40,
color: Colors.white, color: Colors.white,
), ),
SizedBox(width: MediaQuery.of(context).size.width *0.05,), SizedBox(
width:
MediaQuery.of(context).size.width * 0.05,
),
Text( Text(
TranslationBase.of(context).logout, TranslationBase.of(context).logout,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.white, color: Colors.white,
fontSize: 18 fontSize: 18),
),
), ),
], ],
), ),
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.width *0.05, height: MediaQuery.of(context).size.width * 0.05,
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsetsDirectional.only(start: 0, end: 30), margin: EdgeInsetsDirectional.only(
start: 0, end: 30),
height: 1.0, height: 1.0,
color: Colors.white, color: Colors.white,
), ),
@ -132,7 +140,9 @@ class SettingPage extends StatelessWidget {
], ],
), ),
), ),
SizedBox(height: MediaQuery.of(context).size.width*0.05,), SizedBox(
height: MediaQuery.of(context).size.width * 0.05,
),
InkWell( InkWell(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -147,15 +157,15 @@ class SettingPage extends StatelessWidget {
color: Colors.white, color: Colors.white,
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.05, width:
MediaQuery.of(context).size.width * 0.05,
), ),
Text( Text(
TranslationBase.of(context).languageText, TranslationBase.of(context).languageText,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.white, color: Colors.white,
fontSize: 18 fontSize: 18),
),
), ),
], ],
), ),
@ -164,13 +174,16 @@ class SettingPage extends StatelessWidget {
height: 10.0, height: 10.0,
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsetsDirectional.only(start: 0, end: 30), margin: EdgeInsetsDirectional.only(
start: 0, end: 30),
height: 1.0, height: 1.0,
color: Colors.white, color: Colors.white,
), ),
), ),
), ),
SizedBox(height: MediaQuery.of(context).size.width*0.05,), SizedBox(
height: MediaQuery.of(context).size.width * 0.05,
),
], ],
), ),
), ),
@ -188,15 +201,15 @@ class SettingPage extends StatelessWidget {
color: Colors.white, color: Colors.white,
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.05, width:
MediaQuery.of(context).size.width * 0.05,
), ),
Text( Text(
TranslationBase.of(context).settings, TranslationBase.of(context).settings,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.white, color: Colors.white,
fontSize: 18 fontSize: 18),
),
), ),
], ],
), ),
@ -205,13 +218,16 @@ class SettingPage extends StatelessWidget {
height: 10.0, height: 10.0,
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsetsDirectional.only(start: 0, end: 30), margin: EdgeInsetsDirectional.only(
start: 0, end: 30),
height: 1.0, height: 1.0,
color: Colors.white, color: Colors.white,
), ),
), ),
), ),
SizedBox(height: MediaQuery.of(context).size.width*0.05,), SizedBox(
height: MediaQuery.of(context).size.width * 0.05,
),
], ],
), ),
), ),
@ -229,15 +245,15 @@ class SettingPage extends StatelessWidget {
color: Colors.white, color: Colors.white,
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.05, width:
MediaQuery.of(context).size.width * 0.05,
), ),
Text( Text(
TranslationBase.of(context).notification, TranslationBase.of(context).notification,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.white, color: Colors.white,
fontSize: 18 fontSize: 18),
),
), ),
], ],
), ),
@ -246,13 +262,16 @@ class SettingPage extends StatelessWidget {
height: 10.0, height: 10.0,
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsetsDirectional.only(start: 0, end: 30), margin: EdgeInsetsDirectional.only(
start: 0, end: 30),
height: 1.0, height: 1.0,
color: Colors.white, color: Colors.white,
), ),
), ),
), ),
SizedBox(height: MediaQuery.of(context).size.width*0.05,), SizedBox(
height: MediaQuery.of(context).size.width * 0.05,
),
], ],
), ),
), ),

Loading…
Cancel
Save