Compare commits

..

No commits in common. 'development' and 'merge_into_dev_9/13_final' have entirely different histories.

@ -43,8 +43,6 @@ android {
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {

@ -5,8 +5,6 @@
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="driver App"
@ -24,7 +22,8 @@
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -1 +0,0 @@
include ':app'

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

@ -1 +0,0 @@
5fbd1cb9b58728098d7578fb656a1766

@ -1,6 +1,4 @@
PODS:
- "app_settings (3.0.0+1)":
- Flutter
- barcode_scan (0.0.1):
- Flutter
- MTBBarcodeScanner
@ -62,11 +60,8 @@ PODS:
- Flutter
- url_launcher_web (0.0.1):
- Flutter
- url_launcher_windows (0.0.1):
- Flutter
DEPENDENCIES:
- app_settings (from `.symlinks/plugins/app_settings/ios`)
- barcode_scan (from `.symlinks/plugins/barcode_scan/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`)
@ -94,7 +89,6 @@ DEPENDENCIES:
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
SPEC REPOS:
trunk:
@ -104,8 +98,6 @@ SPEC REPOS:
- TOCropViewController
EXTERNAL SOURCES:
app_settings:
:path: ".symlinks/plugins/app_settings/ios"
barcode_scan:
:path: ".symlinks/plugins/barcode_scan/ios"
connectivity:
@ -160,11 +152,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_macos/ios"
url_launcher_web:
:path: ".symlinks/plugins/url_launcher_web/ios"
url_launcher_windows:
:path: ".symlinks/plugins/url_launcher_windows/ios"
SPEC CHECKSUMS:
app_settings: d103828c9f5d515c4df9ee754dabd443f7cedcf3
barcode_scan: a5c27959edfafaa0c771905bad0b29d6d39e4479
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
@ -196,8 +185,7 @@ SPEC CHECKSUMS:
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5
PODFILE CHECKSUM: c34e2287a9ccaa606aeceab922830efb9a6ff69a
COCOAPODS: 1.10.0.rc.1
COCOAPODS: 1.9.3

@ -225,12 +225,51 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/MTBBarcodeScanner/MTBBarcodeScanner.framework",
"${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/SwiftProtobuf/SwiftProtobuf.framework",
"${BUILT_PRODUCTS_DIR}/TOCropViewController/TOCropViewController.framework",
"${BUILT_PRODUCTS_DIR}/barcode_scan/barcode_scan.framework",
"${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework",
"${BUILT_PRODUCTS_DIR}/device_info/device_info.framework",
"${BUILT_PRODUCTS_DIR}/flutter_flexible_toast/flutter_flexible_toast.framework",
"${BUILT_PRODUCTS_DIR}/flutter_local_notifications/flutter_local_notifications.framework",
"${BUILT_PRODUCTS_DIR}/flutter_plugin_android_lifecycle/flutter_plugin_android_lifecycle.framework",
"${BUILT_PRODUCTS_DIR}/hexcolor/hexcolor.framework",
"${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}/location/location.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",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MTBBarcodeScanner.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftProtobuf.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TOCropViewController.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/barcode_scan.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_flexible_toast.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_local_notifications.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_plugin_android_lifecycle.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hexcolor.framework",
"${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}/location.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",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@ -309,6 +348,7 @@
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@ -385,6 +425,7 @@
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@ -440,6 +481,7 @@
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;

@ -45,7 +45,5 @@
<string>Needed to access location</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Needed to access location</string>
<key>NSCameraUsageDescription</key>
<string>Camera permission is required for barcode scanning.</string>
</dict>
</plist>

@ -62,6 +62,20 @@
"open_box"
]
},
{
"uid": "d755ac5bb912e95877e670a67bf4528d",
"css": "phone_call",
"code": 59398,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M907.5 618.9L829.1 540.7A45.6 45.6 0 0 0 764.4 540.7L764.4 540.7 719.7 585.5A9.9 9.9 0 0 1 707 586.6 517.6 517.6 0 0 1 586 467.8 9.9 9.9 0 0 1 586.9 455.1L633 409A45.7 45.7 0 0 0 633 344.4L554.6 265.9A46.7 46.7 0 0 0 489.9 265.9L465.1 290.8A139.5 139.5 0 0 0 430.3 433.2 417.6 417.6 0 0 0 481.3 536.8 544.9 544.9 0 0 0 638.1 690.9 400.4 400.4 0 0 0 754.2 742.5 134.2 134.2 0 0 0 786.7 746.4 141.4 141.4 0 0 0 886.1 704.6L907.4 683.2A45.6 45.6 0 0 0 907.5 618.9Z",
"width": 1344
},
"search": [
"phone_call"
]
},
{
"uid": "bf7916a50afc43e4ef26fe098b6c10f3",
"css": "qr",
@ -201,104 +215,6 @@
"search": [
"location"
]
},
{
"uid": "12c8b9f62dbd71097b9e0774d8ea3aa2",
"css": "logout_icon",
"code": 59394,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M497 848H183C164 848 148 832 148 813V185C148 166 164 150 183 150H497C516 150 532 134 532 115S517 80 497 80H183C125 80 78 127 78 185V813C78 871 125 918 183 918H497C516 918 532 902 532 883 532 864 517 848 497 848ZM909 474L696 265C682 251 660 252 647 265 633 279 634 301 647 314L799 464H393C374 464 358 480 358 499S374 534 393 534H799L647 684C633 698 633 720 647 733 654 740 663 743 672 743 681 743 690 740 697 733L909 524C916 517 919 508 919 499 919 490 915 481 909 474Z",
"width": 1000
},
"search": [
"logout_icon"
]
},
{
"uid": "4477449a41e25549927f47fa79837b37",
"css": "settings_icon",
"code": 59398,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M857 727H770C756 680 713 646 661 646S567 680 552 727H141C123 727 108 742 108 760S123 793 141 793H553C567 840 610 874 662 874 713 874 756 840 771 793H858C876 793 891 778 891 760S875 727 857 727ZM661 808C634 808 612 786 612 759S634 710 661 710 710 732 710 759 688 808 661 808ZM857 206H770C756 159 713 125 661 125S567 159 552 206H141C123 206 108 221 108 239S123 272 141 272H553C567 319 610 353 662 353S756 319 771 272H858C876 272 891 257 891 239S875 206 857 206ZM661 287C634 287 612 265 612 238S634 189 661 189 710 211 710 238 688 287 661 287ZM857 466H445C431 419 388 385 336 385S242 419 227 466H140C122 466 107 481 107 499 107 517 122 532 140 532H227C241 579 284 613 336 613S430 579 445 532H857C875 532 890 517 890 499 889 481 875 466 857 466ZM336 548C309 548 287 526 287 499 287 472 309 450 336 450 363 450 385 472 385 499 385 526 363 548 336 548Z",
"width": 1000
},
"search": [
"settings_icon"
]
},
{
"uid": "4290c78df9df640ac05e5e85479f198d",
"css": "bell_icon",
"code": 59409,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M824 676C791 676 765 650 765 617V410C765 339 737 272 687 222 656 191 619 169 578 156 585 144 588 130 588 115 588 66 548 26 499 26S410 66 410 115C410 130 414 144 420 156 312 190 233 293 233 413V617C233 650 207 676 174 676 158 676 144 689 144 706V824C144 840 157 854 174 854H397C396 859 396 864 396 869 396 926 442 972 499 972S602 926 602 869C602 864 602 859 601 854H824C840 854 854 841 854 824V706C853 689 840 676 824 676ZM499 85C515 85 529 98 529 115S516 145 499 145C483 145 469 132 469 115S483 85 499 85ZM543 868C543 892 523 912 499 912 475 912 455 892 455 868 455 863 456 858 458 853H542C542 858 543 863 543 868ZM794 794H558 440 204V731C255 718 293 672 293 617V413C293 298 385 204 499 204 499 204 499 204 500 204 555 204 607 225 646 264 685 303 707 355 707 410V617C707 672 745 718 796 731L794 794ZM381 440C365 440 351 427 351 410 351 329 417 262 499 262 515 262 529 275 529 292 529 308 516 322 499 322 450 322 410 362 410 411 410 427 397 440 381 440Z",
"width": 1000
},
"search": [
"bell_icon"
]
},
{
"uid": "28ba081187e1746ddc2a5eb098545058",
"css": "language_icon",
"code": 59400,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M864 413H584V294L675 229C682 224 686 216 686 207 686 198 682 190 675 185L583 119C576 71 534 33 484 33H133C78 33 33 78 33 133V484C33 539 78 584 133 584H413V703L322 768C315 773 311 781 311 790S315 807 322 812L414 878C421 926 463 964 513 964H864C919 964 964 919 964 864V514C965 458 920 413 864 413ZM133 530C108 530 87 509 87 484V133C87 108 108 87 133 87H484C509 87 530 108 530 133 530 142 534 150 541 155L612 206 541 257C534 263 530 271 530 280V414H513C458 414 413 459 413 514V530H133ZM910 864C910 890 890 910 864 910H513C488 910 467 889 467 864 467 855 463 847 456 842L385 791 456 740C463 735 467 727 467 718V514C467 489 488 468 513 468H557 557 557 864C889 468 910 489 910 514V864ZM275 312H225V345H281V370H193V233H278V258H224V286H274V312ZM302 370V233H338L366 283C374 297 382 315 388 330H389C387 312 386 293 386 273V233H414V370H381L352 317C344 302 335 285 328 269L327 269C328 287 328 306 328 329V370H302ZM775 678H686C651 678 634 693 634 722 634 748 654 764 686 764H746V801H689C636 801 598 769 598 721 598 679 623 649 661 642 653 627 649 613 649 600 649 558 679 529 718 529 743 529 762 541 773 565L745 578C739 566 730 560 717 560 696 560 683 576 683 600 683 618 694 637 706 641H774V678Z",
"width": 1000
},
"search": [
"language_icon"
]
},
{
"uid": "d755ac5bb912e95877e670a67bf4528d",
"css": "phone_call",
"code": 59401,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M907.5 618.9L829.1 540.7A45.6 45.6 0 0 0 764.4 540.7L764.4 540.7 719.7 585.5A9.9 9.9 0 0 1 707 586.6 517.6 517.6 0 0 1 586 467.8 9.9 9.9 0 0 1 586.9 455.1L633 409A45.7 45.7 0 0 0 633 344.4L554.6 265.9A46.7 46.7 0 0 0 489.9 265.9L465.1 290.8A139.5 139.5 0 0 0 430.3 433.2 417.6 417.6 0 0 0 481.3 536.8 544.9 544.9 0 0 0 638.1 690.9 400.4 400.4 0 0 0 754.2 742.5 134.2 134.2 0 0 0 786.7 746.4 141.4 141.4 0 0 0 886.1 704.6L907.4 683.2A45.6 45.6 0 0 0 907.5 618.9Z",
"width": 1344
},
"search": [
"phone_call"
]
},
{
"uid": "3ee830f1177337ad723625ace69b886b",
"css": "qustion_mark",
"code": 59411,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M215.2 420.5C344.6 414.9 436 362.9 436 295.4 436 236.3 381.2 185.6 295.4 185.6 226.4 185.6 163.2 222.2 118.1 272.9L0 151.9C80.1 61.9 191.2 0 330.5 0 517.5 0 646.9 116.7 646.9 275.7 646.9 402.3 542.9 516.2 398 549.9V651.2H215.2ZM175.8 869.2A129.5 129.5 0 0 1 306.6 744 128 128 0 0 1 306.6 1000 130.6 130.6 0 0 1 175.8 869.2Z",
"width": 647
},
"search": [
"group-8"
]
},
{
"uid": "e4101bb9283eee95eea80812a39424cc",
"css": "exclamation_mark",
"code": 59412,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M0 867A131.7 131.7 0 0 1 133 739.6 130.2 130.2 0 0 1 133 1000 132.8 132.8 0 0 1 0 867ZM15.7 0H251.8L204.6 636.6H63Z",
"width": 260
},
"search": [
"group-14"
]
}
]
}

