diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index 36e0691..7088983 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -57,7 +57,9 @@ class _DashboardScreenState extends State { AppScaffold( body: SingleChildScrollView( 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( children: [ Row( diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/information_page.dart index 8555647..99d2837 100644 --- a/lib/pages/delivery/information_page.dart +++ b/lib/pages/delivery/information_page.dart @@ -71,7 +71,7 @@ class InformationPage extends StatelessWidget { ), FractionallySizedBox( widthFactor: MediaQuery.of(context).orientation == - Orientation.portrait + Orientation.portrait ? 0.9 : 0.98, child: Container( @@ -168,39 +168,18 @@ class InformationPage extends StatelessWidget { Padding( padding: const EdgeInsets.only(top: 75.0), child: Container( - width: MediaQuery - .of(context) - .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 == + width: MediaQuery.of(context).size.width * 1.0, + height: MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery - .of(context) - .size - .width * 0.23 - : MediaQuery - .of(context) - .size - .width * 0.13), + ? MediaQuery.of(context).size.height * 0.70 + : MediaQuery.of(context).size.height * 1.7, + margin: EdgeInsets.only( + top: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.width * 0.23 + : MediaQuery.of(context).size.width * 0.13), decoration: BoxDecoration( - color: Theme - .of(context) - .scaffoldBackgroundColor, + color: Theme.of(context).scaffoldBackgroundColor, borderRadius: BorderRadius.only( topLeft: Radius.circular(45), topRight: Radius.circular(45)), @@ -209,142 +188,98 @@ class InformationPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ SizedBox( - height: MediaQuery - .of(context) - .orientation == - Orientation.portrait - ? MediaQuery - .of(context) - .size - .height * - 0.10 - : MediaQuery - .of(context) - .size - .height * - 0.29, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.10 + : MediaQuery.of(context).size.height * 0.29, //MediaQuery.of(context).size.width * 0.005, ), Padding( - padding: MediaQuery - .of(context) - .orientation == - Orientation.portrait + padding: MediaQuery.of(context).orientation == + Orientation.portrait ? EdgeInsets.only(top: 60.0) : EdgeInsets.only(top: 15.0), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ DeliveryInfoButton( - btnColor: - Colors.white, //Color(0xffED1C24), + btnColor: Colors.white, //Color(0xffED1C24), btnIcon: Icon(DriverApp.location_1, - size: MediaQuery - .of(context) - .orientation == - Orientation.portrait + size: MediaQuery.of(context) + .orientation == + Orientation.portrait ? 50 : 90, color: Color(0xffED1C24)), - btnName: TranslationBase - .of(context) - .location, + btnName: + TranslationBase.of(context).location, btnFunction: () { MapsLauncher.launchCoordinates( item.latitude, item.longitude); }, ), DeliveryInfoButton( - btnColor: - Colors.white, //Color(0xFF61B260), + btnColor: Colors.white, //Color(0xFF61B260), btnIcon: Icon( DriverApp.whatsapp, - size: MediaQuery - .of(context) - .orientation == - Orientation.portrait - ? 50 - : 90, + size: + MediaQuery.of(context).orientation == + Orientation.portrait + ? 50 + : 90, color: Color(0xFF5EA34A), ), btnName: 'Whatsapp', btnFunction: () {}, ), DeliveryInfoButton( - btnColor: - Colors.white, //Color(0xFFFCB657), + btnColor: Colors.white, //Color(0xFFFCB657), btnIcon: Icon( DriverApp.message, - size: MediaQuery - .of(context) - .orientation == - Orientation.portrait - ? 50 - : 90, + size: + MediaQuery.of(context).orientation == + Orientation.portrait + ? 50 + : 90, color: Color(0xffFFA540), ), - btnName: - TranslationBase - .of(context) - .sms, + btnName: TranslationBase.of(context).sms, btnFunction: () {}, ), DeliveryInfoButton( - btnColor: Colors - .white, + btnColor: Colors.white, //Theme.of(context).primaryColor, btnIcon: Icon( DriverApp.call, - size: MediaQuery - .of(context) - .orientation == - Orientation.portrait - ? 50 - : 90, - color: Theme - .of(context) - .primaryColor, + size: + MediaQuery.of(context).orientation == + Orientation.portrait + ? 50 + : 90, + color: Theme.of(context).primaryColor, ), - btnName: - TranslationBase - .of(context) - .call, + btnName: TranslationBase.of(context).call, btnFunction: () => - launch( - "tel://" + item.mobileNumber), + launch("tel://" + item.mobileNumber), ), ], ), ), SizedBox( - height: - MediaQuery - .of(context) - .size - .width * 0.08, + height: MediaQuery.of(context).size.width * 0.08, ), Container( margin: EdgeInsets.only( - left: MediaQuery - .of(context) - .size - .width * - 0.05, - right: MediaQuery - .of(context) - .size - .width * - 0.05, + left: MediaQuery.of(context).size.width * 0.05, + right: MediaQuery.of(context).size.width * 0.05, ), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.only(left: 8), child: Text( - TranslationBase - .of(context) + TranslationBase.of(context) .packageContent, style: TextStyle( fontWeight: FontWeight.w900, @@ -352,21 +287,15 @@ class InformationPage extends StatelessWidget { ), ), SizedBox( - height: - MediaQuery - .of(context) - .size - .width * + height: MediaQuery.of(context).size.width * 0.05, ), Padding( - padding: - const EdgeInsets.only(left: 10), + padding: const EdgeInsets.only(left: 10), child: Column( children: List.generate( item.itemsQuantitiesList != null - ? item.itemsQuantitiesList - .length + ? item.itemsQuantitiesList.length : 0, (index) { return packageContent( packageName: item @@ -385,29 +314,21 @@ class InformationPage extends StatelessWidget { ), ), SizedBox( - height: - MediaQuery - .of(context) - .size - .width * 0.1, + height: MediaQuery.of(context).size.width * 0.1, ), Container( - margin: MediaQuery - .of(context) - .orientation == - Orientation.portrait + margin: MediaQuery.of(context).orientation == + Orientation.portrait ? EdgeInsets.all(8.0) : EdgeInsets.symmetric(horizontal: 12.0), child: SecondaryButton( - label: TranslationBase - .of(context) - .clientReached, + label: + TranslationBase.of(context).clientReached, onTap: () { showDeliveryOptions(model); }, ), ), - ], ), ), @@ -421,6 +342,7 @@ class InformationPage extends StatelessWidget { deliveryTime: item.orderCreatedOn, longitude: item.longitude, latitude: item.latitude, + distanceInKilometers: item.distanceInKilometers, ), ], ), @@ -437,19 +359,13 @@ class InformationPage extends StatelessWidget { this._orderStatus = orderStatus; switch (orderStatus) { case 3: - orderStatusText = TranslationBase - .of(context) - .delivered; + orderStatusText = TranslationBase.of(context).delivered; break; case 4: - orderStatusText = TranslationBase - .of(context) - .deliveredAccepted; + orderStatusText = TranslationBase.of(context).deliveredAccepted; break; case 5: - orderStatusText = TranslationBase - .of(context) - .deliveredRejected; + orderStatusText = TranslationBase.of(context).deliveredRejected; break; case 6: orderStatusText = TranslationBase.of(context).canceled; @@ -470,11 +386,11 @@ class InformationPage extends StatelessWidget { updateOrderStatus(BuildContext context, OrdersViewModel model) async { UpdateOrderStatusRequestModel updateOrderStatusRequestModel = - UpdateOrderStatusRequestModel( - deliveryOrderID: item.orderID, - deliveryOrderStatus: _orderStatus, - rejectionReason: "NO Reason", - cancleReason: ""); + UpdateOrderStatusRequestModel( + deliveryOrderID: item.orderID, + deliveryOrderStatus: _orderStatus, + rejectionReason: "NO Reason", + cancleReason: ""); await model.updateOrderStatus(updateOrderStatusRequestModel); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); diff --git a/lib/pages/setting/setting_page.dart b/lib/pages/setting/setting_page.dart index 360aedf..860db75 100644 --- a/lib/pages/setting/setting_page.dart +++ b/lib/pages/setting/setting_page.dart @@ -23,13 +23,16 @@ class SettingPage extends StatelessWidget { appBarColor: Color(0xFF1DA4AA), arrowColor: Colors.white, titleColor: Colors.white, + isAppBarGradient: true, body: SingleChildScrollView( child: Container( decoration: BoxDecoration( gradient: LinearGradient( - begin: Alignment(0.0,0.0), - end: Alignment(-1.5, 0.0), // 10% of the width, so there are ten blinds. - colors: [const Color(0xFF1DA4AA), const Color(0xFF3EB4AD)],//[const Color(0xff30B7B9), const Color(0xff3AB2AD)], // whitish to gray + // 10% of the width, so there are ten blinds. + colors: [ + const Color(0xff45B7AE), + const Color(0xff119FA9) + ], //[const Color(0xff30B7B9), const Color(0xff3AB2AD)], // whitish to gray tileMode: TileMode.clamp, // repeats the gradient over the canvas ), ), @@ -50,38 +53,40 @@ class SettingPage extends StatelessWidget { maxRadius: 200.0, child: Image.asset( '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, fit: BoxFit.contain, ), ), ), ), - SizedBox(height: MediaQuery.of(context).size.width *0.05,), + SizedBox( + height: MediaQuery.of(context).size.width * 0.05, + ), Container( child: Text( driverName, style: TextStyle( fontSize: 40, 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( child: Text( 'ID: ${driverID.toString()}', - style: TextStyle( - fontSize: 20, - color: Colors.white - ), + style: TextStyle(fontSize: 20, color: Colors.white), ), ), ], ), ), - SizedBox(height: MediaQuery.of(context).size.width *0.1,), + SizedBox( + height: MediaQuery.of(context).size.width * 0.1, + ), Container( margin: EdgeInsets.only(left: 35), child: Column( @@ -107,23 +112,26 @@ class SettingPage extends StatelessWidget { size: 40, color: Colors.white, ), - SizedBox(width: MediaQuery.of(context).size.width *0.05,), + SizedBox( + width: + MediaQuery.of(context).size.width * 0.05, + ), Text( TranslationBase.of(context).logout, style: TextStyle( fontWeight: FontWeight.w500, color: Colors.white, - fontSize: 18 - ), + fontSize: 18), ), ], ), ), SizedBox( - height: MediaQuery.of(context).size.width *0.05, + height: MediaQuery.of(context).size.width * 0.05, child: Center( child: Container( - margin: EdgeInsetsDirectional.only(start: 0, end: 30), + margin: EdgeInsetsDirectional.only( + start: 0, end: 30), height: 1.0, 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( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -147,15 +157,15 @@ class SettingPage extends StatelessWidget { color: Colors.white, ), SizedBox( - width: MediaQuery.of(context).size.width * 0.05, + width: + MediaQuery.of(context).size.width * 0.05, ), Text( TranslationBase.of(context).languageText, style: TextStyle( fontWeight: FontWeight.w500, color: Colors.white, - fontSize: 18 - ), + fontSize: 18), ), ], ), @@ -164,13 +174,16 @@ class SettingPage extends StatelessWidget { height: 10.0, child: Center( child: Container( - margin: EdgeInsetsDirectional.only(start: 0, end: 30), + margin: EdgeInsetsDirectional.only( + start: 0, end: 30), height: 1.0, 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, ), SizedBox( - width: MediaQuery.of(context).size.width * 0.05, + width: + MediaQuery.of(context).size.width * 0.05, ), Text( TranslationBase.of(context).settings, style: TextStyle( fontWeight: FontWeight.w500, color: Colors.white, - fontSize: 18 - ), + fontSize: 18), ), ], ), @@ -205,13 +218,16 @@ class SettingPage extends StatelessWidget { height: 10.0, child: Center( child: Container( - margin: EdgeInsetsDirectional.only(start: 0, end: 30), + margin: EdgeInsetsDirectional.only( + start: 0, end: 30), height: 1.0, 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, ), SizedBox( - width: MediaQuery.of(context).size.width * 0.05, + width: + MediaQuery.of(context).size.width * 0.05, ), Text( TranslationBase.of(context).notification, style: TextStyle( fontWeight: FontWeight.w500, color: Colors.white, - fontSize: 18 - ), + fontSize: 18), ), ], ), @@ -246,13 +262,16 @@ class SettingPage extends StatelessWidget { height: 10.0, child: Center( child: Container( - margin: EdgeInsetsDirectional.only(start: 0, end: 30), + margin: EdgeInsetsDirectional.only( + start: 0, end: 30), height: 1.0, color: Colors.white, ), ), ), - SizedBox(height: MediaQuery.of(context).size.width*0.05,), + SizedBox( + height: MediaQuery.of(context).size.width * 0.05, + ), ], ), ), @@ -265,4 +284,4 @@ class SettingPage extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/pages/splash_screen_page.dart b/lib/pages/splash_screen_page.dart index 11131da..f094e0c 100644 --- a/lib/pages/splash_screen_page.dart +++ b/lib/pages/splash_screen_page.dart @@ -34,9 +34,13 @@ class _SplashScreenPageState extends State { body: Container( decoration: BoxDecoration( gradient: LinearGradient( - begin: Alignment(1.0,0.0), - end: Alignment(-0.0, 0.0), // 10% of the width, so there are ten blinds. - colors: [const Color(0xFF1BB0B8), const Color(0xFF44BFBB)],//[const Color(0xff30B7B9), const Color(0xff3AB2AD)], // whitish to gray + begin: Alignment(1.0, 0.0), + end: Alignment( + -0.0, 0.0), // 10% of the width, so there are ten blinds. + colors: [ + const Color(0xFF1BB0B8), + const Color(0xFF44BFBB) + ], //[const Color(0xff30B7B9), const Color(0xff3AB2AD)], // whitish to gray tileMode: TileMode.clamp, // repeats the gradient over the canvas ), ), @@ -45,19 +49,25 @@ class _SplashScreenPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ FractionallySizedBox( - widthFactor: 0.80, + widthFactor: 0.89, child: Column( children: [ SizedBox( - height: 200, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? 200 + : 50, ), Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( child: Icon( DriverApp.logo, - size: 120, + size: MediaQuery.of(context).orientation == + Orientation.portrait + ? 120 + : 70, color: Colors.white, ), margin: EdgeInsets.only( @@ -65,42 +75,64 @@ class _SplashScreenPageState extends State { ? 0 : MediaQuery.of(context).size.width * 0.20, left: !projectViewModel.isArabic - ? 0 + ? MediaQuery.of(context).orientation == + Orientation.landscape + ? MediaQuery.of(context).size.width * 0.13 + : MediaQuery.of(context).size.width * 0.0 : MediaQuery.of(context).size.width * 0.10), ), ], ), SizedBox( - height: 20, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? 20 + : 15, ), Column( children: [ Text( "Driver", style: TextStyle( - fontSize: 70, + fontSize: MediaQuery.of(context).orientation == + Orientation.portrait + ? 70 + : 35, fontWeight: FontWeight.bold, color: Colors.white), ), Text( "Delivery", style: TextStyle( - fontSize: 50, + fontSize: MediaQuery.of(context).orientation == + Orientation.portrait + ? 50 + : 25, letterSpacing: 1, color: Colors.white), ), Text( "APP", style: TextStyle( - fontSize: 53, - letterSpacing: 53, + fontSize: MediaQuery.of(context).orientation == + Orientation.portrait + ? 53 + : 21, + letterSpacing: + MediaQuery.of(context).orientation == + Orientation.portrait + ? 53 + : 27, color: Colors.white, fontWeight: FontWeight.w400), ), ], ), SizedBox( - height: 100, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? 100 + : 50, ) ], ), @@ -129,7 +161,10 @@ class _SplashScreenPageState extends State { ), ), SizedBox( - height: 10, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? 10 + : 5, ) ], ),