diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index dd7be69..2f73b5c 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -242,6 +242,7 @@ "${BUILT_PRODUCTS_DIR}/image_cropper/image_cropper.framework", "${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework", "${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework", + "${BUILT_PRODUCTS_DIR}/map_launcher/map_launcher.framework", "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework", "${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework", "${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework", @@ -263,6 +264,7 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_cropper.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/map_launcher.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework", diff --git a/lib/app-icons/config.json b/lib/app-icons/config.json index 331f146..dd751e6 100644 --- a/lib/app-icons/config.json +++ b/lib/app-icons/config.json @@ -89,6 +89,90 @@ "search": [ "qr" ] + }, + { + "uid": "35b36156ab3a35397939eacfb39a7ac4", + "css": "deliverd_icon", + "code": 59410, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M767.9 851L679.4 574.4A176.3 176.3 0 0 0 510.7 451.1H467.2V431.6A178.1 178.1 0 0 0 504.4 405.9 16.1 16.1 0 0 0 483.7 382.1 145.2 145.2 0 0 1 241.6 273.8V244.6A101.2 101.2 0 0 0 273.8 256.3C289.9 258.8 486 258.1 494.6 256.3 540.8 251.4 531.6 225.5 531.6 273.8A145.2 145.2 0 0 1 517.8 336.1 16.1 16.1 0 0 0 546.8 349.9 172.4 172.4 0 0 0 560.9 304.7 64.3 64.3 0 0 0 612.3 241.6 70.1 70.1 0 0 0 580.1 169.6 161.1 161.1 0 0 0 427.9 0.1Q423.6 0.1 419.2 0.1A299.9 299.9 0 0 0 292.4 12.7 16.1 16.1 0 0 0 305 42.3 270.1 270.1 0 0 1 419.2 32.4 128.8 128.8 0 0 1 547.1 145.1H226.8A127.7 127.7 0 0 1 259 75.9 16.1 16.1 0 0 0 235.2 54.3 159.1 159.1 0 0 0 193.7 169.9 70.1 70.1 0 0 0 161.4 241.9 64.5 64.5 0 0 0 212.5 304.9 177.5 177.5 0 0 0 306.5 431.9V451.4H263A176.2 176.2 0 0 0 94.3 574.6L88.6 592.3A16.1 16.1 0 0 0 119.2 602L124.9 584.2A145.2 145.2 0 0 1 263.2 483.5H313.5A80.6 80.6 0 0 0 461.1 483.5H511.4A145.2 145.2 0 0 1 649.7 584.2L738.2 860.9A80.6 80.6 0 0 1 687.4 962.9 90.4 90.4 0 0 1 677.6 965.5V870.5A96.8 96.8 0 0 0 597 775.3V741.7A16.1 16.1 0 0 0 564.8 741.7V886.9H210.3V580.8H323.1V661.4A16.1 16.1 0 0 0 339.3 677.5H436.1A16.1 16.1 0 0 0 452.2 661.4V580.8H564.9V677.6A16.1 16.1 0 0 0 597.2 677.6V564.8A16.1 16.1 0 0 0 581.1 548.7H194.4A16.2 16.2 0 0 0 178.2 564.8V775.8A96.8 96.8 0 0 0 97.7 870.9V965.9A81.5 81.5 0 0 1 35.1 869.1 77.1 77.1 0 0 1 37.1 861.3L78.6 730.6A16.1 16.1 0 0 0 48 721L6.5 851.6A113.8 113.8 0 0 0 80.4 994.5 111.6 111.6 0 0 0 113.8 999.9 1596.8 1596.8 0 0 0 274.9 998.4 96.8 96.8 0 0 0 353.7 920.3C353.7 918.7 349.6 919.3 421.1 919.3A96.8 96.8 0 0 0 453.3 975.9C489.2 1007.5 519.5 999.9 661.6 999.9A113.6 113.6 0 0 0 769 851.6ZM289.9 225.8A64.3 64.3 0 0 1 227.7 177.4C579.9 177.4 547.7 174.5 543.2 184.3 522.8 237.5 494.4 225.8 289.9 225.8ZM580 241.9A32.2 32.2 0 0 1 563.8 269.6C563.8 199.2 562.1 221.2 570.8 202.7A48.4 48.4 0 0 1 580 241.9ZM193.2 225.8A32.5 32.5 0 0 1 202.6 202.9C211.2 220.8 209.5 199.1 209.5 269.8 191.5 259.4 193.2 243.5 193.2 225.8ZM378.5 499.7A48.4 48.4 0 0 1 338.3 451.3V444.4A180.7 180.7 0 0 0 435.1 444.4V451.3A48.4 48.4 0 0 1 387.5 500.3 46.8 46.8 0 0 1 378.5 499.7ZM418.9 580.3V644.8H354.4V580.3ZM128.8 967V870.2A64.5 64.5 0 0 1 177.2 807.9V902.5A16.1 16.1 0 0 0 193.3 918.6H320A63.3 63.3 0 0 1 285.4 960.6C266.9 969.2 267 966.9 128.8 966.9ZM515.5 967A64.4 64.4 0 0 1 453.2 918.6H579.9A16.1 16.1 0 0 0 596 902.5V807.9A64.4 64.4 0 0 1 644.4 870.2V967Z", + "width": 773 + }, + "search": [ + "deliverd_icon" + ] + }, + { + "uid": "a5cfbb0e777b9764b5bef5a0694db0d4", + "css": "not_available", + "code": 59402, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M870.8 714.4A19.5 19.5 0 0 0 852.4 701.3 20.8 20.8 0 0 0 846 702.3 19.8 19.8 0 0 0 834.7 712.4 19.5 19.5 0 0 0 833.9 727.2H833.9A175.4 175.4 0 1 1 725.8 619.1 19 19 0 0 0 732.3 620.2 19.5 19.5 0 0 0 738.7 582.3 213.2 213.2 0 0 0 558 600.5L473.3 576.6 469.8 537.9A185.2 185.2 0 0 0 564.3 404.1 148.6 148.6 0 0 0 654.3 280.4 142.3 142.3 0 0 0 573.4 161.5 195.5 195.5 0 0 0 188.2 161.5 142.2 142.2 0 0 0 107.4 280.4 148.6 148.6 0 0 0 197.4 404.1 185.1 185.1 0 0 0 291.9 537.9L288.4 576.6 155.1 614.2A214.8 214.8 0 0 0 0 820.6V980.5A19.5 19.5 0 0 0 19.5 1000H742.2A19.5 19.5 0 0 0 761.6 980.5V978.5A215 215 0 0 0 870.8 714.4ZM615.2 280.3A97.5 97.5 0 0 1 567.8 355.8L575.3 210.7A93.2 93.2 0 0 1 614.9 280.3ZM267 88.1A156 156 0 0 1 536.8 203.7L535.7 224A351.4 351.4 0 0 1 417.2 159.2 19.6 19.6 0 0 0 391.4 159.2 372.8 372.8 0 0 1 226.8 241L224.8 203.8A153.4 153.4 0 0 1 267 88.3ZM146.5 280.3A93 93 0 0 1 186.1 210.7L193.6 355.8A97.7 97.7 0 0 1 146.5 280.3ZM234.4 384.3L228.9 280.3A416.1 416.1 0 0 0 404.4 199.3 376.7 376.7 0 0 0 533.6 264.1L527.2 384A146.7 146.7 0 0 1 234.4 384ZM380.8 560.9A187.5 187.5 0 0 0 431.9 553.4L434.8 584.6 380.8 639.2 326.9 584.6 329.7 553.4A187.5 187.5 0 0 0 380.8 560.9ZM39 820.9A176.5 176.5 0 0 1 165.8 652.2L300.8 614.1 366.9 680.9A19.5 19.5 0 0 0 394.7 680.9L460.8 614.1 519.2 630.6 516 633.6A214.8 214.8 0 0 0 516 937.4 217.8 217.8 0 0 0 544.4 961.3H200.2V830.4A19.5 19.5 0 1 0 161.1 830.4V961.3H39ZM406.3 453.5A19.5 19.5 0 1 0 433.4 425.4 76.4 76.4 0 0 0 328.2 425.4 19.5 19.5 0 1 0 355.3 453.5 37.2 37.2 0 0 1 406.3 453.5ZM740.3 712.7A19.5 19.5 0 0 0 712.7 712.7L668.1 757.3 623.5 712.7A19.5 19.5 0 1 0 595.9 740.4L640.4 785 595.9 829.5A19.5 19.5 0 0 0 623.5 857.2L668.1 812.6 712.7 857.2A19.7 19.7 0 0 0 726.5 862.9 19.5 19.5 0 0 0 740.3 829.5L695.7 785 740.3 740.4A19.5 19.5 0 0 0 740.3 712.7Z", + "width": 883 + }, + "search": [ + "not_available" + ] + }, + { + "uid": "57ec1e1b8ff3e469eb0b90d2ccf9a26e", + "css": "rejected_icon", + "code": 59403, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M628.1 683.9C628.1 591.2 628.1 293.6 628.1 290.7A74 74 0 0 0 554.8 214.7H554.8A75.5 75.5 0 0 0 511 228.7V160.9A75.8 75.8 0 0 0 489.4 107.3 74.5 74.5 0 0 0 436.2 84.9H436.2A74.8 74.8 0 0 0 392.8 98.7V76A75.7 75.7 0 0 0 317.4 0H317.4A76.2 76.2 0 0 0 241.1 75.5V97.8A74.8 74.8 0 0 0 197.9 83.9H197.9A76.3 76.3 0 0 0 121.2 159.3V327A75.5 75.5 0 0 0 77.6 312.9H77.6A75.9 75.9 0 0 0 1.9 388.4C1.9 390.5 2.3 597.4 1.9 685.8A15.3 15.3 0 0 0 1.9 688.5 315.2 315.2 0 0 0 317.4 1000 311.9 311.9 0 0 0 630.2 687.2 15.3 15.3 0 0 0 630.2 683.9ZM435.4 116.7A42.8 42.8 0 0 1 466 129.6 44.1 44.1 0 0 1 478.4 160.8V481.9L391.8 481.9V160.6A43.7 43.7 0 0 1 435.4 117ZM315.8 968.1A283.2 283.2 0 0 1 32.2 685.9 13.6 13.6 0 0 0 32.2 683.3C32.2 593.7 32.2 390.1 32.2 388.5A43.8 43.8 0 0 1 119.8 388.5V635A16.3 16.3 0 0 0 136.1 651.2 162.9 162.9 0 0 1 252.8 700.1 166.9 166.9 0 0 1 300.5 818.2 16.3 16.3 0 1 0 332.4 818.2 198.4 198.4 0 0 0 275.4 677.7 194.8 194.8 0 0 0 151.8 619.6V159.4A45 45 0 0 1 196.9 115.8 43.7 43.7 0 0 1 240.2 159.3V369.4A16.3 16.3 0 0 0 272.1 369.4V75.5A44.2 44.2 0 0 1 316.7 31.9 43.8 43.8 0 0 1 360.3 75.9V481.6L272.1 481.6V433.6A16.3 16.3 0 0 0 240.2 433.6V481.5H223.9A16.3 16.3 0 1 0 223.9 513.4L492.7 514.3H526.3A16.3 16.3 0 1 0 526.3 482.4H510V290.5A43.9 43.9 0 0 1 554.1 246.9 42.4 42.4 0 0 1 595.9 290.9C595.9 294 596.3 599.1 595.9 687.5A15.5 15.5 0 0 0 596.3 690.9 281.2 281.2 0 0 1 315.4 968.4Z", + "width": 629 + }, + "search": [ + "rejected_icon" + ] + }, + { + "uid": "14ccb0e941366cbce2cec8923259cc6c", + "css": "not_reachable_icon", + "code": 59404, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M597.6 421.8A19.5 19.5 0 1 1 578.1 402.3 19.5 19.5 0 0 1 597.6 421.8ZM5.8 994.2A19.4 19.4 0 0 0 33.4 994.2L328.6 698.9A1100.6 1100.6 0 0 0 644.1 913.3 193.3 193.3 0 0 0 859.1 871.7L943.6 787.3A19.6 19.6 0 0 0 943.6 759.6L736.5 552.5A19.6 19.6 0 0 0 708.9 552.5L616.9 644.4A38.5 38.5 0 0 1 569.5 650.6 722.3 722.3 0 0 1 461.6 566.4L530.4 497.6A19.5 19.5 0 0 0 502.8 470L434 538.8A730 730 0 0 1 348 429.4 38.3 38.3 0 0 1 354.3 381.9L446.1 290.1A19.5 19.5 0 0 0 446.1 262.5L239 55.3A19.6 19.6 0 0 0 211.3 55.3L127.9 138.8A194.8 194.8 0 0 0 87.9 357.2 1151.5 1151.5 0 0 0 301.2 671.2L5.8 966.6A19.5 19.5 0 0 0 5.8 994.2ZM548.2 683.6A77.4 77.4 0 0 0 644.2 672L722.3 593.9 901.8 773.4 831.1 844.1A154.1 154.1 0 0 1 660.2 877.7 1059.5 1059.5 0 0 1 356.3 671.4L433.7 594A761.7 761.7 0 0 0 548.2 683.6ZM123.4 340.8A155.5 155.5 0 0 1 155.5 166.4L225.2 96.7 404.6 276.3 326.6 354.3A77.4 77.4 0 0 0 315 450.4 765.3 765.3 0 0 0 405.9 566.4L328.5 643.8A1110.8 1110.8 0 0 1 123.4 340.8ZM654.1 373.6L994.3 33.4A19.5 19.5 0 0 0 966.6 5.8L626.5 345.9A19.5 19.5 0 1 0 654.1 373.6Z", + "width": 1000 + }, + "search": [ + "not_reachable_icon" + ] + }, + { + "uid": "2ebc420c0ce1444e7e86888285f9d5ea", + "css": "group-74", + "code": 59405, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M628.1 683.9C628.1 591.2 628.1 293.6 628.1 290.7A74 74 0 0 0 554.8 214.7H554.8A75.5 75.5 0 0 0 511 228.7V160.9A75.8 75.8 0 0 0 489.4 107.3 74.5 74.5 0 0 0 436.2 84.9H436.2A74.8 74.8 0 0 0 392.8 98.7V76A75.7 75.7 0 0 0 317.4 0H317.4A76.2 76.2 0 0 0 241.1 75.5V97.8A74.8 74.8 0 0 0 197.9 83.9H197.9A76.3 76.3 0 0 0 121.2 159.3V327A75.5 75.5 0 0 0 77.6 312.9H77.6A75.9 75.9 0 0 0 1.9 388.4C1.9 390.5 2.3 597.4 1.9 685.8A15.3 15.3 0 0 0 1.9 688.5 315.2 315.2 0 0 0 317.4 1000 311.9 311.9 0 0 0 630.2 687.2 15.3 15.3 0 0 0 630.2 683.9ZM435.4 116.7A42.8 42.8 0 0 1 466 129.6 44.1 44.1 0 0 1 478.4 160.8V481.9L391.8 481.9V160.6A43.7 43.7 0 0 1 435.4 117ZM315.8 968.1A283.2 283.2 0 0 1 32.2 685.9 13.6 13.6 0 0 0 32.2 683.3C32.2 593.7 32.2 390.1 32.2 388.5A43.8 43.8 0 0 1 119.8 388.5V635A16.3 16.3 0 0 0 136.1 651.2 162.9 162.9 0 0 1 252.8 700.1 166.9 166.9 0 0 1 300.5 818.2 16.3 16.3 0 1 0 332.4 818.2 198.4 198.4 0 0 0 275.4 677.7 194.8 194.8 0 0 0 151.8 619.6V159.4A45 45 0 0 1 196.9 115.8 43.7 43.7 0 0 1 240.2 159.3V369.4A16.3 16.3 0 0 0 272.1 369.4V75.5A44.2 44.2 0 0 1 316.7 31.9 43.8 43.8 0 0 1 360.3 75.9V481.6L272.1 481.6V433.6A16.3 16.3 0 0 0 240.2 433.6V481.5H223.9A16.3 16.3 0 1 0 223.9 513.4L492.7 514.3H526.3A16.3 16.3 0 1 0 526.3 482.4H510V290.5A43.9 43.9 0 0 1 554.1 246.9 42.4 42.4 0 0 1 595.9 290.9C595.9 294 596.3 599.1 595.9 687.5A15.5 15.5 0 0 0 596.3 690.9 281.2 281.2 0 0 1 315.4 968.4Z", + "width": 629 + }, + "search": [ + "group-74" + ] + }, + { + "uid": "3a5cc972b7f3f2ab8a20e22287b5598b", + "css": "group-169", + "code": 59412, + "src": "custom_icons", + "selected": false, + "svg": { + "path": "", + "width": 663 + }, + "search": [ + "group-169" + ] } ] } \ No newline at end of file diff --git a/lib/app-icons/driver_app_icons.dart b/lib/app-icons/driver_app_icons.dart index d6bbfb8..b8b3326 100644 --- a/lib/app-icons/driver_app_icons.dart +++ b/lib/app-icons/driver_app_icons.dart @@ -21,10 +21,26 @@ class DriverApp { static const _kFontFam = 'DriverApp'; static const _kFontPkg = null; - static const IconData logo = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData closed_box = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData location = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData open_box = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData phone_call = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData logo = + IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData closed_box = + IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData location = + IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData open_box = + IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData phone_call = + IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr = + IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData not_available = + IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData rejected_icon = + IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData not_reachable_icon = + IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData group_74 = + IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData deliverd_icon = + IconData(0xe812, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/app-icons/fonts/DriverApp.ttf b/lib/app-icons/fonts/DriverApp.ttf index 9b039c2..b00b39f 100644 Binary files a/lib/app-icons/fonts/DriverApp.ttf and b/lib/app-icons/fonts/DriverApp.ttf differ diff --git a/lib/main.dart b/lib/main.dart index 93879f9..84e790c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -69,7 +69,7 @@ class MyApp extends StatelessWidget { iconTheme: IconThemeData(), dividerColor: Color.fromRGBO(112, 112, 112, 1.0), appBarTheme: AppBarTheme( - color: Colors.grey, + color: Colors.transparent, brightness: Brightness.light, elevation: 0.0, actionsIconTheme: IconThemeData( diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index 9f58d6c..3ca2e86 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -6,6 +6,7 @@ import 'package:driverapp/pages/orders/pending_orders_page.dart'; import 'package:driverapp/uitl/app_toast.dart'; import 'package:driverapp/uitl/utils.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'; @@ -372,126 +373,129 @@ class _DashboardScreenState extends State { ], ), onTap: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => OrdersListScreen()), - )), + context, + MaterialPageRoute( + builder: (context) => OrdersListScreen()), + )), ], ), ], ), ), - Expanded( - child: ListView.builder( - shrinkWrap: true, - scrollDirection: Axis.vertical, - itemCount: //model.orders == null ? 0 : model.orders.length, - 3, - itemBuilder: (BuildContext context, int index) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 12.2), - child: InkWell( - child: RoundedContainer( - height: MediaQuery - .of(context) - .size - .height * 0.109, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10.0, bottom: 5.0), - child: Image.asset( - 'assets/images/location.png', - height: - MediaQuery.of(context).size.height * - 0.06, - width: MediaQuery.of(context).size.width * - 0.05, - ), - ) - ], - ), - ), - if (model.orders.length != 0) + NetworkBaseView( + baseViewModel: model, + child: Expanded( + child: ListView.builder( + shrinkWrap: true, + scrollDirection: Axis.vertical, + itemCount: //model.orders == null ? 0 : model.orders.length, + 3, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 12.2), + child: InkWell( + child: RoundedContainer( + height: MediaQuery.of(context).size.height * 0.109, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ Expanded( - flex: 3, + flex: 1, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, children: [ Padding( - padding: EdgeInsets.only(top: 5.0), - child: Text( - model.orders[index].firstName + - ' ' + - model.orders[index].lastName, - style: TextStyle(fontSize: 18.0), - ), - ), - Text( - model.orders[index].mobileNumber, - style: TextStyle( - color: Color(0xff30B7B9), - fontWeight: FontWeight.w600, - fontSize: 15.0, - ), - ), - Expanded( - child: Text( - 'Olaya ST, Behind kfc next to king , ', - style: TextStyle(color: Colors.black45), + padding: EdgeInsets.only( + left: 10.0, bottom: 5.0), + child: Image.asset( + 'assets/images/location.png', + height: + MediaQuery.of(context).size.height * + 0.06, + width: + MediaQuery.of(context).size.width * + 0.05, ), - ), + ) ], ), ), - Padding( - padding: EdgeInsets.all(10.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: CircleAvatar( - backgroundColor: Colors.black45, - radius: 28.0, + if (model.orders.length != 0) + Expanded( + flex: 3, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top: 5.0), + child: Text( + model.orders[index].firstName + + ' ' + + model.orders[index].lastName, + style: TextStyle(fontSize: 18.0), + ), + ), + Text( + model.orders[index].mobileNumber, + style: TextStyle( + color: Color(0xff30B7B9), + fontWeight: FontWeight.w600, + fontSize: 15.0, + ), + ), + Expanded( + child: Text( + 'Olaya ST, Behind kfc next to king , ', + style: + TextStyle(color: Colors.black45), + ), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.all(10.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( child: CircleAvatar( - backgroundColor: Colors.white, - maxRadius: 25.1, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - '3 K.m \n away', - style: TextStyle( - color: Color(0xff30B7B9), - fontSize: 10.5, - fontWeight: FontWeight.w400), + backgroundColor: Colors.black45, + radius: 28.0, + child: CircleAvatar( + backgroundColor: Colors.white, + maxRadius: 25.1, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + '3 K.m \n away', + style: TextStyle( + color: Color(0xff30B7B9), + fontSize: 10.5, + fontWeight: FontWeight.w400), + ), ), ), ), - ), - ) - ], + ) + ], + ), ), - ), - ], + ], + ), ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + InformationPage(model.orders[index]))); + }, ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - InformationPage(model.orders[index]))); - }, - ), - ); - }, + ); + }, + ), ), ), ], diff --git a/lib/pages/delivery/delivery_confirmed_page.dart b/lib/pages/delivery/delivery_confirmed_page.dart index 8fab34f..1f5919c 100644 --- a/lib/pages/delivery/delivery_confirmed_page.dart +++ b/lib/pages/delivery/delivery_confirmed_page.dart @@ -1,3 +1,4 @@ +import 'package:driverapp/widgets/buttons/secondary_button.dart'; import 'package:driverapp/widgets/delivery/customer_brief_card.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -39,21 +40,13 @@ class DeliveryConfirmedPage extends StatelessWidget { child: Column( children: [ Container( - width: MediaQuery - .of(context) - .size - .width, + width: MediaQuery.of(context).size.width, //300, - height: MediaQuery - .of(context) - .size - .width * 0.7, + height: MediaQuery.of(context).size.width * 0.7, //300, padding: EdgeInsets.only( - top: MediaQuery - .of(context) - .size - .width * 0.2, //60, + top: MediaQuery.of(context).size.width * + 0.2, //60, ), decoration: BoxDecoration( color: Colors.white10, @@ -66,17 +59,14 @@ class DeliveryConfirmedPage extends StatelessWidget { size: 60, ), Text( - TranslationBase - .of(context) - .deliveryInfo, + TranslationBase.of(context).deliveryInfo, style: TextStyle( color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold), ), Text( - TranslationBase - .of(context) + TranslationBase.of(context) .confirmationSent, style: TextStyle( color: Colors.white, @@ -94,25 +84,13 @@ class DeliveryConfirmedPage extends StatelessWidget { Stack( children: [ Container( - width: MediaQuery - .of(context) - .size - .width, //400, - height: MediaQuery - .of(context) - .size - .width, //500, + width: MediaQuery.of(context).size.width, //400, + height: MediaQuery.of(context).size.width, //500, ), Container( - width: MediaQuery - .of(context) - .size - .width, + width: MediaQuery.of(context).size.width, //800, - height: MediaQuery - .of(context) - .size - .width * 1.2, + height: MediaQuery.of(context).size.width * 1.2, //440, margin: EdgeInsets.only(top: 60), decoration: BoxDecoration( @@ -127,64 +105,77 @@ class DeliveryConfirmedPage extends StatelessWidget { children: [ Container( margin: EdgeInsets.only( - bottom: MediaQuery - .of(context) - .size - .width * 0.15, //50 + bottom: MediaQuery.of(context).size.width * + 0.15, //50 ), child: Column( children: [ +// Container( +// margin: EdgeInsets.all(10), +// child: SecondaryButton( +// color: Colors.orangeAccent, +// label: TranslationBase.of(context).addNoteBtn, +// icon: Icon(Icons.mode_edit), +// small: true, +// onTap: () {}, +// ), +// ), FlatButton.icon( padding: EdgeInsets.all(8), color: Colors.orangeAccent, shape: RoundedRectangleBorder( borderRadius: - new BorderRadius.circular(10.0), + new BorderRadius.circular(10.0), + ), + label: Text( + TranslationBase.of(context).addNoteBtn, + style: TextStyle(color: Colors.white), ), icon: Icon( Icons.mode_edit, color: Colors.white, ), - label: Text( - TranslationBase - .of(context) - .addNoteBtn, - style: TextStyle(color: Colors.white), - ), onPressed: () {}, ), SizedBox( - height: MediaQuery - .of(context) - .size - .width * 0.1, //20, + height: MediaQuery.of(context).size.width * + 0.1, //20, ), - FlatButton( - color: Color(0xff41bdbb), - padding: - EdgeInsets.only( - right: MediaQuery - .of(context) - .size - .width * 0.25, //100, - left: MediaQuery - .of(context) - .size - .width * 0.25, //100 - ), - shape: RoundedRectangleBorder( - borderRadius: - new BorderRadius.circular(18.0), - side: - BorderSide(color: Color(0xff41bdbb)), - ), - child: Text( - TranslationBase - .of(context) + Container( + margin: EdgeInsets.all(10), +// height: MediaQuery.of(context).size.height *0.08, + child: SecondaryButton( + label: TranslationBase.of(context) .nextDelivery, - style: TextStyle(color: Colors.white), + onTap: () {}, ), - onPressed: () {}, +// FlatButton( +// color: Color(0xff41bdbb), +// padding: +// EdgeInsets.only( +// right: MediaQuery +// .of(context) +// .size +// .width * 0.25, //100, +// left: MediaQuery +// .of(context) +// .size +// .width * 0.25, //100 +// ), +// shape: RoundedRectangleBorder( +// borderRadius: +// new BorderRadius.circular(18.0), +// side: +// BorderSide(color: Color(0xff41bdbb)), +// ), +// child: Text( +// TranslationBase +// .of(context) +// .nextDelivery, +// style: TextStyle(color: Colors.white), +// ), +// onPressed: () {}, +// ), ), ], ), @@ -198,8 +189,7 @@ class DeliveryConfirmedPage extends StatelessWidget { customerLastName: item.lastName, mobileNo: item.mobileNumber, totalPayment: item.amount, - deliveryTime: item.orderCreatedOn - ), + deliveryTime: item.orderCreatedOn), ], ), ], diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/information_page.dart index f99dcff..3d55ab0 100644 --- a/lib/pages/delivery/information_page.dart +++ b/lib/pages/delivery/information_page.dart @@ -17,6 +17,11 @@ class InformationPage extends StatelessWidget { @override Widget build(BuildContext context) { return AppScaffold( + isShowAppBar: true, + appBarColor: Color(0xff3ABBBA), + arrowColor: Colors.white, + titleColor: Colors.white, + appBarTitle: TranslationBase.of(context).deliveryInfo, body: Container( color: Color(0xff3ABBBA), child: Container( @@ -25,38 +30,6 @@ class InformationPage extends StatelessWidget { children: [ Column( children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.only( - right: MediaQuery - .of(context) - .size - .width * 0.10, //50 - ), - child: IconButton( - color: Colors.white, - iconSize: 50, - icon: Icon(Icons.arrow_back), - onPressed: () { - Navigator.pop(context); - }, - ), - ), - Container( - child: Text( - TranslationBase - .of(context) - .deliveryInfo, - style: TextStyle( - color: Colors.white, - fontSize: 20, - ), - ), - ), - ], - ), Stack( children: [ Container( @@ -99,7 +72,7 @@ class InformationPage extends StatelessWidget { height: MediaQuery .of(context) .size - .width * 0.4, //170, + .width * 0.53, //170, ), Row( mainAxisAlignment: MainAxisAlignment.center, @@ -172,13 +145,16 @@ class InformationPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase - .of(context) - .packageContent, - style: TextStyle( - fontWeight: FontWeight.w900, - fontSize: 20), + Padding( + padding: const EdgeInsets.only(left: 8), + child: Text( + TranslationBase + .of(context) + .packageContent, + style: TextStyle( + fontWeight: FontWeight.w900, + fontSize: 20), + ), ), SizedBox( height: MediaQuery @@ -186,21 +162,25 @@ class InformationPage extends StatelessWidget { .size .width * 0.05, //20, ), - Column( - children: List.generate( - item.itemsQuantitiesList.length, - (index) { - return package_content( - packageName: item - .itemsQuantitiesList[index] - .itemName - .toString(), - packageCount: item - .itemsQuantitiesList[index] - .quantity - .toString(), - ); - }), + Padding( + padding: const EdgeInsets.only(left: 10), + child: Column( + children: List.generate( + item.itemsQuantitiesList.length, + (index) { + return package_content( + packageName: item + .itemsQuantitiesList[index] + .itemName + .toString(), + //'Panadol Extra 50 tablet', + packageCount: item + .itemsQuantitiesList[index] + .quantity + .toString(), + ); + }), + ), ), SizedBox( height: MediaQuery @@ -231,47 +211,6 @@ class InformationPage extends StatelessWidget { }, ), ), -// FlatButton( -// color: Color(0xff41bdbb), -// padding: EdgeInsets.only( -// right: MediaQuery -// .of(context) -// .size -// .width * 0.3, //100, -// left: MediaQuery -// .of(context) -// .size -// .width * 0.3, //100, -// bottom: MediaQuery -// .of(context) -// .size -// .width * 0.035, //15, -// top: MediaQuery -// .of(context) -// .size -// .width * 0.035, //15 -// ), -// shape: RoundedRectangleBorder( -// borderRadius: new BorderRadius.circular(30.0), -// side: BorderSide(color: Color(0xff41bdbb)), -// ), -// child: Text( -// TranslationBase -// .of(context) -// .clientReached, -// style: TextStyle( -// color: Colors.white, -// fontWeight: FontWeight.bold, -// fontSize: 16), -// ), -// onPressed: () { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (context) => -// DeliveryConfirmedPage(item))); -// }, -// ), ], ), ), diff --git a/lib/pages/orders/pending_orders_page.dart b/lib/pages/orders/pending_orders_page.dart index 4d265b3..b01d301 100644 --- a/lib/pages/orders/pending_orders_page.dart +++ b/lib/pages/orders/pending_orders_page.dart @@ -1,10 +1,11 @@ -import 'package:flutter/material.dart'; -import 'package:driverapp/config/size_config.dart'; import 'package:driverapp/core/viewModels/orders_view_model.dart'; -import '../base/base_view.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:driverapp/widgets/others/rounded_container.dart'; import 'package:driverapp/pages/delivery/information_page.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 '../base/base_view.dart'; class OrdersListScreen extends StatefulWidget { @override @@ -17,14 +18,10 @@ class _OrdersListScreenState extends State { return BaseView( onModelReady: (model) => model.getPendingOrders(), builder: (BuildContext context, OrdersViewModel model, Widget child) => - Scaffold( - appBar: AppBar( - centerTitle: true, - backgroundColor: Color(0xffF4F9FA), - title: Text( - 'Your Delivery Que', - ), - ), + AppScaffold( + isShowAppBar: true, + appBarTitle: 'Your Delivery Que', + titleColor: Colors.black, body: Column( children: [ Expanded( diff --git a/lib/widgets/bottom_sheet/action_sheet_button.dart b/lib/widgets/bottom_sheet/action_sheet_button.dart new file mode 100644 index 0000000..51c91f7 --- /dev/null +++ b/lib/widgets/bottom_sheet/action_sheet_button.dart @@ -0,0 +1,72 @@ +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class ActionSheetButton extends StatelessWidget { + const ActionSheetButton({Key key, this.label, this.onTap, this.icon}) + : super(key: key); + final String label; + final Function onTap; + final IconData icon; + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + child: Container( + height: MediaQuery.of(context).size.height * 0.07, + decoration: BoxDecoration( + border: Border.all(color: Colors.blue), + borderRadius: BorderRadius.circular(6), + gradient: LinearGradient(colors: [ + Hexcolor('#DCE6E8'), + Hexcolor('#FFFFFF'), + ], begin: Alignment.topLeft), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 60, + height: 50, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Theme.of(context).primaryColor, + ), + child: Center( + child: Icon( + icon, + size: 30, + color: Colors.white, + ), + ), + ) + ], + ), + ), + Expanded( + flex: 3, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(top: 5.0), + child: Text( + label, + style: TextStyle(fontSize: 18.0), + ), + ) + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/bottom_sheet/custom_bottom_sheet.dart b/lib/widgets/bottom_sheet/custom_bottom_sheet.dart new file mode 100644 index 0000000..8131149 --- /dev/null +++ b/lib/widgets/bottom_sheet/custom_bottom_sheet.dart @@ -0,0 +1,39 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class CustomBottomSheet extends StatelessWidget { + final List children; + + CustomBottomSheet({Key key, @required this.children}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.symmetric(vertical: 12.0), + decoration: BoxDecoration( + color: Hexcolor("#FEFEFE"), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(30.0), + topRight: Radius.circular(30.0), + ), + ), + child: SafeArea( + top: false, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + decoration: BoxDecoration( + color: Hexcolor("#D5D5D5"), + borderRadius: BorderRadius.circular(3.0)), + width: 200, + height: 7.0, + ), + ...children + ], + ), + ), + ); + } +} diff --git a/lib/widgets/delivery/customer_brief_card.dart b/lib/widgets/delivery/customer_brief_card.dart index fc718b9..23c1530 100644 --- a/lib/widgets/delivery/customer_brief_card.dart +++ b/lib/widgets/delivery/customer_brief_card.dart @@ -32,7 +32,7 @@ class CustomerBrief extends StatelessWidget { return Center( child: Container( width: 350, - height: 300, + height: 270, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( @@ -50,7 +50,7 @@ class CustomerBrief extends StatelessWidget { ], ), child: Container( - padding: EdgeInsets.only(left: 30, top: 10, right: 30), + padding: EdgeInsets.only(left: 30, top: 20, right: 30), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -70,7 +70,7 @@ class CustomerBrief extends StatelessWidget { backgroundColor: Colors.white, maxRadius: 25.1, child: Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.only(left: 3), child: Text( '3 K.m \n away', style: TextStyle( @@ -96,7 +96,7 @@ class CustomerBrief extends StatelessWidget { height: 10, ), Text( - 'Olaya street, behind KFC resturant, next to kingdom towers 2ND floor ofice 277', + 'Olaya street, behind KFC resturant, next to kingdom towers 2nd floor ofice 277', style: TextStyle(color: Color(0xFF464748),fontWeight: FontWeight.w600), ), SizedBox( diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 3005588..98a990c 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -2,7 +2,6 @@ import 'package:driverapp/config/config.dart'; import 'package:driverapp/core/viewModels/base_view_model.dart'; import 'package:driverapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'arrow_back.dart'; import 'network_base_view.dart'; @@ -13,52 +12,65 @@ class AppScaffold extends StatelessWidget { final bool isLoading; final bool isShowAppBar; final BaseViewModel baseViewModel; + final Widget bottomSheet; + final Color titleColor; + final Color arrowColor; + final Color appBarColor; AppScaffold( {@required this.body, this.appBarTitle = '', this.isLoading = false, this.isShowAppBar = false, - this.baseViewModel}); + this.baseViewModel, + this.bottomSheet, + this.titleColor, + this.arrowColor, + this.appBarColor, + }); @override Widget build(BuildContext context) { AppGlobal.context = context; return SafeArea( child: Scaffold( - backgroundColor: Theme.of(context).scaffoldBackgroundColor, + backgroundColor: appBarColor ?? Theme.of(context).scaffoldBackgroundColor, appBar: isShowAppBar ? AppBar( - elevation: 0, - backgroundColor: Theme.of(context).appBarTheme.color, - textTheme: TextTheme( - headline6: - TextStyle(color: Colors.white, fontWeight: FontWeight.bold), - ), - title: Text(appBarTitle.toUpperCase()), - leading: Builder( - builder: (BuildContext context) { - return ArrowBack(); - }, - ), - centerTitle: true, - actions: [ - IconButton( - icon: Icon(FontAwesomeIcons.home), - color: Colors.white, - onPressed: () { - // TODO add navigator to home page - }, - ), - ], - ) + elevation: 0, + backgroundColor: Theme + .of(context) + .appBarTheme + .color, + textTheme: TextTheme( + headline6: TextStyle( + color: titleColor ?? Colors.white, + fontWeight: FontWeight.bold), + ), + title: Text(appBarTitle.toUpperCase()), + leading: Builder( + builder: (BuildContext context) { + return ArrowBack(arrowColor: arrowColor,); + }, + ), + centerTitle: true, +// actions: [ +// IconButton( +// icon: Icon(FontAwesomeIcons.home), +// color: Colors.white, +// onPressed: () { +// // TODO add navigator to home page +// }, +// ), +// ], + ) : null, body: baseViewModel != null ? NetworkBaseView( - child: buildBodyWidget(), - baseViewModel: baseViewModel, - ) - : buildBodyWidget(), + child: buildBodyWidget(), + baseViewModel: baseViewModel, + ) + : buildBodyWidget(), bottomSheet: bottomSheet, ), ); } diff --git a/lib/widgets/others/arrow_back.dart b/lib/widgets/others/arrow_back.dart index d22b5c1..219c2e5 100644 --- a/lib/widgets/others/arrow_back.dart +++ b/lib/widgets/others/arrow_back.dart @@ -1,19 +1,26 @@ -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:driverapp/core/viewModels/project_view_model.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class ArrowBack extends StatelessWidget { final Function onTap; + final Color arrowColor; - ArrowBack({Key key, this.onTap}) : super(key: key); + ArrowBack({Key key, this.onTap, this.arrowColor}) : super(key: key); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return GestureDetector( behavior: HitTestBehavior.opaque, onTap: Feedback.wrapForTap(() { onTap != null ? onTap() : Navigator.pop(context); }, context), - child: Icon(EvaIcons.arrowBack, color: Theme.of(context).primaryColor), + child: Icon( + projectViewModel.isArabic ? Icons.arrow_forward : Icons.arrow_back, + color: arrowColor ?? Theme.of(context).primaryColor, + size: 22, + ), ); } } diff --git a/lib/widgets/others/network_base_view.dart b/lib/widgets/others/network_base_view.dart index fe409bc..42bfde6 100644 --- a/lib/widgets/others/network_base_view.dart +++ b/lib/widgets/others/network_base_view.dart @@ -25,7 +25,7 @@ class NetworkBaseView extends StatelessWidget { return child; break; case ViewState.Busy: - return AppCircularProgressIndicator(); + return Expanded(child: AppCircularProgressIndicator()); break; case ViewState.Error: return Center(