@ -21,46 +21,19 @@ class DriverApp {
static const _kFontFam = 'DriverApp';
static const _kFontPkg = null;
static const IconData location_1 =
IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData logo =
IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData logout_icon =
IconData(0xe802, 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 settings_icon =
IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData qr =
IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData language_icon =
IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData phone_call =
IconData(0xe809, 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 message =
IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData whatsapp =
IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData call =
IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData bell_icon =
IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData deliverd_icon =
IconData(0xe812, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData qustion_mark =
IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData exclamation_mark =
IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData location_1 = IconData(0xe800, 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 message = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData whatsapp = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData call = IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData deliverd_icon = IconData(0xe812, fontFamily: _kFontFam, fontPackage: _kFontPkg);
}

Binary file not shown.

@ -2,27 +2,17 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
/// End points
const isUAT = true;
const BASE_URL = 'https://${isUAT ? "uat." : ""}hmgwebservices.com/';
const PING_SERVICE = '/Services/Weather.svc/REST/CheckConnectivity';
const GET_PROJECT = '/Services/Lists.svc/REST/GetProject';
const LOGIN = "/Services/Authentication.svc/REST/CheckDriverAuthentication";
const GET_OPT = "/Services/Patients.svc/REST/PatientER_Delivery_SendSMSForForgetPassword";
const CHECK_ACTIVATION_CODE = "/Services/Patients.svc/REST/PatientER_Delivery_CheckActivationCodeForForgetPassword";
const CHANGE_FORGOT_PASSWORD = "/Services/Patients.svc/REST/PatientER_Delivery_ChangeForgetedPasswordForDriver";
const GET_ALL_ORDERS = '/Services/Patients.svc/REST/PatientER_Delivery_GetAllOrder';
const SCAN_QR = '/Services/Patients.svc/REST/PatientER_Delivery_OrderInsert';
const UPDATE_ORDER_STATUS = '/Services/Patients.svc/REST/PatientER_Delivery_UpdateOrderStatus';
const NEXT_ORDER = "/Services/Patients.svc/REST/PatientER_Delivery_NextOrder";
const UPDATE_DRIVER_LOCATION = "/Services/Patients.svc/REST/PatientER_DriverLocation_Insert";
const INITIATE_DELIVERY = "/epharmacy/api/sendsmstocustomerfordriver";
const VERIFY_DELIVERY = "/Services/Patients.svc/REST/PatientER_ValidateSentOutForDeliveryOTPCode";
const GET_ALL_DELIVERD_ORDER = '/Services/Patients.svc/REST/PatientER_Delivery_GetAllDeliverdOrder';
const GET_ALL_ORDERS_STATUS = '/Services/Patients.svc/REST/PatientER_Delivery_GetAllOrderstatus';
const BASE_URL = 'https://uat.hmgwebservices.com/Services';
const GET_PROJECT = '/Lists.svc/REST/GetProject';
const LOGIN = "/Authentication.svc/REST/CheckDriverAuthentication";
const GET_ALL_ORDERS = '/Patients.svc/REST/PatientER_Delivery_GetAllOrder';
const SCAN_QR = '/Patients.svc/REST/PatientER_Delivery_OrderInsert';
const UPDATE_ORDER_STATUS =
'/Patients.svc/REST/PatientER_Delivery_UpdateOrderStatus';
const NEXT_ORDER = "/Patients.svc/REST/PatientER_Delivery_NextOrder";
const GET_ALL_DELIVERD_ORDER =
'/Patients.svc/REST/PatientER_Delivery_GetAllDeliverdOrder';
/// Body Constant
const CHANNEL = 9;
@ -42,11 +32,3 @@ const LINEAR_GRADIENT = LinearGradient(
],
// stops: [0.0, 1.0],
);
abstract class DeliveryStatus{
static final int pending = 1;
static final int delivered = 2;
static final int rejected = 3;
static final int cancel = 4;
}

@ -4,7 +4,7 @@ const Map<String, Map<String, String>> localizedValues = {
'language': {'en': 'App Language', 'ar': 'لغة التطبيق'},
'lanEnglish': {'en': 'English', 'ar': 'English'},
'lanArabic': {'en': 'العربية', 'ar': 'العربية'},
'cancel': {'en': 'Cancel', 'ar': 'الغاء'},
'cancel': {'en': 'CANCEL', 'ar': 'الغاء'},
'done': {'en': 'DONE', 'ar': 'تأكيد'},
'replay2': {'en': 'Replay', 'ar': 'رد الطبيب'},
'home': {'en': 'Home', 'ar': 'الرئيسية'},
@ -14,7 +14,7 @@ const Map<String, Map<String, String>> localizedValues = {
'booking': {'en': 'Booking', 'ar': 'حجز'},
'enterId': {'en': 'User Name', 'ar': 'اسم المستخدم'},
'pleaseEnterYourID': {
'en': 'Please enter your user name',
'en': 'Please enter your ',
'ar': 'الرجاء ادخال اسم المستخدم'
},
'enterPassword': {'en': 'Password', 'ar': 'كلمه السر'},
@ -26,17 +26,11 @@ const Map<String, Map<String, String>> localizedValues = {
'en': 'Please insert username and password to login',
'ar': 'الرجاء إدخال اسم المستخدم وكلمة المرور لتسجيل الدخول'
},
'enterForgetIdMsg': {
'en':
'We will send a One Time Password (OTP) to your Mobile Number to reset your password.',
'ar':
'سنرسل كلمة مرور لمرة واحدة (OTP) إلى حسابك رقم الهاتف المحمول لإعادة تعيين كلمة المرور الخاصة بك.'
},
'forgotPassword': {'en': 'Forgot Password?', 'ar': 'هل نسيت كلمة المرور ؟'},
'login': {'en': 'Login', 'ar': 'تسجيل الدخول'},
'haveGreatDay': {'en': 'have a great day,', 'ar': 'أتمنى لك يوما جميلا '},
'youHave': {'en': 'You Have', 'ar': 'يوجد لديك'},
'deliveredPackages': {'en': 'Processed \nPackages', 'ar': 'الطرود\n المسلمة'},
'deliveredPackages': {'en': 'Delivered \nPackages', 'ar': 'الطرود\n المسلمة'},
'seeAll': {'en': 'See All', 'ar': 'اظهار الكل'},
'nearestDropOffs': {'en': 'Nearest Drop-Offs', 'ar': 'أقرب نقطة إنزال'},
'undeliveredPackages': {
@ -69,58 +63,10 @@ const Map<String, Map<String, String>> localizedValues = {
},
'delivered': {'en': 'Delivered', 'ar': 'وصل'},
'deliveredAccepted': {'en': 'Delivered/Accepted', 'ar': 'تم التوصيل/مقبول'},
'deliveredRejected': {'en': 'Rejected', 'ar': 'مرفوض'},
'deliveredRejected': {'en': 'Delivered/Rejected', 'ar': 'تم التوصيل/مرفوض'},
'canceled': {'en': 'Canceled', 'ar': 'الغى'},
'selectAction': {'en': 'Select Action', 'ar': 'الرجاء الاختيار'},
'youHaveSelected': {'en': 'You have selected:', 'ar': 'لقد قمت باختيار:'},
'confirm': {'en': 'Confirm', 'ar': 'تأكيد'},
'areYouSure': {'en': 'Are you sure?', 'ar': 'هل أنت واثق؟'},
'languageText': {'en': 'Language', 'ar': 'اللغة'},
'notification': {'en': 'Notification', 'ar': 'تنبيهات'},
'getOPT': {'en': 'Get OPT', 'ar': 'OPT الحصول على'},
'enterVerificationMsg': {
'en': 'Please Enter your OPT code sent to your phone',
'ar': 'الرجاء إدخال رمز OPT الخاص بك المرسل إلى هاتفك'
},
'enterCustomerVerificationCodeMsg': {
'en': 'Please enter OTP sent to customer phone',
'ar': 'Please enter OTP sent to customer phone'
},
'startDelivery': {
'en': 'Start Delivery',
'ar': 'Start Delivery'
},
'deliveryOption': {
'en': 'Delivery Option',
'ar': 'Delivery Option'
},
'selectReason': {
'en': 'Select Reason',
'ar': 'Select Reason'
},
'accident': {
'en': 'Got accident',
'ar': 'Got accident'
},
'notReachableOnPhoneCall': {
'en': 'Not reachable on phone call',
'ar': 'Not reachable on phone call'
},
'notAvailableAtlocation': {
'en': 'Not available at location',
'ar': 'Not available at location'
},
'deliverLater': {
'en': 'Deliver later',
'ar': 'Deliver later'
},
'other': {
'en': 'Other...',
'ar': 'Other...'
},
};

@ -1,6 +1,5 @@
const TOKEN = 'token';
const APP_LANGUAGE = 'language';
const USER_PROFILE = 'user-profile';
const ACTIVE_DELIVERIES = 'active-order-deliveries';

@ -1,11 +0,0 @@
class ResponseModel<T>{
bool isSuccessful = false;
String message;
T data;
isSuccessfull(Function(bool) callback){
callback(isSuccessful);
}
ResponseModel({this.message, this.isSuccessful, this.data});
}

@ -8,19 +8,19 @@ class AuthenticatedUser {
bool active;
String createdOn;
int createdBy;
dynamic editedOn;
dynamic editedBy;
Null editedOn;
Null editedBy;
String mobileNumber;
int realRoleID;
AuthenticatedUser(
{this.iD,
this.userID,
this.password,
this.userName,
this.roleID,
this.name,
this.active,
this.userID,
this.password,
this.userName,
this.roleID,
this.name,
this.active,
this.createdOn,
this.createdBy,
this.editedOn,

@ -1,12 +0,0 @@
class RequestInitiateOrderDelivery{
int orderNo = 0;
String mobileNumber = "";
RequestInitiateOrderDelivery({this.orderNo, this.mobileNumber});
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['OrderNo'] = this.orderNo;
data['MobileNumber'] = this.mobileNumber;
return data;
}
}

@ -1,12 +0,0 @@
class RequestValidateDelivery{
String pinCode;
int orderNo;
RequestValidateDelivery({this.orderNo,this.pinCode});
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Password'] = this.pinCode;
data['OrderNo'] = this.orderNo;
return data;
}
}

@ -1,3 +0,0 @@
class ResponseInitiateOrderDelivery{
}

@ -25,7 +25,7 @@ class DeliverdOrderResModel {
String patientID;
bool patientOutSA;
int channel;
dynamic distanceInKilometers;
double distanceInKilometers;
List<ItemsQuantitiesList> itemsQuantitiesList;
DeliverdOrderResModel(
@ -135,7 +135,7 @@ class ItemsQuantitiesList {
String itemName;
String itemNameN;
int productID;
var quantity;
int quantity;
ItemsQuantitiesList(
{this.itemName, this.itemNameN, this.productID, this.quantity});

@ -9,26 +9,24 @@ class PendingOrders {
String firstName;
String lastName;
String mobileNumber;
dynamic distanceInKilometers;
int distanceInKilometers;
String longitude;
String latitude;
int driverAppPageID;
PendingOrders(
{this.driverID,
this.searchKey,
this.pageSize,
this.pageIndex,
this.tokenID,
this.userID,
this.mobileNo,
this.firstName,
this.lastName,
PendingOrders({
this.driverID,
this.searchKey,
this.pageSize,
this.pageIndex,
this.tokenID,
this.userID,
this.mobileNo,
this.firstName,
this.lastName,
this.mobileNumber,
this.distanceInKilometers,
this.longitude,
this.latitude,
this.driverAppPageID
});
PendingOrders.fromJson(Map<String, dynamic> json) {
@ -43,7 +41,6 @@ class PendingOrders {
lastName = json['LastName'];
mobileNumber = json['MobileNumber'];
distanceInKilometers = json['DistanceInKilometers'];
driverAppPageID = json['DriverAppPageID'];
}
Map<String, dynamic> toJson() {
@ -57,7 +54,7 @@ class PendingOrders {
data['MobileNo'] = this.mobileNo;
data['Longitude'] = this.longitude;
data['Latitude'] = this.latitude;
data['DriverAppPageID'] = this.driverAppPageID;
return data;
}
}

@ -27,11 +27,6 @@ class PendingOrdersRes {
dynamic distanceInKilometers;
List<ItemsQuantitiesList> itemsQuantitiesList;
String receiverFullName(){
var fullName = "${firstName ?? ''} ${middleName ?? ''} ${lastName ?? ''}";
return fullName;
}
PendingOrdersRes(
{this.rowID,
this.orderID,

@ -1,23 +0,0 @@
import 'package:driverapp/config/shared_pref_kay.dart';
import 'package:driverapp/core/model/authentication/authenticated_user.dart';
import 'package:driverapp/uitl/app_shared_preferences.dart';
import 'package:location/location.dart';
class RequestUpdateDriverLocation{
int orderID = 0;
LocationData location;
RequestUpdateDriverLocation({this.orderID,this.location});
Future<Map<String, dynamic>> toJson() async{
final Map<String, dynamic> data = new Map<String, dynamic>();
data['OrderID'] = this.orderID;
data['Latitude'] = "${this.location.latitude}";
data['Longitude'] = "${this.location.longitude}";
Map profile = await AppSharedPreferences().getObject(USER_PROFILE);
AuthenticatedUser doctorProfile = AuthenticatedUser.fromJson(profile);
data['DriverID'] = doctorProfile?.iD;
data['UserID'] = '${doctorProfile?.iD}';
return data;
}
}

@ -9,9 +9,6 @@ class AuthenticationService extends BaseService {
bool isLoading = true;
AuthenticatedUser authenticatedUser;
String token;
String loginTokenId;
String tokenID;
int userID;
AuthenticationService() {
// getUserAuthentication();
@ -35,67 +32,4 @@ class AuthenticationService extends BaseService {
throw error;
}
}
getOpt(int driverId) async {
hasError = false;
userID = driverId;
try {
await baseAppClient.post(GET_OPT,
onSuccess: (dynamic response, int statusCode) {
loginTokenId = response['LogInTokenID'];
print(response['ActivationCode']);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {"DriverID": driverId});
} catch (error) {
hasError = true;
super.error = error;
throw error;
}
}
changePassword(String password, String confirmPassword) async {
hasError = false;
try {
await baseAppClient.post(CHANGE_FORGOT_PASSWORD,
onSuccess: (dynamic response, int statusCode) {
loginTokenId = response['LogInTokenID'];
print(response['ActivationCode']);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {
"TokenID": tokenID,
"NewPassword": password,
"ConfirmPassword": confirmPassword,
"UserID": userID
});
} catch (error) {
hasError = true;
super.error = error;
throw error;
}
}
checkActivationCode(int activationCode) async {
hasError = false;
try {
await baseAppClient.post(CHECK_ACTIVATION_CODE,
onSuccess: (dynamic response, int statusCode) {
tokenID = response['TokenID'];
print(response['ActivationCode']);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {
"LogInTokenID": loginTokenId,
"activationCode": activationCode
});
} catch (error) {
hasError = true;
super.error = error;
throw error;
}
}
}

@ -16,23 +16,21 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
/// body: null);
class BaseAppClient {
String _Statictoken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9";
post(
String endPoint, {
Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure}) async {
post(
String endPoint, {
Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
}) async {
String url = BASE_URL + endPoint;
try {
Map profile = await sharedPref.getObject(USER_PROFILE);
String token = await sharedPref.getString(TOKEN);
if (profile != null) {
AuthenticatedUser doctorProfile = AuthenticatedUser.fromJson(profile);
if(!body.keys.contains('DriverID') || body['DriverID'] == null)
body['DriverID'] = doctorProfile?.userID;
if(!body.keys.contains('UserID') || body['UserID'] == null)
body['UserID'] = '${doctorProfile?.userID}';
body['DriverID'] = doctorProfile?.userID;
body['CreatedBy'] = doctorProfile?.userID;
body['UserID'] = '${doctorProfile?.userID}';
body['TokenID'] = token;
body['MobileNo'] = doctorProfile?.mobileNumber;
}
@ -47,8 +45,7 @@ class BaseAppClient {
body: json.encode(body),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Statictoken': _Statictoken
'Accept': 'application/json'
});
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400 || json == null) {
@ -59,11 +56,11 @@ class BaseAppClient {
// await helpers.logout();
//helpers.showErrorToast('Your session expired Please login agian');
// TODO create logout fun
onFailure("Unauthorized", 401);
} else if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode);
} else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
}
}
} else {
@ -74,66 +71,4 @@ class BaseAppClient {
onFailure(e.toString(), -1);
}
}
get(
String endPoint, {
Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure}) async {
String url = BASE_URL + endPoint;
try {
if (await Utils.checkConnection()) {
final response = await http.get(url,
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Statictoken': _Statictoken
});
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode);
} else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
} catch (e) {
print(e);
onFailure(e.toString(), -1);
}
}
simpleGet(
String url,
{ Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure}) async {
try {
if (await Utils.checkConnection()) {
final response = await http.get(url,
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Statictoken': _Statictoken
});
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400) {
onFailure('Error While Fetching data', statusCode);
} else {
onSuccess(response.body, statusCode);
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
} catch (e) {
print(e);
onFailure(e.toString(), -1);
}
}
}

@ -1,141 +0,0 @@
import 'dart:collection';
import 'dart:math';
import 'package:driverapp/config/config.dart';
import 'package:driverapp/config/shared_pref_kay.dart';
import 'package:driverapp/core/model/StatusModel.dart';
import 'package:driverapp/core/model/order_delivey/request_initiate_order_delivery.dart';
import 'package:driverapp/core/model/order_delivey/request_validate_delivery.dart';
import 'package:driverapp/core/model/orders/pending_orders_res_model.dart';
import 'package:driverapp/core/model/update_driver_location/request_update_driver_location.dart';
import 'package:driverapp/core/service/base_service.dart';
import 'package:driverapp/uitl/app_shared_preferences.dart';
import 'package:driverapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:latlong/latlong.dart';
import 'package:location/location.dart';
import 'package:shared_preferences/shared_preferences.dart';
class DeliveryTrackingServices extends BaseService {
var _distanceFilter = 20; // [Meters] (Call update API if distance covered from last location is greater then 'value' )
Future<ResponseModel> initiateOrderDelivery(PendingOrdersRes order) async {
hasError = false;
var testNumber = "";
ResponseModel result;
// var orderRequest = RequestInitiateOrderDelivery(orderNo: order.ePharmacyOrderNo, mobileNumber: testNumber == "" ? order.mobileNumber : testNumber);
var fullUrl = BASE_URL + INITIATE_DELIVERY + "/${order.ePharmacyOrderNo}/${user.iD}";
await baseAppClient.simpleGet(fullUrl,
onSuccess: (dynamic response, int statusCode) {
result = ResponseModel(isSuccessful: true,message: null, data: response);
startLocationUpdate(order.ePharmacyOrderNo);
}, onFailure: (String error, int statusCode) {
result = ResponseModel(isSuccessful: false,message: error,data: null);
});
return result;
}
Future<ResponseModel> validateDelivery(PendingOrdersRes order, String pinCode) async{
hasError = false;
var request = RequestValidateDelivery(orderNo: order.ePharmacyOrderNo, pinCode: pinCode);
ResponseModel result;
await baseAppClient.post(VERIFY_DELIVERY,
onSuccess: (dynamic response, int statusCode) {
result = ResponseModel(isSuccessful: true,message: null, data: response);
}, onFailure: (String error, int statusCode) {
result = ResponseModel(isSuccessful: false,message: error,data: null);
}, body: request.toJson());
return result;
}
_updateDriverLocation(int orderID, LocationData location) async {
if(location != null){
debugPrint("Updating driver location");
var jsonBody = await RequestUpdateDriverLocation(orderID: orderID, location: location).toJson();
await baseAppClient.post(UPDATE_DRIVER_LOCATION,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String errorMessage, int statusCode) {
if(statusCode == 200){
// Server responded but check failed (stop updating location)
// stopLocationUpdate(orderID);
// Show error message that you received in response
}
}, body: jsonBody);
}
}
Map _currentRunnings = Map<String,Future>();
Future<Object> startLocationUpdate(int orderID, {int frequencyInSeconds = 3}) async {
if (_currentRunnings[orderID.toString()] == null){
_currentRunnings[orderID.toString()] = Future.doWhile(() async{
await Future.delayed(Duration(seconds: frequencyInSeconds));
var valid = _currentRunnings.containsKey(orderID.toString());
if(valid){
Utils.possibleToGetLocation((value) async{
if(value){
var location = await Utils.getLocation();
if (_haveEnoughLocationUpdate(location))
await _updateDriverLocation(orderID, location);
}
});
}
return valid;
});
}
SharedPreferences.getInstance().then((pref){
pref.setStringList(ACTIVE_DELIVERIES, _currentRunnings.keys.toList());
});
}
bool isActiveDeliveringOrder(int ePharmacyOrderNo){
return _currentRunnings.containsKey(ePharmacyOrderNo.toString());
}
List<String> getActiveDeliveringOrders(){
return _currentRunnings.keys.toList(growable: false);
}
setActiveDeliveringOrders(List<String> orders){
orders.forEach((element) {
if(!_currentRunnings.containsKey(element)){
_currentRunnings[element] = null;
}
});
}
clearActiveDeliveringOrders(){
_currentRunnings.clear();
SharedPreferences.getInstance().then((pref){
pref.setStringList(ACTIVE_DELIVERIES, _currentRunnings.keys.toList());
});
}
stopLocationUpdate(int orderID){
_currentRunnings.remove(orderID.toString());
SharedPreferences.getInstance().then((pref){
pref.setStringList(ACTIVE_DELIVERIES, _currentRunnings.keys.toList());
});
}
LocationData _lastLocation;
bool _haveEnoughLocationUpdate(LocationData location){
_lastLocation = _lastLocation ?? location;
var distanceCovered = Utils.distanceBetween(_lastLocation, location, LengthUnit.Meter);
// debugPrint("distance: $distanceCovered");
return (distanceCovered > _distanceFilter);
}
}

@ -1,92 +1,73 @@
import 'package:driverapp/config/config.dart';
import 'package:driverapp/core/model/orders/deliverd_order_res_model.dart';
import 'package:driverapp/core/model/orders/next_order_request_model.dart';
import 'package:driverapp/core/model/orders/pending_orders_req_model.dart';
import 'package:driverapp/core/model/orders/pending_orders_res_model.dart';
import 'package:driverapp/core/model/orders/update_order_status_request_model.dart';
import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart';
import 'package:driverapp/core/service/base_service.dart';
import 'package:driverapp/core/model/orders/deliverd_order_req_model.dart';
import 'package:driverapp/uitl/utils.dart';
import 'package:location/location.dart';
import 'package:driverapp/core/model/orders/deliverd_order_res_model.dart';
class OrdersService extends BaseService {
List<PendingOrdersRes> _orders = List();
List<PendingOrdersRes> _nextOrdersList = List();
List<DeliverdOrderResModel> _deliveredOrderList = List();
List<DeliverdOrderResModel> _deliverdOrderList = List();
List<PendingOrdersRes> get orders => _orders;
List<DeliverdOrderResModel> get deliveredOrderList => _deliveredOrderList;
List<DeliverdOrderResModel> get deliverdOrderList => _deliverdOrderList;
List<PendingOrdersRes> get nextOrdersList => _nextOrdersList;
bool isOrderInserted;
bool isOrderStatusUpdated;
int listCountDelivered;
int listCountUnDelivered;
Future getPendingOrders(int driverAppPageID) async {
LocationData loc = await Utils.getLocation();
if (loc != null) {
PendingOrders _requestGetPendingOrders = PendingOrders(
searchKey: "",
pageSize: 0,
pageIndex: 0,
latitude: loc.latitude.toString(),
longitude: loc.longitude.toString(),
driverAppPageID: driverAppPageID);
hasError = false;
try {
await baseAppClient.post(GET_ALL_ORDERS,
onSuccess: (dynamic response, int statusCode) {
_orders.clear();
response['PatientER_Delivery_GetAllOrderList'].forEach((order) {
_orders.add(PendingOrdersRes.fromJson(order));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestGetPendingOrders.toJson());
} catch (e) {
hasError = true;
super.error = error;
throw e;
}
}
// }
}
DeliverdOrderModel _requestGetDeliverdOrders = DeliverdOrderModel(
searchKey: "",
pageSize: 0,
pageIndex: 0,
latitude: "24.640000",
longitude: "46.753000",
);
Future insertOrder(ScanQrRequestModel _scanQrRequestModel) async {
Future getPendingOrders() async {
LocationData loc = await Utils.getLocation();
PendingOrders _requestGetPendingOrders = PendingOrders(
searchKey: "",
pageSize: 0,
pageIndex: 0,
latitude: loc.latitude.toString(),
longitude: loc.longitude.toString(),
);
hasError = false;
try {
await baseAppClient.post(SCAN_QR,
await baseAppClient.post(GET_ALL_ORDERS,
onSuccess: (dynamic response, int statusCode) {
isOrderInserted = response["PatientER_Delivery_IsOrderInserted"];
listCountUnDelivered++;
_orders.clear();
response['PatientER_Delivery_GetAllOrderList'].forEach((order) {
_orders.add(PendingOrdersRes.fromJson(order));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _scanQrRequestModel.toJson());
}, body: _requestGetPendingOrders.toJson());
} catch (e) {
hasError = true;
super.error = error;
throw e;
}
}
Future getOrdersStatus() async {
Future insertOrder(ScanQrRequestModel _scanQrRequestModel) async {
hasError = false;
try {
await baseAppClient.post(GET_ALL_ORDERS_STATUS,
await baseAppClient.post(SCAN_QR,
onSuccess: (dynamic response, int statusCode) {
listCountDelivered =
response["PatientER_CountOrderList"][0]["NumberOfDeliveredOrder"];
listCountUnDelivered =
response["PatientER_CountOrderList"][0]["NumberOfUnDeliveredOrder"];
isOrderInserted = response["PatientER_Delivery_IsOrderInserted"];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {});
}, body: _scanQrRequestModel.toJson());
} catch (e) {
hasError = true;
super.error = error;
@ -101,8 +82,6 @@ class OrdersService extends BaseService {
await baseAppClient.post(UPDATE_ORDER_STATUS,
onSuccess: (dynamic response, int statusCode) {
isOrderStatusUpdated = response["PatientER_Delivery_IsOrderUpdated"];
listCountUnDelivered--;
listCountDelivered++;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -133,35 +112,32 @@ class OrdersService extends BaseService {
}
}
Future getDeliveredList() async {
Future getDeliverdList() async {
LocationData loc = await Utils.getLocation();
PendingOrders _requestGetPendingOrders = PendingOrders(
searchKey: "",
pageSize: 0,
pageIndex: 0,
latitude: loc.latitude.toString(),
longitude: loc.longitude.toString(),
driverAppPageID: 0);
if (loc != null) {
hasError = false;
try {
await baseAppClient.post(GET_ALL_DELIVERD_ORDER,
onSuccess: (dynamic response, int statusCode) {
_deliveredOrderList.clear();
response['PatientER_Delivery_GetAllDeliverdOrderList']
.forEach((order) {
_deliveredOrderList.add(DeliverdOrderResModel.fromJson(order));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestGetPendingOrders.toJson());
} catch (e) {
searchKey: "",
pageSize: 0,
pageIndex: 0,
latitude: loc.latitude.toString(),
longitude: loc.longitude.toString(),
);
hasError = false;
try {
await baseAppClient.post(GET_ALL_DELIVERD_ORDER,
onSuccess: (dynamic response, int statusCode) {
_deliverdOrderList.clear();
response['PatientER_Delivery_GetAllDeliverdOrderList'].forEach((order) {
_deliverdOrderList.add(DeliverdOrderResModel.fromJson(order));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestGetPendingOrders.toJson());
} catch (e) {
hasError = true;
super.error = error;
throw e;
}
throw e;
}
}
}

@ -13,7 +13,6 @@ class AuthenticationViewModel with ChangeNotifier {
AuthenticationService _authenticationService =
locator<AuthenticationService>();
AuthenticatedUser user;
int get userId => _authenticationService.userID;
bool isLogin = false;
bool isLoading = false;
bool isError = false;
@ -81,54 +80,6 @@ class AuthenticationViewModel with ChangeNotifier {
}
}
getOpt(int driverID) async {
isLoading = true;
notifyListeners();
await _authenticationService.getOpt(driverID);
if (_authenticationService.hasError) {
error = _authenticationService.error;
isLoading = false;
isError = true;
notifyListeners();
} else {
isLoading = false;
isError = false;
notifyListeners();
}
}
changePassword(String password, String confirmPassword) async {
isLoading = true;
notifyListeners();
await _authenticationService.changePassword(password, confirmPassword);
if (_authenticationService.hasError) {
error = _authenticationService.error;
isLoading = false;
isError = true;
notifyListeners();
} else {
isLoading = false;
isError = false;
notifyListeners();
}
}
checkActivationCode(int driverID) async {
isLoading = true;
notifyListeners();
await _authenticationService.checkActivationCode(driverID);
if (_authenticationService.hasError) {
error = _authenticationService.error;
isLoading = false;
isError = true;
notifyListeners();
} else {
isLoading = false;
isError = false;
notifyListeners();
}
}
logout() async {
isLoading = false;
isError = false;

@ -1,36 +1,28 @@
import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/StatusModel.dart';
import 'package:driverapp/core/model/orders/deliverd_order_res_model.dart';
import 'package:driverapp/core/model/orders/deliverd_order_req_model.dart';
import 'package:driverapp/core/model/orders/next_order_request_model.dart';
import 'package:driverapp/core/model/orders/pending_orders_res_model.dart';
import 'package:driverapp/core/model/orders/update_order_status_request_model.dart';
import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart';
import 'package:driverapp/core/service/delivery_tracking_services.dart';
import 'package:driverapp/core/service/orders_service.dart';
import 'package:flutter/cupertino.dart';
import 'package:driverapp/core/model/orders/deliverd_order_res_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class OrdersViewModel extends BaseViewModel {
OrdersService _ordersService = locator<OrdersService>();
DeliveryTrackingServices deliveryService = locator<DeliveryTrackingServices>();
List<PendingOrdersRes> get orders => _ordersService.orders;
List<DeliverdOrderResModel> get deliverdOrders =>
_ordersService.deliveredOrderList;
_ordersService.deliverdOrderList;
List<PendingOrdersRes> get nextOrdersList => _ordersService.nextOrdersList;
bool isBottomSheetAppear = false;
int get listCountDelivered => _ordersService.listCountDelivered;
int get listCountUnDelivered => _ordersService.listCountUnDelivered;
Future getPendingOrders(int driverAppPageID) async {
Future getPendingOrders() async {
setState(ViewState.Busy);
await _ordersService.getPendingOrders(driverAppPageID);
await _ordersService.getPendingOrders();
if (_ordersService.hasError) {
error = _ordersService.error;
setState(ViewState.Error);
@ -38,19 +30,9 @@ class OrdersViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getOrdersStatus() async {
Future getDeliverdOrders() async {
setState(ViewState.Busy);
await _ordersService.getOrdersStatus();
if (_ordersService.hasError) {
error = _ordersService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getDeliveredOrders() async {
setState(ViewState.Busy);
await _ordersService.getDeliveredList();
await _ordersService.getDeliverdList();
if (_ordersService.hasError) {
error = _ordersService.error;
setState(ViewState.Error);
@ -68,37 +50,15 @@ class OrdersViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future<ResponseModel> updateOrderStatus({@required int orderNo, @required int status, String rejectionReason}) async {
var updateOrderStatusRequestModel
= UpdateOrderStatusRequestModel(
deliveryOrderID: orderNo,
deliveryOrderStatus: status,
rejectionReason: rejectionReason,
cancleReason: rejectionReason);
Future updateOrderStatus(
UpdateOrderStatusRequestModel updateOrderStatusRequestModel) async {
setState(ViewState.BusyLocal);
await _ordersService.updateOrderStatus(updateOrderStatusRequestModel);
if (_ordersService.hasError) {
error = _ordersService.error;
setState(ViewState.ErrorLocal);
return ResponseModel(isSuccessful: false, message: error);
} else {
} else
setState(ViewState.Idle);
if(status == 2)
moveOrderFromPendingToDelivered(orderNo);
return ResponseModel(isSuccessful: true, message: "Successful");
}
}
moveOrderFromPendingToDelivered(int orderNo) async{
var idx = orders.indexWhere((element) => element.ePharmacyOrderNo == orderNo);
var order = orders[idx];
orders.removeAt(idx);
var order_delivered = DeliverdOrderResModel.fromJson(order.toJson());
order_delivered.description = "Delivered";
order_delivered.descriptionN = "Delivered";
deliverdOrders.add(order_delivered);
}
Future nextOrder(NextOrderRequestModel nextOrderRequestModel) async {
@ -111,31 +71,6 @@ class OrdersViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future initDelivery(PendingOrdersRes order, {Function(@required ResponseModel response) completion}) async{
var response = await deliveryService.initiateOrderDelivery(order);
completion(response ?? ResponseModel(isSuccessful: false,message: "Something went wrong, Please try again later."));
return response;
// (true, response['ErrorEndUserMessage'] ?? response['ErrorMessage'] ?? "Successfully, Please start navigation.")
}
Future<ResponseModel> validateDelivery(PendingOrdersRes order, String pinCode) async{
return await deliveryService.validateDelivery(order, pinCode);
}
Future<ResponseModel> resendOtpToReceiver(PendingOrdersRes order) async{
// return await _deliveryService.validateDelivery(order, pinCode);
}
bool isActiveDeliveringOrder(int index){
return deliveryService.isActiveDeliveringOrder(orders[index].ePharmacyOrderNo);
}
Future<List<String>> getActiveDeliveringOrders() async{
return deliveryService.getActiveDeliveringOrders();
}
showBottomSheet() {
isBottomSheetAppear = true;
setState(ViewState.Idle);

@ -1,4 +1,3 @@
import 'package:driverapp/core/service/delivery_tracking_services.dart';
import 'package:get_it/get_it.dart';
import 'core/service/authentication_service.dart';
@ -16,7 +15,6 @@ void setupLocator() {
locator.registerLazySingleton(() => HospitalService());
locator.registerLazySingleton(() => AuthenticationService());
locator.registerLazySingleton(() => OrdersService());
locator.registerLazySingleton(() => DeliveryTrackingServices());
/// View Model
locator.registerFactory(() => HospitalViewModel());

@ -1,14 +1,9 @@
import 'package:driverapp/core/service/delivery_tracking_services.dart';
import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/pages/splash_screen_page.dart';
import 'package:driverapp/uitl/app_shared_preferences.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'config/shared_pref_kay.dart';
import 'config/size_config.dart';
import 'core/viewModels/authentication_view_model.dart';
import 'core/viewModels/project_view_model.dart';
@ -19,30 +14,9 @@ void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget with WidgetsBindingObserver{
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state);
if(state == AppLifecycleState.paused){
debugPrint("....App paused....");
}else if(state == AppLifecycleState.resumed){
debugPrint("....App resumed....");
}
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
WidgetsBinding.instance.addObserver(this);
SharedPreferences.getInstance().then((value){
var activeOrders = value.getStringList(ACTIVE_DELIVERIES) ?? [];
locator<DeliveryTrackingServices>().setActiveDeliveringOrders(activeOrders);
});
return LayoutBuilder(
builder: (context, constraints) {
return OrientationBuilder(
@ -56,9 +30,6 @@ class MyApp extends StatelessWidget with WidgetsBindingObserver{
ChangeNotifierProvider<AuthenticationViewModel>(
create: (context) => AuthenticationViewModel(),
),
ChangeNotifierProvider<OrdersViewModel>(
create: (context) => OrdersViewModel(),
),
],
child: Consumer<ProjectViewModel>(
builder: (context, projectProvider, child) => MaterialApp(
@ -110,9 +81,9 @@ class MyApp extends StatelessWidget with WidgetsBindingObserver{
),
),
),
// home: SplashScreenPage(),
initialRoute: '/',
routes: {'/': (context) => SplashScreenPage()},
home: SplashScreenPage(),
// initialRoute: '/',
// routes: {'/': (context) => RootPage()},
debugShowCheckedModeBanner: false,
),
),

@ -1,453 +0,0 @@
import 'package:driverapp/app-icons/driver_app_icons.dart';
import 'package:driverapp/config/config.dart';
import 'package:driverapp/config/size_config.dart';
import 'package:driverapp/core/model/authentication/login_request.dart';
import 'package:driverapp/core/model/orders/pending_orders_res_model.dart';
import 'package:driverapp/core/service/delivery_tracking_services.dart';
import 'package:driverapp/core/viewModels/authentication_view_model.dart';
import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/core/viewModels/project_view_model.dart';
import 'package:driverapp/locator.dart';
import 'package:driverapp/pages/authentication/reset_password_page.dart';
import 'package:driverapp/pages/delivery/delivery_confirmed_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/buttons/secondary_button.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
import 'package:sweetalert/sweetalert.dart';
import 'forget_password_page.dart';
// ignore: must_be_immutable
class DeliveryVerificationPage extends StatelessWidget {
final PendingOrdersRes order;
DeliveryVerificationPage({this.order});
ProjectViewModel _projectViewModel;
OrdersViewModel _ordersViewModel;
final formKey = GlobalKey<FormState>();
Map formValues = {
'digit1': null,
'digit2': null,
'digit3': null,
'digit4': null,
};
FocusNode focusD1 = FocusNode();
FocusNode focusD2 = FocusNode();
FocusNode focusD3 = FocusNode();
FocusNode focusD4 = FocusNode();
var model;
TextEditingController digit1 = TextEditingController(text: "");
TextEditingController digit2 = TextEditingController(text: "");
TextEditingController digit3 = TextEditingController(text: "");
TextEditingController digit4 = TextEditingController(text: "");
bool _isLoading = false;
SizedBox buildSizedBox([double height = 20]) {
return SizedBox(
height: height,
);
}
BuildContext _context;
@override
Widget build(BuildContext context) {
_context = context;
_projectViewModel = Provider.of(context);
_ordersViewModel = Provider.of(context);
String validateCodeDigit(value) {
if (value.isEmpty) {
return 'Please enter your Password';
}
return null;
}
return AnimatedSwitcher(
duration: Duration(milliseconds: 2000),
child: AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FractionallySizedBox(
widthFactor: 0.80,
child: Column(
children: <Widget>[
SizedBox(
height: 30,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Icon(
DriverApp.deliverd_icon,
size: 150,
color: Theme.of(context).primaryColor,
),
margin: EdgeInsets.only(
top: 20,
),
),
],
),
SizedBox(
height: 20,
),
Column(
children: <Widget>[
Center(
child: Text(
"Verification",
style: TextStyle(
fontSize: 25,
letterSpacing: 1,
fontWeight: FontWeight.w600),
),
),
],
),
SizedBox(
height: 30,
),
SizedBox(
height: 10,
),
Form(
key: formKey,
child: Container(
width: SizeConfig.realScreenWidth * 0.90,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20),
child: Row(
mainAxisAlignment:
MainAxisAlignment.end,
children: <Widget>[
Expanded(
child: Text(
TranslationBase.of(context)
.enterCustomerVerificationCodeMsg,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 13,
color: Colors.grey),
),
),
SizedBox(
height: 10,
)
],
),
),
buildSizedBox(30),
Center(
child: FractionallySizedBox(
widthFactor: 0.80,
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
children: <Widget>[
Container(
width: 55,
height: 55,
color: Colors.transparent,
child: Center(
child: TextFormField(
textInputAction:
TextInputAction.next,
style: TextStyle(
fontSize: SizeConfig
.textMultiplier *
3,
),
focusNode: focusD1,
controller: digit1,
enableInteractiveSelection: false,
showCursor: false,
maxLength: 1,
textAlign: TextAlign.center,
keyboardType:
TextInputType.number,
decoration:
buildInputDecoration(
context),
onSaved: (val) {
formValues[
'digit1'] = val;
},
validator: validateCodeDigit,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD2);
},
onChanged: (val) => val.isNotEmpty
? FocusScope.of(context).requestFocus(focusD2)
: FocusScope.of(context).requestFocus(focusD1)
),
),
),
Container(
width: 55,
height: 55,
color: Colors.transparent,
child: Center(
child: TextFormField(
focusNode: focusD2,
controller: digit2,
enableInteractiveSelection: false,
showCursor: false,
maxLength: 1,
textInputAction:
TextInputAction.next,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: SizeConfig
.textMultiplier *
3,
),
keyboardType:
TextInputType.number,
decoration:
buildInputDecoration(
context),
validator: validateCodeDigit,
onSaved: (val) {
formValues[
'digit2'] = val;
},
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD3);
},
onChanged: (val) => val.isNotEmpty
? FocusScope.of(context).requestFocus(focusD3)
: FocusScope.of(context).requestFocus(focusD1)
),
),
),
Container(
width: 55,
height: 55,
color: Colors.transparent,
child: Center(
child: TextFormField(
focusNode: focusD3,
controller: digit3,
enableInteractiveSelection: false,
showCursor: false,
maxLength: 1,
textInputAction: TextInputAction.next,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: SizeConfig
.textMultiplier * 3,
),
keyboardType:
TextInputType.number,
decoration:
buildInputDecoration(
context),
validator: validateCodeDigit,
onSaved: (val) {
formValues[
'digit3'] = val;
},
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD4);
},
onChanged: (val) => val.isNotEmpty
? FocusScope.of(context).requestFocus(focusD4)
: FocusScope.of(context).requestFocus(focusD2),
),
)),
Container(
width: 55,
height: 55,
color: Colors.transparent,
child: Center(
child: TextFormField(
focusNode: focusD4,
controller: digit4,
enableInteractiveSelection: false,
showCursor: false,
maxLength: 1,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: SizeConfig
.textMultiplier *
3,
),
keyboardType:
TextInputType.number,
decoration:
buildInputDecoration(
context),
validator: validateCodeDigit,
onSaved: (val) {
formValues[
'digit4'] = val;
},
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD4);
},
onChanged: (val) => val.isNotEmpty
? FocusScope.of(context).requestFocus(focusD4)
: FocusScope.of(context).requestFocus(focusD3)
),
),
)
],
),
),
),
buildSizedBox(20),
// ShowTimerText(model: model),
])))
],
),
),
SizedBox(
height: 20,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.all(10),
height: MediaQuery.of(context).size.height * 0.22,
child: Column(
children: <Widget>[
SecondaryButton(
label: "Verify Receiver",
onTap: () {
_verifyCustomer();
},
disabled: _isLoading,
loading: _isLoading,
),
SizedBox(
height: 10,
),
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// InkWell(
// onTap: () {
// Navigator.pushReplacement(
// context,
// MaterialPageRoute(
// builder: (context) =>
// ForgetPasswordPage()),
// );
// },
// child: InkWell(
// onTap: () async {
// await _ordersViewModel.resendOtpToReceiver(order);
// },
// child: Text(
// "Resend OPT?",
// style: TextStyle(
// fontSize: 14,
// color: Theme.of(context).primaryColor),
// ),
// ),
// ),
// ],
// ),
],
))
],
),
),
),
);
}
TextStyle buildTextStyle() {
return TextStyle(
fontSize: SizeConfig.textMultiplier * 3,
);
}
InputDecoration buildInputDecoration(BuildContext context) {
return InputDecoration(
filled: true,
fillColor: Colors.white,
// ts/images/password_icon.png
contentPadding: EdgeInsets.only(top: 30, bottom: 30),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.grey),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).primaryColor, width: 2),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor, width: 2),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor, width: 2),
),
counterText: "",
errorStyle: TextStyle(height: 0.0)
);
}
_verifyCustomer() async {
if (formKey.currentState.validate()) {
final pinCode = digit1.text + digit2.text + digit3.text + digit4.text;
formKey.currentState.save();
SweetAlert.show(_context, subtitle: "Please wait...", style: SweetAlertStyle.loading);
var results = await _ordersViewModel.validateDelivery(order, pinCode);
if (results != null && results.isSuccessful) {
results = await _ordersViewModel.updateOrderStatus(orderNo: order.orderID, status: DeliveryStatus.delivered);
popWithDelay(context: _context, seconds: 0.2, callback: (){
if(results.isSuccessful){
_goToDeliveryDoneConfirmation();
}else{
Utils.showErrorToast(results.message);
}
});
}else{
Navigator.of(_context).pop();
Utils.showErrorToast(results.message);
}
}
}
_goToDeliveryDoneConfirmation(){
locator<DeliveryTrackingServices>().stopLocationUpdate(order.ePharmacyOrderNo); // Stop Driver Location update for Order
Navigator.pushReplacement(
_context,
MaterialPageRoute(
builder: (context) => DeliveryConfirmedPage(order),
),
);
}
}

@ -1,195 +0,0 @@
import 'package:driverapp/app-icons/driver_app_icons.dart';
import 'package:driverapp/core/viewModels/authentication_view_model.dart';
import 'package:driverapp/core/viewModels/project_view_model.dart';
import 'package:driverapp/pages/authentication/verification_page.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/uitl/utils.dart';
import 'package:driverapp/widgets/buttons/secondary_button.dart';
import 'package:driverapp/widgets/input/text_field.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
import '../../root_page.dart';
// ignore: must_be_immutable
class ForgetPasswordPage extends StatelessWidget {
final forgetPasswordFormKey = GlobalKey<FormState>();
int driverID;
ProjectViewModel projectViewModel;
AuthenticationViewModel authenticationViewModel;
getOpt(BuildContext context) async {
if (forgetPasswordFormKey.currentState.validate()) {
forgetPasswordFormKey.currentState.save();
await authenticationViewModel.getOpt(driverID);
if (authenticationViewModel.isError) {
Utils.showErrorToast(authenticationViewModel.error);
} else {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => VerificationPage()),
);
}
}
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
authenticationViewModel = Provider.of(context);
return AnimatedSwitcher(
duration: Duration(microseconds: 350),
child: AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
FractionallySizedBox(
widthFactor: 0.80,
child: Column(
children: <Widget>[
SizedBox(
height: MediaQuery.of(context).size.height * 0.25,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Icon(
DriverApp.qustion_mark,
size: 150,
color: Theme.of(context).primaryColor,
),
margin: EdgeInsets.only(
top: 20,
),
),
],
),
SizedBox(
height: 20,
),
Column(
children: <Widget>[
Center(
child: Text(
"Forgot Password?",
style: TextStyle(
fontSize: 25,
letterSpacing: 1,
fontWeight: FontWeight.w600),
),
),
],
),
SizedBox(
height: 30,
),
SizedBox(
height: 10,
),
Form(
key: forgetPasswordFormKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
child: Text(
TranslationBase.of(context)
.enterForgetIdMsg,
style: TextStyle(
fontSize: 13, color: Colors.grey),
),
),
SizedBox(
height: 10,
)
],
),
),
SizedBox(
height: 10,
),
Container(
child: TextFields(
hintText: TranslationBase.of(context).enterId,
keyboardType: TextInputType.number,
validator: (value) {
if (value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterYourID;
}
return null;
},
onSaved: (value) {
driverID = int.parse(value.trim());
},
),
),
SizedBox(
height: 20,
),
],
),
),
],
),
),
SizedBox(
height: 20,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.all(10),
height: MediaQuery.of(context).size.height * 0.22,
child: Column(
children: <Widget>[
SecondaryButton(
label: TranslationBase.of(context).getOPT,
onTap: () async {
await getOpt(context);
},
disabled: authenticationViewModel.isLoading,
loading: authenticationViewModel.isLoading,
),
SizedBox(
height: 30,
),
SecondaryButton(
label: TranslationBase.of(context).cancel,
onTap: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => RootPage()),
);
},
color: Color(0xffE9F1F1),
borderColor: Colors.black54,
textColor: Theme.of(context).primaryColor,
),
],
))
],
),
),
),
),
);
}
}

@ -13,29 +13,27 @@ import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
import 'forget_password_page.dart';
class LoginPage extends StatelessWidget {
LoginRequest loginRequest = LoginRequest();
final loginFormKey = GlobalKey<FormState>();
ProjectViewModel projectViewModel;
AuthenticationViewModel authenticationViewModel;
login() async {
if (loginFormKey.currentState.validate()) {
loginFormKey.currentState.save();
await authenticationViewModel.login(loginRequest);
if (authenticationViewModel.isError) {
Utils.showErrorToast(authenticationViewModel.error);
}
}
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
authenticationViewModel = Provider.of(context);
login() async {
if (loginFormKey.currentState.validate()) {
loginFormKey.currentState.save();
await authenticationViewModel.login(loginRequest);
if (authenticationViewModel.isError) {
Utils.showErrorToast(authenticationViewModel.error);
}
}
}
return AnimatedSwitcher(
duration: Duration(microseconds: 350),
child: AppScaffold(
@ -46,66 +44,59 @@ class LoginPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
FractionallySizedBox(
widthFactor: 0.80,
child: Column(
children: <Widget>[
SizedBox(
height: 40,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Icon(
DriverApp.logo,
size: 70,
color: Theme.of(context).primaryColor,
widthFactor: 0.80,
child: Column(
children: <Widget>[
SizedBox(
height: 40,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Icon(
DriverApp.logo,
size: 70,
color: Theme.of(context).primaryColor,
),
margin: EdgeInsets.only(
right: projectViewModel.isArabic
? 0
: MediaQuery.of(context).size.width *
0.15,
left: !projectViewModel.isArabic
? 0
: MediaQuery.of(context).size.width *
0.15),
),
margin: EdgeInsets.only(
top: 20,
right: projectViewModel.isArabic
? 0
: MediaQuery
.of(context)
.size
.width *
0.15,
left: !projectViewModel.isArabic
? 0
: MediaQuery
.of(context)
.size
.width *
0.15),
),
],
),
SizedBox(
height: 20,
),
Column(
children: <Widget>[
Text(
"Driver",
style: TextStyle(
fontSize: 50, fontWeight: FontWeight.bold),
),
Text(
"Delivery",
style: TextStyle(fontSize: 36, letterSpacing: 1),
),
Text(
"APP",
style: TextStyle(
fontSize: 33,
letterSpacing: 33,
fontWeight: FontWeight.w400),
),
],
),
SizedBox(
height: 30,
),
],
),
SizedBox(
height: 20,
),
Column(
children: <Widget>[
Text(
"Driver",
style: TextStyle(
fontSize: 50, fontWeight: FontWeight.bold),
),
Text(
"Delivery",
style: TextStyle(fontSize: 36, letterSpacing: 1),
),
Text(
"APP",
style: TextStyle(
fontSize: 33,
letterSpacing: 33,
fontWeight: FontWeight.w400),
),
],
),
SizedBox(
height: 30,
),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
@ -152,48 +143,47 @@ class LoginPage extends StatelessWidget {
// : Colors.transparent),
// ],
// ),
SizedBox(
height: 10,
),
Form(
key: loginFormKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
child: Text(
TranslationBase.of(context)
.enterCredentialsMsg,
style: TextStyle(
fontSize: 13, color: Colors.grey),
SizedBox(
height: 10,
),
Form(
key: loginFormKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
child: Text(
TranslationBase.of(context)
.enterCredentialsMsg,
style: TextStyle(
fontSize: 13, color: Colors.grey),
),
),
),
SizedBox(
height: 10,
)
],
SizedBox(
height: 10,
)
],
),
),
),
SizedBox(
height: 10,
),
Container(
child: TextFields(
hintText: TranslationBase.of(context).enterId,
keyboardType: TextInputType.number,
validator: (value) {
if (value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterYourID;
}
return null;
},
SizedBox(
height: 10,
),
Container(
child: TextFields(
hintText: TranslationBase.of(context).enterId,
validator: (value) {
if (value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterYourID;
}
return null;
},
onSaved: (value) {
loginRequest.userID = int.parse(value.trim());
},
@ -206,7 +196,7 @@ class LoginPage extends StatelessWidget {
child: TextFields(
borderRadiusValue: 6,
hintText:
TranslationBase.of(context).enterPassword,
TranslationBase.of(context).enterPassword,
validator: (value) {
if (value.isEmpty) {
return TranslationBase.of(context)
@ -223,44 +213,30 @@ class LoginPage extends StatelessWidget {
SizedBox(
height: 25,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
InkWell(
onTap: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) =>
ForgetPasswordPage()
),
);
},
child: Text(
TranslationBase
.of(context)
.forgotPassword,
style: TextStyle(
fontSize: 14,
color: Theme
.of(context)
.primaryColor),
),
),
],
),
//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),
// ),
// ],
// ),
],
),
),
],
],
),
),
SizedBox(
height: 20,
),
SizedBox(
height: 10,
),
),
SizedBox(
height: 20,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.all(10),

@ -1,200 +0,0 @@
import 'package:driverapp/app-icons/driver_app_icons.dart';
import 'package:driverapp/core/viewModels/authentication_view_model.dart';
import 'package:driverapp/core/viewModels/project_view_model.dart';
import 'package:driverapp/root_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/buttons/secondary_button.dart';
import 'package:driverapp/widgets/input/text_field.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
// ignore: must_be_immutable
class RestPasswordPage extends StatelessWidget {
final forgetPasswordFormKey = GlobalKey<FormState>();
// String password;
// String confirmedPassword;
ProjectViewModel projectViewModel;
AuthenticationViewModel authenticationViewModel;
TextEditingController password = TextEditingController(text: "");
TextEditingController confirmedPassword = TextEditingController(text: "");
changePassword(BuildContext context) async {
if (forgetPasswordFormKey.currentState.validate()) {
forgetPasswordFormKey.currentState.save();
await authenticationViewModel.changePassword(
password.text, confirmedPassword.text);
if (authenticationViewModel.isError) {
Utils.showErrorToast(authenticationViewModel.error);
} else {
AppToast.showSuccessToast(
message: "Your Password changed successfully");
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => RootPage()),
);
}
}
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
authenticationViewModel = Provider.of(context);
return AnimatedSwitcher(
duration: Duration(microseconds: 350),
child: AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
FractionallySizedBox(
widthFactor: 0.80,
child: Column(
children: <Widget>[
SizedBox(
height: MediaQuery.of(context).size.height * 0.25,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Icon(
DriverApp.qustion_mark,
size: 150,
color: Theme.of(context).primaryColor,
),
margin: EdgeInsets.only(
top: 20,
),
),
],
),
SizedBox(
height: 20,
),
Column(
children: <Widget>[
Center(
child: Text(
"Rest Password",
style: TextStyle(
fontSize: 25,
letterSpacing: 1,
fontWeight: FontWeight.w600),
),
),
],
),
SizedBox(
height: 30,
),
SizedBox(
height: 10,
),
Form(
key: forgetPasswordFormKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Container(
child: TextFields(
hintText: "Password",
controller: password,
keyboardType: TextInputType.number,
validator: (value) {
if (value.isEmpty) {
return "Please enter your password";
}
return null;
},
onSaved: (value) {
// password = value;
},
),
),
SizedBox(
height: 20,
),
Container(
child: TextFields(
controller: confirmedPassword,
hintText: "Confirm Password",
keyboardType: TextInputType.text,
validator: (value) {
if (value.isEmpty) {
return "Please enter your confirm password";
}
if (confirmedPassword.text != password.text) {
return "Password your doesn't match your confirm password";
}
return null;
},
onSaved: (value) {
// confirmedPassword = value;
},
),
),
SizedBox(
height: 20,
),
],
),
),
],
),
),
SizedBox(
height: 20,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.all(10),
height: MediaQuery.of(context).size.height * 0.22,
child: Column(
children: <Widget>[
SecondaryButton(
label: "Change Password",
onTap: () async {
await changePassword(context);
},
disabled: authenticationViewModel.isLoading,
loading: authenticationViewModel.isLoading,
),
SizedBox(
height: 30,
),
SecondaryButton(
label: TranslationBase.of(context).cancel,
onTap: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => RootPage()),
);
},
color: Color(0xffE9F1F1),
borderColor: Colors.black54,
textColor: Theme.of(context).primaryColor,
),
],
))
],
),
),
),
),
);
}
}

@ -1,430 +0,0 @@
import 'package:driverapp/app-icons/driver_app_icons.dart';
import 'package:driverapp/config/size_config.dart';
import 'package:driverapp/core/model/authentication/login_request.dart';
import 'package:driverapp/core/viewModels/authentication_view_model.dart';
import 'package:driverapp/core/viewModels/project_view_model.dart';
import 'package:driverapp/pages/authentication/reset_password_page.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/uitl/utils.dart';
import 'package:driverapp/widgets/buttons/secondary_button.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
import 'forget_password_page.dart';
// ignore: must_be_immutable
class VerificationPage extends StatelessWidget {
LoginRequest loginRequest = LoginRequest();
final loginFormKey = GlobalKey<FormState>();
ProjectViewModel projectViewModel;
AuthenticationViewModel authenticationViewModel;
final verifyAccountForm = GlobalKey<FormState>();
Map verifyAccountFormValue = {
'digit1': null,
'digit2': null,
'digit3': null,
'digit4': null,
};
FocusNode focusD1 = FocusNode();
FocusNode focusD2 = FocusNode();
FocusNode focusD3 = FocusNode();
FocusNode focusD4 = FocusNode();
var model;
TextEditingController digit1 = TextEditingController(text: "");
TextEditingController digit2 = TextEditingController(text: "");
TextEditingController digit3 = TextEditingController(text: "");
TextEditingController digit4 = TextEditingController(text: "");
login() async {
if (loginFormKey.currentState.validate()) {
loginFormKey.currentState.save();
await authenticationViewModel.login(loginRequest);
if (authenticationViewModel.isError) {
Utils.showErrorToast(authenticationViewModel.error);
}
}
}
SizedBox buildSizedBox([double height = 20]) {
return SizedBox(
height: height,
);
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
authenticationViewModel = Provider.of(context);
// focusD1 = FocusNode();
// focusD2 = FocusNode();
// focusD3 = FocusNode();
// focusD4 = FocusNode();
String validateCodeDigit(value) {
if (value.isEmpty) {
return 'Please enter your Password';
}
return null;
}
return AnimatedSwitcher(
duration: Duration(microseconds: 350),
child: AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
FractionallySizedBox(
widthFactor: 0.80,
child: Column(
children: <Widget>[
SizedBox(
height: MediaQuery.of(context).size.height * 0.25,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Icon(
DriverApp.exclamation_mark,
size: 150,
color: Theme.of(context).primaryColor,
),
margin: EdgeInsets.only(
top: 20,
),
),
],
),
SizedBox(
height: 20,
),
Column(
children: <Widget>[
Center(
child: Text(
"Verification",
style: TextStyle(
fontSize: 25,
letterSpacing: 1,
fontWeight: FontWeight.w600),
),
),
],
),
SizedBox(
height: 30,
),
SizedBox(
height: 10,
),
Form(
key: verifyAccountForm,
child: Container(
width: SizeConfig.realScreenWidth * 0.90,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20),
child: Row(
mainAxisAlignment:
MainAxisAlignment.end,
children: <Widget>[
Expanded(
child: Text(
TranslationBase.of(context)
.enterVerificationMsg,
style: TextStyle(
fontSize: 13,
color: Colors.grey),
),
),
SizedBox(
height: 10,
)
],
),
),
buildSizedBox(30),
Center(
child: FractionallySizedBox(
widthFactor: 0.80,
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
children: <Widget>[
Container(
width: 55,
height: 55,
color: Colors.white,
child: TextFormField(
textInputAction:
TextInputAction.next,
style: TextStyle(
fontSize: SizeConfig
.textMultiplier *
3,
),
focusNode: focusD1,
controller: digit1,
textAlign: TextAlign.center,
keyboardType:
TextInputType.number,
decoration:
buildInputDecoration(
context),
onSaved: (val) {
verifyAccountFormValue[
'digit1'] = val;
},
validator: validateCodeDigit,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD2);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(focusD2);
}
},
),
),
Container(
width: 55,
height: 55,
color: Colors.white,
child: TextFormField(
focusNode: focusD2,
controller: digit2,
textInputAction:
TextInputAction.next,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: SizeConfig
.textMultiplier *
3,
),
keyboardType:
TextInputType.number,
decoration:
buildInputDecoration(
context),
validator: validateCodeDigit,
onSaved: (val) {
verifyAccountFormValue[
'digit2'] = val;
},
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD3);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(focusD3);
}
},
),
),
Container(
width: 55,
height: 55,
color: Colors.white,
child: TextFormField(
focusNode: focusD3,
controller: digit3,
textInputAction:
TextInputAction.next,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: SizeConfig
.textMultiplier *
3,
),
keyboardType:
TextInputType.number,
decoration:
buildInputDecoration(
context),
validator: validateCodeDigit,
onSaved: (val) {
verifyAccountFormValue[
'digit3'] = val;
},
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD4);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(
focusD4);
}
},
)),
Container(
width: 55,
height: 55,
color: Colors.white,
child: TextFormField(
focusNode: focusD4,
controller: digit4,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: SizeConfig
.textMultiplier *
3,
),
keyboardType:
TextInputType.number,
decoration:
buildInputDecoration(
context),
validator: validateCodeDigit,
onSaved: (val) {
verifyAccountFormValue[
'digit4'] = val;
},
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD4);
submit(model, context);
},
onChanged: (val) {
if (val.length == 1) {
FocusScope.of(context)
.requestFocus(
focusD4);
submit(model, context);
}
}),
)
],
),
),
),
buildSizedBox(20),
// ShowTimerText(model: model),
])))
],
),
),
SizedBox(
height: 20,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.all(10),
height: MediaQuery.of(context).size.height * 0.22,
child: Column(
children: <Widget>[
SecondaryButton(
label: "Verify",
onTap: () {
submit(model, context);
},
disabled: authenticationViewModel.isLoading,
loading: authenticationViewModel.isLoading,
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
InkWell(
onTap: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) =>
ForgetPasswordPage()),
);
},
child: InkWell(
onTap: () async {
await authenticationViewModel
.getOpt(authenticationViewModel.userId);
},
child: Text(
"Resend OPT?",
style: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor),
),
),
),
],
),
],
))
],
),
),
),
),
);
}
TextStyle buildTextStyle() {
return TextStyle(
fontSize: SizeConfig.textMultiplier * 3,
);
}
InputDecoration buildInputDecoration(BuildContext context) {
return InputDecoration(
// ts/images/password_icon.png
contentPadding: EdgeInsets.only(top: 30, bottom: 30),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.black),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).primaryColor),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
);
}
void submit(AuthenticationViewModel model, BuildContext context) async {
if (verifyAccountForm.currentState.validate()) {
final activationCode =
digit1.text + digit2.text + digit3.text + digit4.text;
await authenticationViewModel
.checkActivationCode(int.parse(activationCode));
if (authenticationViewModel.isError) {
Utils.showErrorToast(authenticationViewModel.error);
} else {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => RestPasswordPage()),
);
}
}
}
}

File diff suppressed because it is too large Load Diff

@ -1,242 +0,0 @@
import 'package:driverapp/config/config.dart';
import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/orders/next_order_request_model.dart';
import 'package:driverapp/core/model/orders/pending_orders_res_model.dart';
import 'package:driverapp/core/service/orders_service.dart';
import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/locator.dart';
import 'package:driverapp/pages/base/base_view.dart';
import 'package:driverapp/root_page.dart';
import 'package:driverapp/uitl/utils.dart';
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';
import 'package:location/location.dart';
import '../../uitl/translations_delegate_base.dart';
import '../../widgets/others/app_scaffold_widget.dart';
import 'information_page.dart';
class DeliveryCancelRejectedPage extends StatelessWidget {
final PendingOrdersRes item;
DeliveryCancelRejectedPage(this.item);
@override
Widget build(BuildContext context) {
return BaseView<OrdersViewModel>(
builder: (_, model, w) => AppScaffold(
isAppBarGradient: true,
isShowAppBar: true,
appBarColor: Theme.of(context).primaryColor,
arrowColor: Colors.white,
titleColor: Colors.white,
body: SafeArea(
child: Container(
//
child: ListView(
children: <Widget>[
Stack(
children: <Widget>[
Container(
decoration: BoxDecoration(gradient: LINEAR_GRADIENT),
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.width * 1
: MediaQuery.of(context).size.width * 1,
child: Stack(
children: [
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.width * 0.7
: MediaQuery.of(context).size.width * 0.5,
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.width * 0.14,
),
decoration: BoxDecoration(
color: Colors.white10, shape: BoxShape.circle),
child: Column(
children: <Widget>[
Icon(
Icons.check_circle,
color: Colors.white,
size: 75,
),
SizedBox(
height:
MediaQuery.of(context).size.width * 0.03,
),
Text(
'Delivery Confirmed',
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold),
),
SizedBox(
height:
MediaQuery.of(context).size.width * 0.01,
),
Text(
TranslationBase.of(context).confirmationSent,
style: TextStyle(
color: Colors.white,
fontSize: 13,
),
),
],
),
),
],
),
),
// Container(
// width: MediaQuery.of(context).size.width,
// height: MediaQuery.of(context).size.width,
// ),
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).orientation ==
Orientation.landscape
? MediaQuery.of(context).size.width * 0.6
: MediaQuery.of(context).size.width * 1.0,
margin: EdgeInsets.only(
top: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.width * 0.70
: MediaQuery.of(context).size.width * 0.60,
),
decoration: BoxDecoration(
color: Theme
.of(context)
.scaffoldBackgroundColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
topRight: Radius.circular(80)),
),
child: Column(
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.00,
),
child: Padding(
padding: MediaQuery.of(context).orientation ==
Orientation.landscape
? EdgeInsets.only(top: 60.0)
: EdgeInsets.only(top: 30.0),
child: Column(
children: <Widget>[
// TODO return add note when its needed
// FlatButton.icon(
// padding: EdgeInsets.all(14.0),
// color: Colors.orangeAccent,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10.0),
// ),
// label: Text(
// TranslationBase.of(context).addNoteBtn,
// style: TextStyle(
// color: Colors.white, fontSize: 20.0),
// ),
// icon: Icon(
// Icons.mode_edit,
// color: Colors.white,
// ),
// onPressed: () {},
// ),
// SizedBox(
// height: MediaQuery.of(context).size.width *
// 0.00, //20,
// ),
Padding(
padding: const EdgeInsets.only(top: 30.0),
child: Container(
margin: EdgeInsets.all(10),
child: SecondaryButton(
label: TranslationBase.of(context)
.nextDelivery,
loading:
model.state == ViewState.BusyLocal,
onTap: () {
getNextOrder(context, model);
},
),
),
),
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(
top: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.width * 0.6
: MediaQuery.of(context).size.width * 0.4,
),
child: CustomerBriefCard(
customerOrderId: item.orderID,
pharmacyOrderId: item.ePharmacyOrderNo,
customerFirstName: item.firstName,
customerLastName: item.lastName,
mobileNo: item.mobileNumber,
totalPayment: item.amount,
distanceInKilometers: item.distanceInKilometers,
showDistance: false,
deliveryTime: item.orderCreatedOn),
),
],
),
],
),
),
),
),
);
}
getNextOrder(BuildContext context, OrdersViewModel model) async {
model.setState(ViewState.BusyLocal);
LocationData loc = await Utils.getLocation();
NextOrderRequestModel nextOrderRequestModel = NextOrderRequestModel(
pageIndex: 0,
pageSize: 0,
latitude: loc.latitude.toString(), // "46.621730",
longitude: loc.longitude.toString(), // "24.797682",
searchKey: "");
await model.nextOrder(nextOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
if (model.nextOrdersList != null && model.nextOrdersList.length == 0) {
Utils.showErrorToast("No Items in the list");
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => RootPage(),
),
);
} else {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) =>
InformationPage(item: model.nextOrdersList[0]),
),
);
}
}
}
}

@ -1,12 +1,9 @@
import 'package:driverapp/config/config.dart';
import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/orders/next_order_request_model.dart';
import 'package:driverapp/core/model/orders/pending_orders_res_model.dart';
import 'package:driverapp/core/service/orders_service.dart';
import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/locator.dart';
import 'package:driverapp/pages/base/base_view.dart';
import 'package:driverapp/root_page.dart';
import 'package:driverapp/pages/delivery/information_page.dart';
import 'package:driverapp/uitl/utils.dart';
import 'package:driverapp/widgets/buttons/secondary_button.dart';
import 'package:driverapp/widgets/delivery/customer_brief_card.dart';
@ -16,7 +13,6 @@ import 'package:location/location.dart';
import '../../uitl/translations_delegate_base.dart';
import '../../widgets/others/app_scaffold_widget.dart';
import 'information_page.dart';
class DeliveryConfirmedPage extends StatelessWidget {
final PendingOrdersRes item;
@ -27,71 +23,70 @@ class DeliveryConfirmedPage extends StatelessWidget {
Widget build(BuildContext context) {
return BaseView<OrdersViewModel>(
builder: (_, model, w) => AppScaffold(
isAppBarGradient: true,
isShowAppBar: true,
appBarColor: Theme.of(context).primaryColor,
arrowColor: Colors.white,
titleColor: Colors.white,
body: SafeArea(
child: Container(
//
color: Theme.of(context).primaryColor,
child: ListView(
children: <Widget>[
Stack(
children: <Widget>[
Container(
decoration: BoxDecoration(gradient: LINEAR_GRADIENT),
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.width * 1
: MediaQuery.of(context).size.width * 1,
child: Stack(
children: [
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.width * 0.7
: MediaQuery.of(context).size.width * 0.5,
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.width * 0.14,
),
decoration: BoxDecoration(
color: Colors.white10, shape: BoxShape.circle),
child: Column(
children: <Widget>[
Icon(
Icons.check_circle,
color: Colors.white,
size: 75,
Column(
children: <Widget>[
Container(
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width * 0.7,
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.width * 0.12,
),
SizedBox(
height:
MediaQuery.of(context).size.width * 0.03,
),
Text(
'Delivery Confirmed',
style: TextStyle(
decoration: BoxDecoration(
color: Colors.white10,
shape: BoxShape.circle),
child: Column(
children: <Widget>[
Icon(
Icons.check_circle,
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold),
),
SizedBox(
height:
MediaQuery.of(context).size.width * 0.01,
),
Text(
TranslationBase.of(context).confirmationSent,
style: TextStyle(
color: Colors.white,
fontSize: 13,
),
size: 75,
),
SizedBox(
height:
MediaQuery.of(context).size.width *
0.03,
),
Text(
TranslationBase.of(context).deliveryInfo,
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold),
),
SizedBox(
height:
MediaQuery.of(context).size.width *
0.01,
),
Text(
TranslationBase.of(context)
.confirmationSent,
style: TextStyle(
color: Colors.white,
fontSize: 13,
),
),
],
),
],
),
),
],
),
],
),
),
],
),
// Container(
// width: MediaQuery.of(context).size.width,
@ -99,20 +94,12 @@ class DeliveryConfirmedPage extends StatelessWidget {
// ),
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).orientation ==
Orientation.landscape
? MediaQuery.of(context).size.width * 0.6
: MediaQuery.of(context).size.width * 1.0,
height: MediaQuery.of(context).size.width * 1.0,
margin: EdgeInsets.only(
top: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.width * 0.70
: MediaQuery.of(context).size.width * 0.60,
top: MediaQuery.of(context).size.width * 0.75,
),
decoration: BoxDecoration(
color: Theme
.of(context)
.scaffoldBackgroundColor,
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
topRight: Radius.circular(80)),
@ -128,52 +115,41 @@ class DeliveryConfirmedPage extends StatelessWidget {
margin: EdgeInsets.only(
bottom: MediaQuery.of(context).size.width * 0.00,
),
child: Padding(
padding: MediaQuery.of(context).orientation ==
Orientation.landscape
? EdgeInsets.only(top: 60.0)
: EdgeInsets.only(top: 30.0),
child: Column(
children: <Widget>[
// TODO return add note when its needed
// FlatButton.icon(
// padding: EdgeInsets.all(14.0),
// color: Colors.orangeAccent,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10.0),
// ),
// label: Text(
// TranslationBase.of(context).addNoteBtn,
// style: TextStyle(
// color: Colors.white, fontSize: 20.0),
// ),
// icon: Icon(
// Icons.mode_edit,
// color: Colors.white,
// ),
// onPressed: () {},
// ),
// SizedBox(
// height: MediaQuery.of(context).size.width *
// 0.00, //20,
// ),
Padding(
padding: const EdgeInsets.only(top: 30.0),
child: Container(
margin: EdgeInsets.all(10),
child: SecondaryButton(
label: TranslationBase.of(context)
.nextDelivery,
loading:
model.state == ViewState.BusyLocal,
onTap: () {
getNextOrder(context, model);
},
),
),
child: Column(
children: <Widget>[
FlatButton.icon(
padding: EdgeInsets.all(8),
color: Colors.orangeAccent,
shape: RoundedRectangleBorder(
borderRadius:
new BorderRadius.circular(10.0),
),
],
),
label: Text(
TranslationBase.of(context).addNoteBtn,
style: TextStyle(color: Colors.white),
),
icon: Icon(
Icons.mode_edit,
color: Colors.white,
),
onPressed: () {},
),
SizedBox(
height: MediaQuery.of(context).size.width *
0.02, //20,
),
Container(
margin: EdgeInsets.all(10),
child: SecondaryButton(
label: TranslationBase.of(context)
.nextDelivery,
loading: model.state == ViewState.BusyLocal,
onTap: () {
getNextOrder(context, model);
},
),
),
],
),
),
],
@ -181,19 +157,14 @@ class DeliveryConfirmedPage extends StatelessWidget {
),
Container(
margin: EdgeInsets.only(
top: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.width * 0.6
: MediaQuery.of(context).size.width * 0.4,
top: MediaQuery.of(context).size.width * 0.6,
),
child: CustomerBriefCard(
customerOrderId: item.orderID,
pharmacyOrderId: item.ePharmacyOrderNo,
itemId: item.orderID,
customerFirstName: item.firstName,
customerLastName: item.lastName,
mobileNo: item.mobileNumber,
totalPayment: item.amount,
distanceInKilometers: item.distanceInKilometers,
showDistance: false,
deliveryTime: item.orderCreatedOn),
),
@ -213,8 +184,10 @@ class DeliveryConfirmedPage extends StatelessWidget {
NextOrderRequestModel nextOrderRequestModel = NextOrderRequestModel(
pageIndex: 0,
pageSize: 0,
latitude: loc.latitude.toString(), // "46.621730",
longitude: loc.longitude.toString(), // "24.797682",
latitude: loc.latitude.toString(),
//"46.621730",
longitude: loc.longitude.toString(),
//"24.797682",
searchKey: "");
await model.nextOrder(nextOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
@ -222,18 +195,11 @@ class DeliveryConfirmedPage extends StatelessWidget {
} else {
if (model.nextOrdersList != null && model.nextOrdersList.length == 0) {
Utils.showErrorToast("No Items in the list");
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => RootPage(),
),
);
} else {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) =>
InformationPage(item: model.nextOrdersList[0]),
builder: (context) => InformationPage(model.nextOrdersList[0]),
),
);
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,84 @@
import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart';
import 'package:driverapp/pages/delivery/information_page.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:driverapp/widgets/drawer/app_drawer_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'home_page.dart';
class LandingPage extends StatefulWidget {
@override
_LandingPageState createState() => _LandingPageState();
}
class _LandingPageState extends State<LandingPage> {
int currentTab = 0;
PageController pageController;
_changeCurrentTab(int tab) {
setState(() {
currentTab = tab;
pageController.jumpToPage(tab);
});
}
@override
void initState() {
super.initState();
pageController = PageController(keepPage: true);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
textTheme: TextTheme(
headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text(getText(currentTab).toUpperCase()),
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.menu),
color: Colors.white,
onPressed: () => Scaffold.of(context).openDrawer(),
);
},
),
centerTitle: true,
),
drawer: SafeArea(child: AppDrawer()),
extendBody: true,
body: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: [
HomePage(),
InformationPage(null),
DeliveryConfirmedPage(null),
Container()
],
),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab),
);
}
getText(currentTab) {
switch (currentTab) {
case 0:
return TranslationBase.of(context).home;
case 1:
return 'new One';
case 2:
return TranslationBase.of(context).booking;
case 3:
return TranslationBase.of(context).mySchedule;
case 4:
return TranslationBase.of(context).services;
}
}
}

@ -1,4 +1,3 @@
import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/widgets/order/order_info_card.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
@ -17,23 +16,17 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
@override
Widget build(BuildContext context) {
return BaseView<OrdersViewModel>(
onModelReady: (model) => model.getDeliveredOrders(),
onModelReady: (model) => model.getDeliverdOrders(),
builder: (BuildContext context, OrdersViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: 'Delivered List',
baseViewModel: model,
isShowBackIcon: true,
titleColor: Colors.black,
body: Column(
children: <Widget>[
SizedBox(
height: 20,
),
if (model.state == ViewState.Idle)
model.deliverdOrders.length == 0
? Text("There's No Orders To deliver")
: SizedBox(),
NetworkBaseView(
baseViewModel: model,
child: Expanded(
@ -45,11 +38,9 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
: model.deliverdOrders.length,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 12.2),
padding: EdgeInsets.symmetric(horizontal: 12.2),
child: OrderInfoCard(
order: model.deliverdOrders[index],
showStatus: true,
onTap: () {},
));
},
),

@ -1,4 +1,3 @@
import 'package:driverapp/core/enum/viewstate.dart';
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';
@ -18,12 +17,10 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
@override
Widget build(BuildContext context) {
return BaseView<OrdersViewModel>(
onModelReady: (model) => model.getPendingOrders(2),
onModelReady: (model) => model.getPendingOrders(),
builder: (BuildContext context, OrdersViewModel model, Widget child) =>
AppScaffold(
baseViewModel: model,
isShowAppBar: true,
isShowBackIcon: true,
appBarTitle: TranslationBase.of(context).yourDeliveryQue,
titleColor: Colors.black,
body: Column(
@ -31,10 +28,6 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
SizedBox(
height: 20,
),
if (model.state == ViewState.Idle)
model.orders.length == 0
? Text("There's No Orders To deliver")
: SizedBox(),
Expanded(
child: ListView.builder(
shrinkWrap: true,
@ -49,9 +42,8 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => InformationPage(
item: model.orders[index],
)));
builder: (context) =>
InformationPage(model.orders[index])));
},
),
);

File diff suppressed because one or more lines are too long

@ -1,4 +1,3 @@
import 'package:driverapp/app-icons/driver_app_icons.dart';
import 'package:driverapp/core/viewModels/authentication_view_model.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
@ -20,133 +19,157 @@ class SettingPage extends StatelessWidget {
_authenticationViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
appBarColor: Color(0xFF1DA4AA),
appBarColor: Color(0xff30B7B9),
arrowColor: Colors.white,
titleColor: Colors.white,
isAppBarGradient: true,
isShowHomeIcon: true,
body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
gradient: LinearGradient(
// 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
),
),
child: Column(
children: <Widget>[
Container(
width: double.infinity,
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width * 0.7,
child: Column(
children: <Widget>[
Container(
width: double.infinity,
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width * 0.7,
child: CircleAvatar(
radius: 25.5,
backgroundColor: Theme.of(context).primaryColor,
child: CircleAvatar(
radius: 25.5,
backgroundColor: Theme.of(context).primaryColor,
child: CircleAvatar(
backgroundColor: Theme.of(context).primaryColor,
maxRadius: 200.0,
child: Image.asset(
'assets/images/driver.png',
height: MediaQuery.of(context).size.width * 1,
width: MediaQuery.of(context).size.width * 1,
fit: BoxFit.contain,
),
maxRadius: 200.0,
child: Image.asset(
'assets/images/driver.png',
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,
),
Container(
child: Text(
driverName,
style: TextStyle(
fontSize: 40,
fontWeight: FontWeight.w600,
color: Colors.white),
),
SizedBox(height: MediaQuery.of(context).size.width *0.05,),
Container(
child: Text(
driverName,
style: TextStyle(
fontSize: 40,
fontWeight: FontWeight.w600,
color: Colors.white
),
),
SizedBox(
height: MediaQuery.of(context).size.width * 0.05,
),
Container(
child: Text(
'ID: ${driverID.toString()}',
style: TextStyle(fontSize: 20, color: Colors.white),
),
SizedBox(height: MediaQuery.of(context).size.width *0.05,),
Container(
child: Text(
'ID: ${driverID.toString()}',
style: TextStyle(
fontSize: 20,
color: Colors.white
),
),
],
),
),
SizedBox(
height: MediaQuery.of(context).size.width * 0.1,
),
],
),
Container(
margin: EdgeInsets.only(left: 35),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
InkWell(
onTap: () async {
await _authenticationViewModel.logout();
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => RootPage()),
);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 15),
child: Row(
children: <Widget>[
Icon(
DriverApp.logout_icon,
size: 40,
color: Colors.white,
),
SizedBox(
width:
MediaQuery.of(context).size.width * 0.05,
),
Text(
TranslationBase.of(context).logout,
style: TextStyle(
fontWeight: FontWeight.w500,
color: Colors.white,
fontSize: 18),
),
SizedBox(height: MediaQuery.of(context).size.width *0.1,),
Container(
margin: EdgeInsets.only(left: 35),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
InkWell(
onTap: () async {
await _authenticationViewModel.logout();
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => RootPage()),
);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 15),
child: Row(
children: <Widget>[
Icon(
Icons.input,
size: 40,
color: Colors.white,
),
SizedBox(width: MediaQuery.of(context).size.width *0.05,),
Text(
TranslationBase.of(context).logout,
style: TextStyle(
fontWeight: FontWeight.w500,
color: Colors.white,
fontSize: 18
),
],
),
],
),
),
SizedBox(
height: MediaQuery.of(context).size.width *0.05,
child: Center(
child: Container(
margin: EdgeInsetsDirectional.only(start: 0, end: 30),
height: 1.0,
color: Colors.white,
),
),
SizedBox(
height: MediaQuery.of(context).size.width * 0.05,
child: Center(
child: Container(
margin: EdgeInsetsDirectional.only(
start: 0, end: 30),
height: 1.0,
),
],
),
),
SizedBox(height: MediaQuery.of(context).size.width*0.05,),
InkWell(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 15),
child: Row(
children: <Widget>[
Icon(
Icons.settings,
size: 40,
color: Colors.white,
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.05,
),
Text(
TranslationBase.of(context).settings,
style: TextStyle(
fontWeight: FontWeight.w500,
color: Colors.white,
fontSize: 18
),
),
],
),
),
SizedBox(
height: 10.0,
child: Center(
child: Container(
margin: EdgeInsetsDirectional.only(start: 0, end: 30),
height: 1.0,
color: Colors.white,
),
),
],
),
),
SizedBox(height: MediaQuery.of(context).size.width*0.05,),
],
),
],
),
),
],
),
],
),
),
],
),
),
);
}
}
}

@ -1,24 +1,21 @@
import 'dart:async';
import 'package:driverapp/app-icons/driver_app_icons.dart';
import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/core/viewModels/project_view_model.dart';
import 'package:driverapp/root_page.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../locator.dart';
class SplashScreenPage extends StatefulWidget {
@override
_SplashScreenPageState createState() => _SplashScreenPageState();
}
class _SplashScreenPageState extends State<SplashScreenPage> {
OrdersViewModel _ordersViewModel = locator<OrdersViewModel>();
startTime() async {
await _ordersViewModel.getOrdersStatus();
navigationPage();
var _duration = new Duration(seconds: 1);
return new Timer(_duration, navigationPage);
}
@override
@ -27,8 +24,6 @@ class _SplashScreenPageState extends State<SplashScreenPage> {
startTime();
}
//
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -36,43 +31,25 @@ class _SplashScreenPageState extends State<SplashScreenPage> {
return AppScaffold(
isShowAppBar: false,
appBarColor: Color(0xff30B7B9),
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
tileMode: TileMode.clamp, // repeats the gradient over the canvas
),
),
body: SingleChildScrollView(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
FractionallySizedBox(
widthFactor: 0.89,
widthFactor: 0.80,
child: Column(
children: <Widget>[
SizedBox(
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? 200
: 50,
height: 200,
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Icon(
DriverApp.logo,
size: MediaQuery.of(context).orientation ==
Orientation.portrait
? 120
: 70,
size: 120,
color: Colors.white,
),
margin: EdgeInsets.only(
@ -80,68 +57,42 @@ class _SplashScreenPageState extends State<SplashScreenPage> {
? 0
: MediaQuery.of(context).size.width * 0.20,
left: !projectViewModel.isArabic
? MediaQuery.of(context).orientation ==
Orientation.landscape
? MediaQuery.of(context).size.width * 0.13
: MediaQuery.of(context).size.width * 0.0
? 0
: MediaQuery.of(context).size.width * 0.10),
),
],
),
SizedBox(
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? 20
: 15,
height: 20,
),
Column(
children: <Widget>[
Text(
"Driver",
style: TextStyle(
fontSize: MediaQuery.of(context).orientation ==
Orientation.portrait
? 70
: 35,
fontSize: 70,
fontWeight: FontWeight.bold,
color: Colors.white),
),
Text(
"Delivery",
style: TextStyle(
fontSize: MediaQuery.of(context).orientation ==
Orientation.portrait
? 50
: 25,
fontSize: 50,
letterSpacing: 1,
color: Colors.white),
),
Text(
"APP",
style: TextStyle(
fontSize: MediaQuery
.of(context)
.orientation ==
Orientation.portrait
? 53
: 21,
letterSpacing:
MediaQuery
.of(context)
.orientation ==
Orientation.portrait
? 53
: 27,
fontSize: 53,
letterSpacing: 53,
color: Colors.white,
fontWeight: FontWeight.w400),
),
],
),
SizedBox(
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? 100
: 50,
height: 100,
)
],
),
@ -170,10 +121,7 @@ class _SplashScreenPageState extends State<SplashScreenPage> {
),
),
SizedBox(
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? 10
: 5,
height: 10,
)
],
),

@ -1,14 +0,0 @@
import 'dart:convert';
import 'package:shared_preferences/shared_preferences.dart';
class Logs{
static save(String log){
SharedPreferences.getInstance().then((_prefs) async{
var jsonString = _prefs.getString("LOG") ?? "[]";
var list = json.decode(jsonString) as List;
list.add("Running... ${DateTime.now()}");
_prefs.setString("LOG", json.encode(list));
});
}
}

@ -46,8 +46,7 @@ class CupertinoPickerUtils {
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
CupertinoButton(
child: Text(
TranslationBase.of(context).cancel.toUpperCase(),
child: Text(TranslationBase.of(context).cancel,
style:
TextStyle(color: Theme.of(context).primaryColor)),
onPressed: () {

@ -42,13 +42,10 @@ class TranslationBase {
String get enterId => localizedValues['enterId'][locale.languageCode];
String get pleaseEnterYourID =>
localizedValues['pleaseEnterYourID'][locale.languageCode];
String get enterPassword =>
localizedValues['enterPassword'][locale.languageCode];
String get pleaseEnterPassword =>
localizedValues['pleaseEnterPassword'][locale.languageCode];
String get english => localizedValues['english'][locale.languageCode];
String get arabic => localizedValues['arabic'][locale.languageCode];
@ -56,22 +53,10 @@ class TranslationBase {
String get enterCredentialsMsg =>
localizedValues['enterCredentialsMsg'][locale.languageCode];
String get enterForgetIdMsg =>
localizedValues['enterForgetIdMsg'][locale.languageCode];
String get enterVerificationMsg =>
localizedValues['enterVerificationMsg'][locale.languageCode];
String get enterCustomerVerificationCodeMsg =>
localizedValues['enterCustomerVerificationCodeMsg'][locale.languageCode];
String get forgotPassword =>
localizedValues['forgotPassword'][locale.languageCode];
String get login => localizedValues['login'][locale.languageCode];
String get getOPT => localizedValues['getOPT'][locale.languageCode];
String get haveGreatDay =>
localizedValues['haveGreatDay'][locale.languageCode];
@ -111,13 +96,6 @@ class TranslationBase {
String get clientReached =>
localizedValues['clientReached'][locale.languageCode];
String get startDelivery =>
localizedValues['startDelivery'][locale.languageCode];
String get deliveryOption =>
localizedValues['deliveryOption'][locale.languageCode];
String get addNoteBtn => localizedValues['addNoteBtn'][locale.languageCode];
String get nextDelivery =>
@ -143,35 +121,12 @@ class TranslationBase {
String get selectAction =>
localizedValues['selectAction'][locale.languageCode];
String get selectReason =>
localizedValues['selectReason'][locale.languageCode];
String get other =>
localizedValues['other'][locale.languageCode];
String get notReachableOnPhoneCall =>
localizedValues['notReachableOnPhoneCall'][locale.languageCode];
String get deliverLater =>
localizedValues['deliverLater'][locale.languageCode];
String get notAvailableAtlocation =>
localizedValues['notAvailableAtlocation'][locale.languageCode];
String get accident =>
localizedValues['accident'][locale.languageCode];
String get youHaveSelected =>
localizedValues['youHaveSelected'][locale.languageCode];
String get confirm => localizedValues['confirm'][locale.languageCode];
String get areYouSure => localizedValues['areYouSure'][locale.languageCode];
String get languageText =>
localizedValues['languageText'][locale.languageCode];
String get notification =>
localizedValues['notification'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,11 +1,5 @@
import 'package:app_settings/app_settings.dart';
import 'package:connectivity/connectivity.dart';
import 'package:driverapp/config/config.dart';
import 'package:driverapp/pages/setting/request_permission_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:latlong/latlong.dart';
import 'package:location/location.dart';
import 'app_shared_preferences.dart';
@ -13,22 +7,6 @@ import 'app_toast.dart';
AppSharedPreferences sharedPref = new AppSharedPreferences();
popWithDelay({@required BuildContext context, @required num seconds, @required VoidCallback callback}){
Navigator.of(context).pop();
Future.delayed(Duration(milliseconds: (seconds*1000).toInt())).then((value){
callback();
});
}
pop(BuildContext context, VoidCallback callBack){
Navigator.of(context).pop();
callBack();
}
delay(int milliseconds, VoidCallback callback){
Future.delayed(Duration(milliseconds: milliseconds)).then((value) => callback());
}
class Utils {
///show custom Error Toast
/// [message] to show for user
@ -43,7 +21,7 @@ class Utils {
/// Check The Internet Connection
static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult =
await (Connectivity().checkConnectivity());
await (Connectivity().checkConnectivity());
if ((connectivityResult == ConnectivityResult.mobile) ||
(connectivityResult == ConnectivityResult.wifi)) {
return true;
@ -65,80 +43,10 @@ class Utils {
static hideKeyboard(BuildContext context) {
FocusScope.of(context).unfocus();
}
static double distanceBetween(LocationData point1, LocationData point2, LengthUnit unit){
var distance = Distance();
num dist = distance.as(
unit,
LatLng(point1.latitude,point1.longitude),
LatLng(point2.latitude,point2.longitude)
);
return dist;
}
static possibleToGetLocation(Function(bool) completion) async{
static getLocation() async {
Location location = new Location();
var serviceEnabled = await location.serviceEnabled();
var hasPermission = await location.hasPermission() == PermissionStatus.granted;
completion(serviceEnabled && hasPermission);
}
static Future<LocationData> getLocation() async {
Location location = new Location();
LocationData currentLocation;
bool _serviceEnabled;
PermissionStatus _permissionGranted;
_serviceEnabled = await location.serviceEnabled();
if (!_serviceEnabled) {
try {
_serviceEnabled = await location.requestService();
} catch (e) {
print(e);
}
if (!_serviceEnabled) {
// Route to another page and send to him message "You have to enable location"
Navigator.pushReplacement(
AppGlobal.context,
MaterialPageRoute(
builder: (context) => RequestPermissionPage(),
),
);
}
}
_permissionGranted = await location.hasPermission();
if (_permissionGranted == PermissionStatus.denied) {
_permissionGranted = await location.requestPermission();
if (_permissionGranted == PermissionStatus.denied) {
// Route to another page and send to him message "You have to give Permission"
Navigator.pushReplacement(
AppGlobal.context,
MaterialPageRoute(
builder: (context) => RequestPermissionPage(),
),
);
//return _permissionGranted;
} else if (_permissionGranted == PermissionStatus.deniedForever) {
try {
SystemNavigator.pop();
AppSettings.openLocationSettings();
} catch (e) {
print(e);
}
// open setting page
} else {
currentLocation = await location.getLocation();
return currentLocation;
}
} else if (_permissionGranted == PermissionStatus.deniedForever) {
SystemNavigator.pop();
AppSettings.openLocationSettings();
// open setting page
} else {
currentLocation = await location.getLocation();
}
LocationData currentLocation = await location.getLocation();
return currentLocation;
}
@ -147,11 +55,10 @@ class Utils {
List<String> formattedNamesList = [];
names.forEach((name) {
name = name.toLowerCase();
name = name != "" ? name[0].toUpperCase() + name.substring(1) : "";
name = name[0].toUpperCase() + name.substring(1);
formattedNamesList.add(name);
});
return formattedNamesList.join(' ');
}
}

@ -19,7 +19,7 @@ class ActionSheetButton extends StatelessWidget {
: MediaQuery.of(context).size.height * 0.14,
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: HexColor("#DBE5E6"),
color: Hexcolor("#DBE5E6"),
spreadRadius: 15,
blurRadius: 15,
offset: Offset(0, 7),
@ -66,7 +66,7 @@ class ActionSheetButton extends StatelessWidget {
style: TextStyle(
fontSize: 22.0,
fontFamily: "Metropolis-Bold",
color: HexColor("##1A1818")),
color: Hexcolor("##1A1818")),
),
)
],

@ -25,7 +25,7 @@ class CustomBottomSheet extends StatelessWidget {
children: <Widget>[
Container(
decoration: BoxDecoration(
color: HexColor("#D5D5D5"),
color: Hexcolor("#D5D5D5"),
borderRadius: BorderRadius.circular(3.0)),
width: 200,
height: 7.0,

@ -103,7 +103,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
: 19),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
color: HexColor('#515b5d'),
color: Hexcolor('#515b5d'),
boxShadow: [
BoxShadow(
color: Color.fromRGBO(

@ -147,7 +147,8 @@ class _SecondaryButtonState extends State<SecondaryButton>
child: Container(
decoration: BoxDecoration(
border: widget.borderColor != null
? Border.all(color: widget.borderColor, width: 2.0)
? Border.all(
color: widget.borderColor.withOpacity(0.1), width: 2.0)
: null,
borderRadius: BorderRadius.all(Radius.circular(100.0)),
boxShadow: [
@ -194,7 +195,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
widget.color != null ? null : LINEAR_GRADIENT,
color: widget.color != null
? widget.color
: HexColor("#000000"),
: Hexcolor("#000000"),
),
),
),

@ -25,7 +25,7 @@ class CircleContainer extends StatelessWidget {
shape: BoxShape.circle,
color: color,
border: Border.all(
color: borderColor ?? HexColor("#707070"), width: borderWidth)),
color: borderColor ?? Hexcolor("#707070"), width: borderWidth)),
height: 80,
width: 80,
),

@ -3,9 +3,11 @@ import 'package:driverapp/uitl/utils.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';
class CustomerBriefCard extends StatelessWidget {
final int customerOrderId;
final int pharmacyOrderId;
final int itemId;
final String time;
final String customerFirstName;
final String customerLastName;
@ -16,11 +18,9 @@ class CustomerBriefCard extends StatelessWidget {
final double longitude;
final double latitude;
final bool showDistance;
final dynamic distanceInKilometers;
CustomerBriefCard({
this.customerOrderId,
this.pharmacyOrderId,
this.itemId,
this.time,
this.customerFirstName,
this.customerLastName,
@ -31,116 +31,150 @@ class CustomerBriefCard extends StatelessWidget {
this.longitude,
this.latitude,
this.showDistance = true,
this.distanceInKilometers,
});
@override
Widget build(BuildContext context) {
return Center(
child: Padding(
padding: EdgeInsets.only(bottom: 0.0),
child: Container(
width: MediaQuery.of(context).orientation == Orientation.landscape
? SizeConfig.widthMultiplier * 125.0
: SizeConfig.widthMultiplier * 90.0,
height: 290,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
bottomRight: Radius.circular(30),
bottomLeft: Radius.circular(30)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3),
),
],
),
child: Container(
width: MediaQuery.of(context).orientation == Orientation.landscape
? MediaQuery.of(context).size.width * 0.9
: MediaQuery.of(context).size.width * 0.9,
height: SizeConfig.heightMultiplier * 30.0, // TODO make it responsive
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30),
topRight: Radius.circular(30),
bottomRight: Radius.circular(30),
bottomLeft: Radius.circular(30)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3),
),
],
),
child: Container(
padding: EdgeInsets.only(left: 20, top: 20, right: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 3,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Customer Order Id: ${customerOrderId}',
style: TextStyle(
color: Color(0xff636363),
fontWeight: FontWeight.w500,
fontSize: 17.5),
),
SizedBox(
height: 10,
),
Text(
'Pharmacy Order Id: ${pharmacyOrderId}',
style: TextStyle(
color: Color(0xff636363),
fontWeight: FontWeight.w500,
fontSize: 17.5),
),
],
),
),
Expanded(
child: Padding(
padding: EdgeInsets.all(2.0),
child: DistanceInKilometers(
distanceInKilometers: distanceInKilometers,
),
),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Text(
Utils.formatStringToPascalCase(
'${customerFirstName} ${customerLastName}'),
style: TextStyle(
color: Color(0xff343333),
fontWeight: FontWeight.bold,
fontSize: 20.0,
),
),
// SizedBox(
// height: MediaQuery.of(context).size.width * 0.00,
// ),
Text(
mobileNo,
padding: EdgeInsets.only(left: 30, top: 20, right: 30),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(
'ID: ${itemId}',
style: TextStyle(
color: Color(0xff14A0A9),
fontWeight: FontWeight.w400),
color: Color(0xff636363),
fontWeight: FontWeight.w500,
fontSize: 17.5),
),
SizedBox(
height: MediaQuery.of(context).size.width * 0.005,
),
Expanded(
child: Padding(
padding: EdgeInsets.all(8.0),
child: DistanceInKilometers(
distanceInKilometers: 0.0,
),
),
],
),
],
),
SizedBox(
height: MediaQuery.of(context).size.width * 0.02,
),
Text(
Utils.formatStringToPascalCase(
'${customerFirstName} ${customerLastName}'),
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
color: Color(0xff343333),
fontFamily: 'Metropolis',
),
),
SizedBox(
height: MediaQuery.of(context).size.width * 0.019,
),
Text(
mobileNo,
style: TextStyle(
color: Color(0xff14A0A9), fontWeight: FontWeight.w400),
),
SizedBox(
height: MediaQuery.of(context).size.width * 0.005,
),
// Text(
// 'Olaya street, behind KFC resturant, next to kingdom towers 2nd floor ofice 277',
// style: TextStyle(
// color: Color(0xFF464748), fontWeight: FontWeight.w600),
// ),
SizedBox(
height: 10,
SizedBox(
height: 10,
),
SizedBox(
height: 10.0,
child: Center(
child: Container(
margin: EdgeInsetsDirectional.only(start: 1.0, end: 1.0),
height: 1.0,
color: Colors.grey,
),
),
],
),
),
SizedBox(
height: 20,
),
Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context).payment,
textAlign: TextAlign.start,
),
),
SizedBox(
width: 170,
),
Expanded(
child: Text(
totalPayment.toString(),
textAlign: TextAlign.end,
style: TextStyle(fontWeight: FontWeight.w400),
),
),
],
),
SizedBox(
height: MediaQuery.of(context).size.width * 0.03,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context).delivryTime,
textAlign: TextAlign.start,
),
),
Expanded(
child: Text(
'${DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(deliveryTime))} ${(DateUtil.convertStringToHours(deliveryTime))}',
textAlign: TextAlign.end,
style: TextStyle(fontWeight: FontWeight.w400)),
),
],
)
],
),
],
),
),
),

@ -5,158 +5,90 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class OrderInfoCard extends StatelessWidget {
const OrderInfoCard(
{Key key, this.order, this.onTap, this.showStatus = false, this.isActiveToDeliver = false})
: super(key: key);
const OrderInfoCard({Key key, this.order, this.onTap}) : super(key: key);
final dynamic order;
final Function onTap;
final bool showStatus;
final bool isActiveToDeliver;
@override
Widget build(BuildContext context) {
return InkWell(
child:
Container(
child: Container(
child: RoundedContainer(
showShadow: true,
raduis: 25.0,
height: MediaQuery.of(context).orientation == Orientation.portrait
? MediaQuery.of(context).size.height * (showStatus ? 0.22 : 0.160)
: MediaQuery.of(context).size.height *
(showStatus ? 0.359 : 0.269),
child: FractionallySizedBox(
widthFactor: 0.98,
child: Stack(
children:[
if(isActiveToDeliver)
? 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: const EdgeInsets.all(10.0),
child: Align(
alignment: Alignment.bottomRight,
child:Image.asset(
'assets/images/check.png',
height: 20,
width: 20,
),
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.formatStringToPascalCase(
order.firstName + ' ' + order.lastName),
style: TextStyle(
fontSize: 18.0,
color: Hexcolor("#343333"),
fontWeight: FontWeight.bold),
),
),
Column(
// mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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,
),
),
SizedBox(
width: 13,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 20.0),
child: Text(
Utils.formatStringToPascalCase(
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,
),
),
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,
),
),
],
Text(
order.mobileNumber,
style: TextStyle(
color: Color(0xff30B7B9),
fontWeight: FontWeight.w600,
fontSize: 15.0,
),
if (showStatus)
Row(
children: [
Container(
margin: EdgeInsets.only(bottom: 12, left: 10),
child: RoundedContainer(
margin: 4,
showShadow: false,
backgroundColor:
order.statusID == 2 ? Colors.green : Colors.red,
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 5, horizontal: 15),
child: Text(
order.description,
style: TextStyle(
color: Colors.white,
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,
),
),
],
),
),
),

@ -1,10 +1,8 @@
import 'package:driverapp/config/config.dart';
import 'package:driverapp/core/viewModels/base_view_model.dart';
import 'package:driverapp/pages/dashboard/dashboard_screen.dart';
import 'package:driverapp/uitl/utils.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 'package:gradient_app_bar/gradient_app_bar.dart';
import 'arrow_back.dart';
@ -21,8 +19,6 @@ class AppScaffold extends StatelessWidget {
final Color arrowColor;
final Color appBarColor;
final bool isAppBarGradient;
final bool isShowHomeIcon;
final bool isShowBackIcon;
AppScaffold(
{@required this.body,
@ -34,9 +30,7 @@ class AppScaffold extends StatelessWidget {
this.titleColor,
this.arrowColor,
this.appBarColor,
this.isAppBarGradient = false,
this.isShowHomeIcon = false,
this.isShowBackIcon = false});
this.isAppBarGradient});
@override
Widget build(BuildContext context) {
@ -46,9 +40,7 @@ class AppScaffold extends StatelessWidget {
bottom: false,
child: Scaffold(
backgroundColor:
Theme
.of(context)
.scaffoldBackgroundColor,
appBarColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar && !isAppBarGradient
? AppBar(
elevation: 0,
@ -62,67 +54,45 @@ class AppScaffold extends StatelessWidget {
fontWeight: FontWeight.bold),
),
title: Text(Utils.formatStringToPascalCase(appBarTitle)),
automaticallyImplyLeading: false,
leading: isShowBackIcon ? Builder(
leading: Builder(
builder: (BuildContext context) {
return ArrowBack(
arrowColor: arrowColor,
);
},
) : null,
centerTitle: true,
actions: <Widget>[
if (isShowHomeIcon)
IconButton(
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
},
),
],
)
: isShowAppBar && isAppBarGradient
? GradientAppBar(
gradient: LINEAR_GRADIENT,
title: Text(
Utils.formatStringToPascalCase(appBarTitle),
style: TextStyle(color: Colors.white),
),
automaticallyImplyLeading: false,
centerTitle: true,
leading: isShowBackIcon ? Builder(
builder: (BuildContext context) {
return ArrowBack(
arrowColor: arrowColor,
);
},
) : null,
actions: <Widget>[
if (isShowHomeIcon)
IconButton(
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) =>
DashboardScreen()
),
);
},
),
],
// actions: <Widget>[
// IconButton(
// icon: Icon(FontAwesomeIcons.home),
// color: Colors.white,
// onPressed: () {
// // TODO add navigator to home page
// },
// ),
// ],
)
: null,
: isShowAppBar && isAppBarGradient ? GradientAppBar(
gradient: LINEAR_GRADIENT,
title: Text(
Utils.formatStringToPascalCase(appBarTitle),
style: TextStyle(color: Colors.white),
),
centerTitle: true,
leading: Builder(
builder: (BuildContext context) {
return ArrowBack(
arrowColor: arrowColor,
);
},
)
) : null,
body: baseViewModel != null
? NetworkBaseView(
child: buildBodyWidget(),
baseViewModel: baseViewModel,
)
child: buildBodyWidget(),
baseViewModel: baseViewModel,
)
: buildBodyWidget(),
bottomSheet: bottomSheet,
),

@ -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(

@ -67,7 +67,7 @@ class _RoundedContainerState extends State<RoundedContainer> {
boxShadow: widget.showShadow ? [
BoxShadow(
color: HexColor("#DBE5E6"),
color: Hexcolor("#DBE5E6"),
spreadRadius: 15,
blurRadius: 15,
offset: Offset(0, 7), // changes position of shadow

@ -56,7 +56,7 @@ dependencies:
# UI Reqs
dotted_border: 1.0.5
expandable: ^4.1.4
hexcolor: ^1.0.6
hexcolor: ^1.0.1
# Notification Banner
dropdown_banner: ^1.4.0
@ -72,25 +72,12 @@ dependencies:
# location
location: ^3.0.2
# latlong tools
latlong: any
#gradient
gradient_app_bar: ^0.1.3
app_settings: ^4.0.3
#Barcode Scanner
flutter_barcode_scanner: ^1.0.1
#android_intent
android_intent: any
# Alerts Dailogs
sweetalert: any
# flutter_material_pickers
flutter_material_pickers: 1.7.4
@ -126,7 +113,3 @@ flutter:
- asset: assets/fonts/Metropolis/Metropolis-Regular.otf
- asset: assets/fonts/Metropolis/Metropolis-Bold.otf
- asset: assets/fonts/Metropolis/Metropolis-Light.otf
- family: HMGIcon1
fonts:
- asset: assets/fonts/icomoon.ttf

Loading…
Cancel
Save