├── .gitignore ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ ├── google-services.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── codeforany │ │ │ │ └── taxidriver │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── font │ ├── NunitoSans-Bold.ttf │ ├── NunitoSans-ExtraBold.ttf │ ├── NunitoSans-Medium.ttf │ ├── NunitoSans-Regular.ttf │ └── NunitoSans-SemiBold.ttf └── img │ ├── acceptance.png │ ├── app_logo.png │ ├── back.png │ ├── bank_logo.png │ ├── call.png │ ├── cancel_trip.png │ ├── cancelleation.png │ ├── car_1.png │ ├── chat.png │ ├── check_list.png │ ├── check_tick.png │ ├── close.png │ ├── close_btn.png │ ├── current_location.png │ ├── doller.png │ ├── drop_pin.png │ ├── drop_pin_1.png │ ├── earnings.png │ ├── email.png │ ├── home.png │ ├── info.png │ ├── language.png │ ├── logout.png │ ├── message.png │ ├── more.png │ ├── my_subscription.png │ ├── next.png │ ├── notification.png │ ├── open_btn.png │ ├── password_show.png │ ├── phone.png │ ├── pickup_pin.png │ ├── pickup_pin_1.png │ ├── question_mark.png │ ├── rate.png │ ├── rate_profile.png │ ├── rate_tip.png │ ├── ride_user_profile.png │ ├── service.png │ ├── setting.png │ ├── sm_bank.png │ ├── sm_document.png │ ├── sm_my_vehicle.png │ ├── sm_password.png │ ├── sm_profile.png │ ├── summary.png │ ├── trips_cut.png │ ├── u1.png │ ├── uncheck_list.png │ ├── user_car.png │ ├── wallet.png │ ├── wallet_add.png │ ├── welcome_bg.png │ └── withdraw.png ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── GoogleService-Info.plist │ ├── Info.plist │ ├── Runner-Bridging-Header.h │ └── Runner.entitlements └── RunnerTests │ └── RunnerTests.swift ├── lib ├── common │ ├── color_extension.dart │ ├── common_extension.dart │ ├── db_helper.dart │ ├── globs.dart │ ├── location_helper.dart │ ├── my_http_overrides.dart │ ├── service_call.dart │ └── socket_manager.dart ├── common_widget │ ├── Icon_title_subtitle_button.dart │ ├── bank_row.dart │ ├── car_document_row.dart │ ├── document_row.dart │ ├── drop_down_button.dart │ ├── icon_title_button.dart │ ├── icon_title_cell.dart │ ├── icon_title_row.dart │ ├── image_picker_view.dart │ ├── line_text_field.dart │ ├── location_select_button.dart │ ├── menu_row.dart │ ├── my_car_row.dart │ ├── plan_row.dart │ ├── popup_layout.dart │ ├── price_list_view.dart │ ├── rating_row.dart │ ├── round_button.dart │ ├── setting_row.dart │ ├── support_user_row.dart │ ├── switch_row.dart │ ├── tag_button.dart │ ├── title_subtitle_cell.dart │ ├── title_subtitle_row.dart │ ├── today_summary_row.dart │ ├── wallet_row.dart │ └── weekly_summary_row.dart ├── cubit │ ├── login_cubit.dart │ └── login_state.dart ├── main.dart ├── model │ ├── document_model.dart │ ├── price_detail_mode.dart │ ├── service_detail_model.dart │ ├── zone_document_model.dart │ └── zone_list_model.dart └── view │ ├── home │ ├── driver_my_rides_view.dart │ ├── home_view.dart │ ├── reason_view.dart │ ├── run_ride_view.dart │ ├── support │ │ ├── support_list_view.dart │ │ └── support_message_view.dart │ ├── tip_detail_view.dart │ └── tip_request_view.dart │ ├── login │ ├── add_vehicle_view.dart │ ├── bank_detail_view.dart │ ├── change_language_view.dart │ ├── document_upload_view.dart │ ├── driver_edit_profile_view.dart │ ├── mobile_number_view.dart │ ├── otp_view.dart │ ├── profile_image_view.dart │ ├── sign_in_view.dart │ ├── sign_up_view.dart │ ├── splash_view.dart │ ├── subscription_plan_view.dart │ ├── vehicle_document_view.dart │ └── welcome_view.dart │ ├── menu │ ├── add_momey_view.dart │ ├── change_password_view.dart │ ├── contact_us_view.dart │ ├── earning_view.dart │ ├── edit_profile_view.dart │ ├── menu_view.dart │ ├── my_car_details_view.dart │ ├── my_profile_view.dart │ ├── my_vehicle_view.dart │ ├── ratings_view.dart │ ├── service_type_view.dart │ ├── settings_view.dart │ ├── summary_view.dart │ └── wallet_view.dart │ └── user │ ├── car_service_select_view.dart │ ├── user_home_view.dart │ ├── user_my_rides_view.dart │ └── user_run_ride_view.dart ├── pubspec.lock └── pubspec.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Complete Taxi App Development in Flutter 2 | 3 | 🚖 Join us on a journey to create a full-featured Taxi App! In this comprehensive tutorial, we'll guide you through building a Taxi App from scratch, using both Flutter for cross-platform mobile development and SwiftUI for native iOS. We'll also set up the backend using Angular Material and Node.js Express.js REST APIs. Get ready to learn the entire app development process! 4 | 5 | 🔥 Key Highlights: 6 | 7 | - Flutter & SwiftUI: Create a cross-platform and native iOS version of the Taxi App. 8 | - Angular Material Backend: Set up the server-side logic and user interface with Angular Material. 9 | - Node.js Express.js REST API: Develop robust and efficient APIs to power your Taxi App. 10 | 11 | 📊 App Features Covered: 12 | 13 | - User Registration & Authentication 14 | - Real-time Location Tracking 15 | - Ride Booking & Management 16 | - Cash Payment Processing 17 | - Driver Matching & Ratings 18 | - Customer Support & Notifications 19 | 20 | 📢 Like, Share, and Subscribe: 21 | 22 | If you find this tutorial valuable, show your support by liking, sharing it with fellow developers, and subscribing to our channel. Join our community of developers and master the art of creating complex, real-world apps! 23 | 24 | UI UX App Design by: Zikar Patel 25 | https://www.behance.net/patelzikar?ref=uistore.design 26 | 27 | #FlutterDevelopment #SwiftUIDevelopment #TaxiApp #AngularMaterialBackend #NodejsExpressAPI #CompleteAppDevelopment #MobileAppDevelopment #CrossPlatformApp #iOSAppDevelopment #FlutterVsSwiftUI #BackendDevelopment #RESTAPI #RealTimeTracking #PaymentProcessing #RideBooking #LocationTracking #AppDesign #AppTutorial #FullStackDevelopment #DeveloperCommunity #CodingTutorial #AppDevelopmentTutorial #MobileApp #ProgrammingTutorial 28 | 29 | 30 | # codeforany @codeforany 31 | 32 | - [Youtube Full Playlist:Complete Taxi App Development in Flutter with Angular Material Backend | Node.js Express.js REST API Playlist](https://www.youtube.com/playlist?list=PLzcRC7PA0xWQ-hxjfD8gMFy7ciFWSIl-G) 33 | - [Youtube Channel: @codeforany](https://www.youtube.com/channel/UCdQTp9wRK5vAOlEQZf9PHSg) 34 | - [Youtube Channel Subscribe: @codeforany](https://www.youtube.com/channel/UCdQTp9wRK5vAOlEQZf9PHSg?sub_confirmation=1) 35 | 36 | 37 | A new Flutter project. 38 | 39 | ## Getting Started 40 | 41 | This project is a starting point for a Flutter application. 42 | 43 | A few resources to get you started if this is your first Flutter project: 44 | 45 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) 46 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) 47 | 48 | For help getting started with Flutter development, view the 49 | [online documentation](https://docs.flutter.dev/), which offers tutorials, 50 | samples, guidance on mobile development, and a full API reference. 51 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at https://dart.dev/lints. 17 | # 18 | # Instead of disabling a lint rule for the entire project in the 19 | # section below, it can also be suppressed for a single line of code 20 | # or a specific dart file by using the `// ignore: name_of_lint` and 21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 22 | # producing the lint. 23 | rules: 24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 26 | 27 | # Additional information about this file can be found at 28 | # https://dart.dev/guides/language/analysis-options 29 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | id "dev.flutter.flutter-gradle-plugin" 5 | id "com.google.gms.google-services" 6 | } 7 | 8 | def localProperties = new Properties() 9 | def localPropertiesFile = rootProject.file('local.properties') 10 | if (localPropertiesFile.exists()) { 11 | localPropertiesFile.withReader('UTF-8') { reader -> 12 | localProperties.load(reader) 13 | } 14 | } 15 | 16 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 17 | if (flutterVersionCode == null) { 18 | flutterVersionCode = '1' 19 | } 20 | 21 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 22 | if (flutterVersionName == null) { 23 | flutterVersionName = '1.0' 24 | } 25 | 26 | android { 27 | namespace "com.codeforany.taxidriver" 28 | compileSdkVersion 34 29 | ndkVersion flutter.ndkVersion 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.codeforany.taxidriver" 47 | // You can update the following values to match your application needs. 48 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 49 | minSdkVersion 23 50 | targetSdkVersion flutter.targetSdkVersion 51 | versionCode flutterVersionCode.toInteger() 52 | versionName flutterVersionName 53 | multiDexEnabled true 54 | } 55 | 56 | buildTypes { 57 | release { 58 | // TODO: Add your own signing config for the release build. 59 | // Signing with the debug keys for now, so `flutter run --release` works. 60 | signingConfig signingConfigs.debug 61 | } 62 | } 63 | } 64 | 65 | flutter { 66 | source '../..' 67 | } 68 | 69 | dependencies {} 70 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "442094658019", 4 | "project_id": "codeforany-80c1e", 5 | "storage_bucket": "codeforany-80c1e.appspot.com" 6 | }, 7 | "client": [ 8 | { 9 | "client_info": { 10 | "mobilesdk_app_id": "1:442094658019:android:9cb0b5b052bdb3f9fd00d6", 11 | "android_client_info": { 12 | "package_name": "com.codeforany.push_notification_demo" 13 | } 14 | }, 15 | "oauth_client": [ 16 | { 17 | "client_id": "442094658019-7j17subch89hif2e5bj3b82r46a1s9tb.apps.googleusercontent.com", 18 | "client_type": 3 19 | } 20 | ], 21 | "api_key": [ 22 | { 23 | "current_key": "AIzaSyAfcYBkks0IHg0bZ3PxSWaydBdGJ7qZq_Q" 24 | } 25 | ], 26 | "services": { 27 | "appinvite_service": { 28 | "other_platform_oauth_client": [ 29 | { 30 | "client_id": "442094658019-7j17subch89hif2e5bj3b82r46a1s9tb.apps.googleusercontent.com", 31 | "client_type": 3 32 | }, 33 | { 34 | "client_id": "442094658019-2iu8tv96jmspf3je6c8r6l1i3m63preo.apps.googleusercontent.com", 35 | "client_type": 2, 36 | "ios_info": { 37 | "bundle_id": "com.codeforany.pushNotificationDemo" 38 | } 39 | } 40 | ] 41 | } 42 | } 43 | }, 44 | { 45 | "client_info": { 46 | "mobilesdk_app_id": "1:442094658019:android:518a130eb1bba54efd00d6", 47 | "android_client_info": { 48 | "package_name": "com.codeforany.socket_io_demo" 49 | } 50 | }, 51 | "oauth_client": [ 52 | { 53 | "client_id": "442094658019-7j17subch89hif2e5bj3b82r46a1s9tb.apps.googleusercontent.com", 54 | "client_type": 3 55 | } 56 | ], 57 | "api_key": [ 58 | { 59 | "current_key": "AIzaSyAfcYBkks0IHg0bZ3PxSWaydBdGJ7qZq_Q" 60 | } 61 | ], 62 | "services": { 63 | "appinvite_service": { 64 | "other_platform_oauth_client": [ 65 | { 66 | "client_id": "442094658019-7j17subch89hif2e5bj3b82r46a1s9tb.apps.googleusercontent.com", 67 | "client_type": 3 68 | }, 69 | { 70 | "client_id": "442094658019-2iu8tv96jmspf3je6c8r6l1i3m63preo.apps.googleusercontent.com", 71 | "client_type": 2, 72 | "ios_info": { 73 | "bundle_id": "com.codeforany.pushNotificationDemo" 74 | } 75 | } 76 | ] 77 | } 78 | } 79 | }, 80 | { 81 | "client_info": { 82 | "mobilesdk_app_id": "1:442094658019:android:70109d59f12db630fd00d6", 83 | "android_client_info": { 84 | "package_name": "com.codeforany.taxidriver" 85 | } 86 | }, 87 | "oauth_client": [ 88 | { 89 | "client_id": "442094658019-7j17subch89hif2e5bj3b82r46a1s9tb.apps.googleusercontent.com", 90 | "client_type": 3 91 | } 92 | ], 93 | "api_key": [ 94 | { 95 | "current_key": "AIzaSyAfcYBkks0IHg0bZ3PxSWaydBdGJ7qZq_Q" 96 | } 97 | ], 98 | "services": { 99 | "appinvite_service": { 100 | "other_platform_oauth_client": [ 101 | { 102 | "client_id": "442094658019-7j17subch89hif2e5bj3b82r46a1s9tb.apps.googleusercontent.com", 103 | "client_type": 3 104 | }, 105 | { 106 | "client_id": "442094658019-2iu8tv96jmspf3je6c8r6l1i3m63preo.apps.googleusercontent.com", 107 | "client_type": 2, 108 | "ios_info": { 109 | "bundle_id": "com.codeforany.pushNotificationDemo" 110 | } 111 | } 112 | ] 113 | } 114 | } 115 | } 116 | ], 117 | "configuration_version": "1" 118 | } -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 17 | 18 | 26 | 30 | 34 | 35 | 36 | 37 | 38 | 39 | 41 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/codeforany/taxidriver/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.codeforany.taxidriver 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.8.22' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.3.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | classpath 'com.google.gms:google-services:4.3.15' 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | tasks.register("clean", Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | } 9 | settings.ext.flutterSdkPath = flutterSdkPath() 10 | 11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") 12 | 13 | plugins { 14 | id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false 15 | } 16 | } 17 | 18 | include ":app" 19 | 20 | apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" 21 | -------------------------------------------------------------------------------- /assets/font/NunitoSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/font/NunitoSans-Bold.ttf -------------------------------------------------------------------------------- /assets/font/NunitoSans-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/font/NunitoSans-ExtraBold.ttf -------------------------------------------------------------------------------- /assets/font/NunitoSans-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/font/NunitoSans-Medium.ttf -------------------------------------------------------------------------------- /assets/font/NunitoSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/font/NunitoSans-Regular.ttf -------------------------------------------------------------------------------- /assets/font/NunitoSans-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/font/NunitoSans-SemiBold.ttf -------------------------------------------------------------------------------- /assets/img/acceptance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/acceptance.png -------------------------------------------------------------------------------- /assets/img/app_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/app_logo.png -------------------------------------------------------------------------------- /assets/img/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/back.png -------------------------------------------------------------------------------- /assets/img/bank_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/bank_logo.png -------------------------------------------------------------------------------- /assets/img/call.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/call.png -------------------------------------------------------------------------------- /assets/img/cancel_trip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/cancel_trip.png -------------------------------------------------------------------------------- /assets/img/cancelleation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/cancelleation.png -------------------------------------------------------------------------------- /assets/img/car_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/car_1.png -------------------------------------------------------------------------------- /assets/img/chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/chat.png -------------------------------------------------------------------------------- /assets/img/check_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/check_list.png -------------------------------------------------------------------------------- /assets/img/check_tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/check_tick.png -------------------------------------------------------------------------------- /assets/img/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/close.png -------------------------------------------------------------------------------- /assets/img/close_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/close_btn.png -------------------------------------------------------------------------------- /assets/img/current_location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/current_location.png -------------------------------------------------------------------------------- /assets/img/doller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/doller.png -------------------------------------------------------------------------------- /assets/img/drop_pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/drop_pin.png -------------------------------------------------------------------------------- /assets/img/drop_pin_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/drop_pin_1.png -------------------------------------------------------------------------------- /assets/img/earnings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/earnings.png -------------------------------------------------------------------------------- /assets/img/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/email.png -------------------------------------------------------------------------------- /assets/img/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/home.png -------------------------------------------------------------------------------- /assets/img/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/info.png -------------------------------------------------------------------------------- /assets/img/language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/language.png -------------------------------------------------------------------------------- /assets/img/logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/logout.png -------------------------------------------------------------------------------- /assets/img/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/message.png -------------------------------------------------------------------------------- /assets/img/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/more.png -------------------------------------------------------------------------------- /assets/img/my_subscription.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/my_subscription.png -------------------------------------------------------------------------------- /assets/img/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/next.png -------------------------------------------------------------------------------- /assets/img/notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/notification.png -------------------------------------------------------------------------------- /assets/img/open_btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/open_btn.png -------------------------------------------------------------------------------- /assets/img/password_show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/password_show.png -------------------------------------------------------------------------------- /assets/img/phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/phone.png -------------------------------------------------------------------------------- /assets/img/pickup_pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/pickup_pin.png -------------------------------------------------------------------------------- /assets/img/pickup_pin_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/pickup_pin_1.png -------------------------------------------------------------------------------- /assets/img/question_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/question_mark.png -------------------------------------------------------------------------------- /assets/img/rate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/rate.png -------------------------------------------------------------------------------- /assets/img/rate_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/rate_profile.png -------------------------------------------------------------------------------- /assets/img/rate_tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/rate_tip.png -------------------------------------------------------------------------------- /assets/img/ride_user_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/ride_user_profile.png -------------------------------------------------------------------------------- /assets/img/service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/service.png -------------------------------------------------------------------------------- /assets/img/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/setting.png -------------------------------------------------------------------------------- /assets/img/sm_bank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/sm_bank.png -------------------------------------------------------------------------------- /assets/img/sm_document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/sm_document.png -------------------------------------------------------------------------------- /assets/img/sm_my_vehicle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/sm_my_vehicle.png -------------------------------------------------------------------------------- /assets/img/sm_password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/sm_password.png -------------------------------------------------------------------------------- /assets/img/sm_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/sm_profile.png -------------------------------------------------------------------------------- /assets/img/summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/summary.png -------------------------------------------------------------------------------- /assets/img/trips_cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/trips_cut.png -------------------------------------------------------------------------------- /assets/img/u1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/u1.png -------------------------------------------------------------------------------- /assets/img/uncheck_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/uncheck_list.png -------------------------------------------------------------------------------- /assets/img/user_car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/user_car.png -------------------------------------------------------------------------------- /assets/img/wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/wallet.png -------------------------------------------------------------------------------- /assets/img/wallet_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/wallet_add.png -------------------------------------------------------------------------------- /assets/img/welcome_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/welcome_bg.png -------------------------------------------------------------------------------- /assets/img/withdraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/assets/img/withdraw.png -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '11.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | target 'RunnerTests' do 36 | inherit! :search_paths 37 | end 38 | end 39 | 40 | post_install do |installer| 41 | installer.pods_project.targets.each do |target| 42 | flutter_additional_ios_build_settings(target) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/taxi_driver_flutter/18a4f37be11b8f7ae06fd95d78e14b95a683f5b3/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/GoogleService-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CLIENT_ID 6 | 442094658019-66cpgrerbteo37buvommsjre4ccgv2u0.apps.googleusercontent.com 7 | REVERSED_CLIENT_ID 8 | com.googleusercontent.apps.442094658019-66cpgrerbteo37buvommsjre4ccgv2u0 9 | ANDROID_CLIENT_ID 10 | 442094658019-4fc0pj5b3l5gb5pur4bu5qns3ok7eppb.apps.googleusercontent.com 11 | API_KEY 12 | AIzaSyAkyw8Fto-HFwouIepDQu1fzSy-D3oNW7g 13 | GCM_SENDER_ID 14 | 442094658019 15 | PLIST_VERSION 16 | 1 17 | BUNDLE_ID 18 | com.codeforany.taxidriver 19 | PROJECT_ID 20 | codeforany-80c1e 21 | STORAGE_BUCKET 22 | codeforany-80c1e.appspot.com 23 | IS_ADS_ENABLED 24 | 25 | IS_ANALYTICS_ENABLED 26 | 27 | IS_APPINVITE_ENABLED 28 | 29 | IS_GCM_ENABLED 30 | 31 | IS_SIGNIN_ENABLED 32 | 33 | GOOGLE_APP_ID 34 | 1:442094658019:ios:ee1147875691818afd00d6 35 | 36 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CADisableMinimumFrameDurationOnPhone 6 | 7 | CFBundleDevelopmentRegion 8 | $(DEVELOPMENT_LANGUAGE) 9 | CFBundleDisplayName 10 | Taxi Driver 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | taxi_driver 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | $(FLUTTER_BUILD_NAME) 23 | CFBundleSignature 24 | ???? 25 | CFBundleURLTypes 26 | 27 | 28 | CFBundleTypeRole 29 | Editor 30 | CFBundleURLSchemes 31 | 32 | com.googleusercontent.apps.442094658019-66cpgrerbteo37buvommsjre4ccgv2u0 33 | 34 | 35 | 36 | CFBundleVersion 37 | $(FLUTTER_BUILD_NUMBER) 38 | LSRequiresIPhoneOS 39 | 40 | NSCameraUsageDescription 41 | This app needs camera access to get profile image 42 | NSLocationAlwaysUsageDescription 43 | Please allow location for current location get on map 44 | NSLocationWhenInUseUsageDescription 45 | Please allow location for current location get on map 46 | NSPhotoLibraryUsageDescription 47 | This app needs photos access to get profile image from photo library 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | UIBackgroundModes 51 | 52 | fetch 53 | location 54 | remote-notification 55 | 56 | UILaunchStoryboardName 57 | LaunchScreen 58 | UIMainStoryboardFile 59 | Main 60 | UISupportedInterfaceOrientations 61 | 62 | UIInterfaceOrientationPortrait 63 | UIInterfaceOrientationLandscapeLeft 64 | UIInterfaceOrientationLandscapeRight 65 | 66 | UISupportedInterfaceOrientations~ipad 67 | 68 | UIInterfaceOrientationPortrait 69 | UIInterfaceOrientationPortraitUpsideDown 70 | UIInterfaceOrientationLandscapeLeft 71 | UIInterfaceOrientationLandscapeRight 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /lib/common/color_extension.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class TColor { 4 | static Color get primary => const Color(0xff3DB24B); 5 | static Color get secondary => const Color(0xff3369FF); 6 | 7 | static Color get primaryText => const Color(0xff282F39); 8 | static Color get primaryTextW => const Color(0xffFFFFFF); 9 | static Color get secondaryText => const Color(0xff7F7F7F); 10 | static Color get placeholder => const Color(0xffBBBBBB); 11 | static Color get lightGray => const Color(0xffDADEE3); 12 | static Color get lightWhite => const Color(0xffF2F5F7); 13 | 14 | static Color get red => const Color(0xffF4586C); 15 | 16 | static Color get bg => Colors.white; 17 | } 18 | 19 | extension HexColor on Color { 20 | /// String is in the format "aabbcc" or "ffaabbcc" with an optional leading "#". 21 | static Color fromHex(String hexString) { 22 | final buffer = StringBuffer(); 23 | if (hexString.length == 6 || hexString.length == 7) buffer.write('ff'); 24 | buffer.write(hexString.replaceFirst('#', '')); 25 | return Color(int.parse(buffer.toString(), radix: 16)); 26 | } 27 | 28 | /// Prefixes a hash sign if [leadingHashSign] is set to `true` (default is `true`). 29 | String toHex({bool leadingHashSign = true}) => '${leadingHashSign ? '#' : ''}' 30 | '${alpha.toRadixString(16).padLeft(2, '0')}' 31 | '${red.toRadixString(16).padLeft(2, '0')}' 32 | '${green.toRadixString(16).padLeft(2, '0')}' 33 | '${blue.toRadixString(16).padLeft(2, '0')}'; 34 | } 35 | 36 | extension AppContext on BuildContext { 37 | Size get size => MediaQuery.sizeOf(this); 38 | double get width => size.width; 39 | double get height => size.height; 40 | 41 | Future push(Widget widget) async { 42 | return Navigator.push( 43 | this, 44 | MaterialPageRoute( 45 | builder: (context) => widget, 46 | ), 47 | ); 48 | } 49 | 50 | void pop() async { 51 | return Navigator.pop(this); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/common/common_extension.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:intl/intl.dart'; 4 | import 'package:timeago/timeago.dart' as timeago; 5 | 6 | extension MDExtensionState on State { 7 | void mdShowAlert(String title, String message, VoidCallback onPressed, 8 | {String buttonTitle = "Ok", 9 | TextAlign mainAxisAlignment = TextAlign.center, isForce = false }) { 10 | showDialog( 11 | context: context, 12 | barrierDismissible: !isForce, 13 | builder: (context) => CupertinoAlertDialog( 14 | title: Text(title), 15 | content: Text(message), 16 | actions: [ 17 | CupertinoDialogAction( 18 | child: Text(buttonTitle), 19 | isDefaultAction: true, 20 | onPressed: () { 21 | Navigator.pop(context); 22 | onPressed(); 23 | }, 24 | ) 25 | ], 26 | )); 27 | } 28 | 29 | void endEditing() { 30 | FocusScope.of(context).requestFocus(FocusNode()); 31 | } 32 | } 33 | 34 | extension StringExtension on String { 35 | bool get isEmail { 36 | return RegExp( 37 | r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+") 38 | .hasMatch(this); 39 | } 40 | 41 | DateTime dataFormat( 42 | {String format = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", int addMin = 0}) { 43 | var date = (DateFormat(format).parseUTC(this)); 44 | return date.add(Duration(minutes: addMin)); 45 | } 46 | 47 | String timeAgo() { 48 | if (this == "") { 49 | return ""; 50 | } 51 | 52 | return timeago.format(dataFormat()); 53 | } 54 | 55 | 56 | String stringFormatToOtherFormat({ 57 | String format = "yyyy-MM-dd", 58 | String newFormat = 'dd/MM/yyyy', 59 | int addMin = 0 60 | }) { 61 | try { 62 | var date = DateFormat(format).parse(this); 63 | if(date == null) { 64 | return ""; 65 | } 66 | 67 | return date.add(Duration(minutes: addMin)).stringFormat(format: newFormat); 68 | } catch (e) { 69 | 70 | return ""; 71 | } 72 | } 73 | 74 | DateTime get date { 75 | return DateFormat('yyyy/MM/dd').parse(this); 76 | } 77 | 78 | DateTime get dateTime { 79 | return DateFormat('yyyy/MM/dd HH:mm').parse(this); 80 | } 81 | 82 | } 83 | 84 | extension DateTimeExtension on DateTime { 85 | String stringFormat({String format = "yyyy-MM-dd"}) { 86 | return DateFormat(format).format(this); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /lib/common/db_helper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:sqflite/sqflite.dart'; 3 | import 'package:path/path.dart'; 4 | 5 | class DBHelper { 6 | static final DBHelper singleton = DBHelper.internal(); 7 | factory DBHelper() => singleton; 8 | static Database? _db; 9 | DBHelper.internal(); 10 | static DBHelper shared() => singleton; 11 | 12 | static const String tbZoneList = 'zone_list'; 13 | static const String tbServiceDetail = 'service_detail'; 14 | static const String tbPriceDetail = 'price_detail'; 15 | static const String tbDocument = 'document'; 16 | static const String tbZoneDocument = 'zone_detail'; 17 | 18 | static const String zoneId = "zone_id"; 19 | static const String zoneName = "zone_name"; 20 | static const String zoneJson = "zone_json"; 21 | static const String city = "city"; 22 | static const String tax = "tax"; 23 | static const String status = "status"; 24 | static const String createdDate = "created_date"; 25 | static const String modifyDate = "modify_date"; 26 | 27 | static const String serviceId = "service_id"; 28 | static const String serviceName = "service_name"; 29 | static const String seat = "seat"; 30 | static const String color = "color"; 31 | static const String icon = "icon"; 32 | static const String topIcon = "top_icon"; 33 | static const String gender = "gender"; 34 | static const String description = "description"; 35 | 36 | static const String priceId = "price_id"; 37 | static const String baseCharge = "base_charge"; 38 | static const String perKmCharge = "per_km_charge"; 39 | static const String perMinCharge = "per_min_charge"; 40 | static const String bookingCharge = "booking_charge"; 41 | static const String miniFair = "mini_fair"; 42 | static const String miniKm = "mini_km"; 43 | static const String cancelCharge = "cancel_charge"; 44 | 45 | static const String docId = "doc_id"; 46 | static const String name = "name"; 47 | static const String type = "type"; 48 | 49 | static const String zoneDocId = "zone_doc_id"; 50 | static const String personalDoc = "personal_doc"; 51 | static const String carDoc = "car_doc"; 52 | static const String requiredPersonalDoc = "required_personal_doc"; 53 | static const String requiredCarDoc = "required_car_doc"; 54 | 55 | Future get db async { 56 | if (_db != null) { 57 | return _db; 58 | } 59 | _db = await initDB(); 60 | 61 | return _db; 62 | } 63 | 64 | initDB() async { 65 | String databasePath = await getDatabasesPath(); 66 | String path = join(databasePath, 'data.db'); 67 | var isDBExists = await databaseExists(path); 68 | if (kDebugMode) { 69 | print(isDBExists); 70 | print(path); 71 | } 72 | return await openDatabase(path, version: 1, onCreate: onCreate); 73 | } 74 | 75 | void onCreate(Database db, int newVersion) async { 76 | 77 | 78 | await db.execute( 79 | 'CREATE TABLE $tbZoneList ($zoneId TEXT PRIMARY KEY, $zoneName TEXT, $zoneJson TEXT, $city TEXT, $tax TEXT, $status Text, $createdDate Text, $modifyDate Text)'); 80 | 81 | await db.execute( 82 | 'CREATE TABLE $tbServiceDetail ($serviceId TEXT PRIMARY KEY, $serviceName TEXT, $seat TEXT, $color TEXT, $icon TEXT, $topIcon TEXT, $gender TEXT, $description TEXT, $status TEXT, $createdDate TEXT, $modifyDate TEXT)'); 83 | 84 | await db.execute( 85 | 'CREATE TABLE $tbPriceDetail ($priceId TEXT PRIMARY KEY, $zoneId TEXT, $serviceId TEXT, $baseCharge TEXT, $perKmCharge TEXT, $perMinCharge TEXT,$bookingCharge TEXT,$miniFair TEXT,$miniKm TEXT,$cancelCharge TEXT, $tax TEXT, $status TEXT, $createdDate TEXT, $modifyDate TEXT)'); 86 | 87 | await db.execute( 88 | 'CREATE TABLE $tbDocument ($docId TEXT PRIMARY KEY, $name TEXT, $type TEXT,$status TEXT, $createdDate TEXT, $modifyDate TEXT)'); 89 | 90 | await db.execute( 91 | 'CREATE TABLE $tbZoneDocument ($zoneDocId TEXT PRIMARY KEY, $zoneId TEXT, $serviceId TEXT, $personalDoc TEXT, $carDoc TEXT, $requiredPersonalDoc TEXT, $requiredCarDoc TEXT, $status TEXT, $createdDate TEXT, $modifyDate TEXT)'); 92 | 93 | debugPrint("db create table"); 94 | } 95 | 96 | static Future dbClearAll() async { 97 | if(_db == null) { 98 | return; 99 | } 100 | 101 | await _db?.execute('DELETE FROM $tbZoneList'); 102 | await _db?.execute('DELETE FROM $tbServiceDetail'); 103 | await _db?.execute('DELETE FROM $tbPriceDetail'); 104 | await _db?.execute('DELETE FROM $tbDocument'); 105 | await _db?.execute('DELETE FROM $tbZoneDocument'); 106 | } 107 | 108 | static Future dbClearTable(String table) async { 109 | if (_db == null) { 110 | return; 111 | } 112 | 113 | await _db?.execute('DELETE FROM $table'); 114 | } 115 | 116 | Future close() async { 117 | var dbClient = await db; 118 | return dbClient?.close(); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /lib/common/globs.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'dart:convert'; 3 | 4 | import 'package:flutter_easyloading/flutter_easyloading.dart'; 5 | import 'package:flutter_timezone/flutter_timezone.dart'; 6 | import 'package:taxi_driver/main.dart'; 7 | 8 | class Globs { 9 | static const appName = "Taxi Driver"; 10 | 11 | static const userPayload = "user_payload"; 12 | static const userLogin = "user_login"; 13 | 14 | static void showHUD({String status = "loading ...."}) async { 15 | await Future.delayed(const Duration(milliseconds: 1)); 16 | EasyLoading.show(status: status); 17 | } 18 | 19 | static void hideHUD(){ 20 | EasyLoading.dismiss(); 21 | } 22 | 23 | static void udSet(dynamic data, String key) { 24 | var jsonStr = json.encode(data); 25 | prefs?.setString(key, jsonStr); 26 | } 27 | 28 | static void udStringSet(String data, String key) { 29 | prefs?.setString(key, data); 30 | } 31 | 32 | static void udBoolSet(bool data, String key) { 33 | prefs?.setBool(key, data); 34 | } 35 | 36 | static void udIntSet(int data, String key) { 37 | prefs?.setInt(key, data); 38 | } 39 | 40 | static void udDoubleSet(double data, String key) { 41 | prefs?.setDouble(key, data); 42 | } 43 | 44 | static dynamic udValue(String key) { 45 | return json.decode(prefs?.get(key) as String? ?? "{}" ); 46 | } 47 | 48 | static String udValueString(String key) { 49 | return prefs?.getString(key) ?? ""; 50 | } 51 | 52 | static bool udValueBool(String key) { 53 | return prefs?.getBool(key) ?? false; 54 | } 55 | static bool udValueTrueBool(String key) { 56 | return prefs?.getBool(key) ?? true; 57 | } 58 | 59 | static int udValueInt(String key) { 60 | return prefs?.getInt(key) ?? 0; 61 | } 62 | 63 | static double udValueDouble(String key) { 64 | return prefs?.getDouble(key) ?? 0.0; 65 | } 66 | 67 | static void udRemove(String key) { 68 | prefs?.remove(key); 69 | } 70 | 71 | static Future timeZone() async { 72 | try { 73 | return await FlutterTimezone.getLocalTimezone(); 74 | } catch (e) { 75 | return ""; 76 | } 77 | } 78 | 79 | } 80 | 81 | class SVKey { 82 | static const mainUrl = "http://localhost:3001"; 83 | static const baseUrl ='$mainUrl/api/'; 84 | static const nodeUrl = mainUrl; 85 | 86 | static const svLogin = "${baseUrl}login"; 87 | static const svProfileImageUpload = "${baseUrl}profile_image"; 88 | static const svServiceAndZoneList = "${baseUrl}service_and_zone_list"; 89 | static const svProfileUpdate = "${baseUrl}profile_update"; 90 | 91 | static const svBankDetail = "${baseUrl}bank_detail"; 92 | static const svDriverBankDetailUpdate = "${baseUrl}driver_bank_update"; 93 | 94 | static const svBrandList = "${baseUrl}brand_list"; 95 | static const svModelList = "${baseUrl}model_list"; 96 | static const svSeriesList = "${baseUrl}series_list"; 97 | static const svAddCar = "${baseUrl}add_car"; 98 | static const svCarList = "${baseUrl}car_list"; 99 | 100 | static const svDeleteCar = "${baseUrl}car_delete"; 101 | static const svSetRunningCar = "${baseUrl}set_running_car"; 102 | 103 | static const svSupportList = "${baseUrl}support_user_list"; 104 | static const svSupportConnect = "${baseUrl}support_connect"; 105 | static const svSupportSendMessage = "${baseUrl}support_message"; 106 | static const svSupportClear = "${baseUrl}support_clear"; 107 | 108 | static const svStaticData = "${baseUrl}static_data"; 109 | 110 | static const svBookingRequest = "${baseUrl}booking_request"; 111 | static const svUpdateLocationDriver = "${baseUrl}update_location"; 112 | static const svDriverGoOnline = "${baseUrl}driver_online"; 113 | 114 | static const svDriverRideAccept = "${baseUrl}ride_request_accept"; 115 | static const svDriverRideDecline = "${baseUrl}ride_request_decline"; 116 | 117 | static const svHome = "${baseUrl}home"; 118 | static const svDriverWaitUser = "${baseUrl}driver_wait_user"; 119 | static const svRideStart = "${baseUrl}ride_start"; 120 | static const svRideStop = "${baseUrl}ride_stop"; 121 | static const svRideCancel = "${baseUrl}driver_cancel_ride"; 122 | static const svUserRideCancel = "${baseUrl}user_cancel_ride"; 123 | 124 | static const svUserAllRides = "${baseUrl}user_all_ride_list"; 125 | static const svDriverAllRides = "${baseUrl}driver_all_ride_list"; 126 | 127 | static const svRideRating = "${baseUrl}ride_rating"; 128 | static const svBookingDetail = "${baseUrl}booking_detail"; 129 | 130 | static const svDriverSummary = "${baseUrl}driver_summary"; 131 | 132 | static const svPersonalDocumentList = "${baseUrl}personal_document_list"; 133 | static const svDriverUploadDocument = "${baseUrl}driver_update_document"; 134 | static const svCarDocumentList = "${baseUrl}car_document_list"; 135 | 136 | static const svChangePassword = "${baseUrl}change_password"; 137 | static const svContactUs = "${baseUrl}contact_us"; 138 | 139 | } 140 | 141 | class KKey { 142 | static const payload = "payload"; 143 | static const status = "status"; 144 | static const message = "message"; 145 | 146 | static const authToken = "auth_token"; 147 | } 148 | 149 | class MSG { 150 | static const success = "success"; 151 | static const fail = "fail"; 152 | } -------------------------------------------------------------------------------- /lib/common/my_http_overrides.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | class MyHttpOverrides extends HttpOverrides { 4 | @override 5 | HttpClient createHttpClient(SecurityContext? context){ 6 | return super.createHttpClient(context) 7 | ..badCertificateCallback = (X509Certificate cert, String host, int port) => true; 8 | } 9 | } -------------------------------------------------------------------------------- /lib/common/socket_manager.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:socket_io_client/socket_io_client.dart' as IO; 5 | import 'package:taxi_driver/common/globs.dart'; 6 | import 'package:taxi_driver/common/service_call.dart'; 7 | 8 | class SocketManager { 9 | static final SocketManager sigleton = SocketManager._internal(); 10 | SocketManager._internal(); 11 | IO.Socket? socket; 12 | static SocketManager get shared => sigleton; 13 | 14 | void initSocket() { 15 | socket = IO.io(SVKey.mainUrl, { 16 | "transports": ['websocket'], 17 | "autoConnect": true 18 | }); 19 | 20 | socket?.on("connect", (data) { 21 | if (kDebugMode) { 22 | print("Socket Connect Done"); 23 | } 24 | 25 | //Emit Method 26 | 27 | if(Globs.udValueBool(Globs.userLogin)) { 28 | updateSocketIdApi(); 29 | } 30 | }); 31 | 32 | socket?.on("connect_error", (data) { 33 | if (kDebugMode) { 34 | print("Socket Connect Error"); 35 | print(data); 36 | } 37 | }); 38 | 39 | socket?.on("error", (data) { 40 | if (kDebugMode) { 41 | print("Socket Error"); 42 | print(data); 43 | } 44 | }); 45 | 46 | socket?.on("disconnect", (data) { 47 | if (kDebugMode) { 48 | print("Socket disconnect"); 49 | print(data); 50 | } 51 | }); 52 | 53 | // Out Socket Emit Listener 54 | 55 | socket?.on("UpdateSocket", (data) { 56 | print(" UpdateSocket : ---------------- "); 57 | print(data); 58 | }); 59 | } 60 | 61 | Future updateSocketIdApi() async { 62 | try { 63 | socket?.emit("UpdateSocket", jsonEncode( {'access_token' : ServiceCall.userObj["auth_token"].toString()} )); 64 | } catch (e) { 65 | if(kDebugMode) { 66 | print(e.toString()); 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /lib/common_widget/Icon_title_subtitle_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../common/color_extension.dart'; 4 | 5 | class IconTitleSubtitleButton extends StatelessWidget { 6 | final String title; 7 | final String subtitle; 8 | final String icon; 9 | final VoidCallback onPressed; 10 | 11 | const IconTitleSubtitleButton( 12 | {super.key, 13 | required this.title, 14 | required this.subtitle, 15 | required this.icon, 16 | required this.onPressed}); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return InkWell( 21 | onTap: onPressed, 22 | child: Column( 23 | children: [ 24 | Image.asset( 25 | icon, 26 | width: 20, 27 | height: 20, 28 | ), 29 | const SizedBox( 30 | height: 8, 31 | ), 32 | Text( 33 | title, 34 | style: TextStyle( 35 | color: TColor.primaryText, 36 | fontSize: 18, 37 | fontWeight: FontWeight.w800), 38 | ), 39 | Text( 40 | subtitle, 41 | style: TextStyle( 42 | color: TColor.secondaryText, 43 | fontSize: 16, 44 | ), 45 | ), 46 | ], 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/common_widget/bank_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class BankRow extends StatelessWidget { 5 | final Map bObj; 6 | const BankRow({super.key, required this.bObj}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Padding( 11 | padding: const EdgeInsets.symmetric(vertical: 10), 12 | child: Row( 13 | crossAxisAlignment: CrossAxisAlignment.center, 14 | children: [ 15 | Image.asset( 16 | bObj["icon"], 17 | width: 50, 18 | height: 50, 19 | ), 20 | const SizedBox( 21 | width: 8, 22 | ), 23 | Expanded( 24 | child: Column( 25 | 26 | crossAxisAlignment: CrossAxisAlignment.start, 27 | children: [ 28 | Text( 29 | bObj["name"], 30 | style: TextStyle(color: TColor.primaryText, fontSize: 16), 31 | ), 32 | Text( 33 | bObj["number"], 34 | style: TextStyle(color: TColor.secondaryText, fontSize: 14), 35 | ), 36 | ], 37 | ), 38 | ), 39 | ], 40 | ), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/common_widget/car_document_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class CarDocumentRow extends StatelessWidget { 5 | final String title; 6 | final String date; 7 | final String status; 8 | final Color statusColor; 9 | 10 | final VoidCallback onPressed; 11 | 12 | const CarDocumentRow({ 13 | super.key, 14 | required this.title, 15 | required this.date, 16 | required this.status, 17 | required this.statusColor, 18 | required this.onPressed, 19 | }); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return Container( 24 | padding: const EdgeInsets.symmetric(horizontal: 25), 25 | child: InkWell( 26 | onTap: onPressed, 27 | child: Column( 28 | crossAxisAlignment: CrossAxisAlignment.start, 29 | children: [ 30 | const SizedBox( 31 | height: 20, 32 | ), 33 | Row( 34 | children: [ 35 | Expanded( 36 | child: Text( 37 | title, 38 | style: TextStyle(color: TColor.primaryText, fontSize: 16), 39 | ), 40 | ), 41 | Container( 42 | padding: 43 | const EdgeInsets.symmetric(vertical: 4, horizontal: 10), 44 | decoration: BoxDecoration( 45 | color: statusColor.withOpacity(0.1), 46 | borderRadius: BorderRadius.circular(5), 47 | border: Border.all(color: statusColor, width: 0.5)), 48 | child: Text( 49 | status, 50 | style: TextStyle( 51 | color: statusColor, 52 | fontSize: 10, 53 | fontWeight: FontWeight.w600, 54 | ), 55 | ), 56 | ) 57 | ], 58 | ), 59 | const SizedBox( 60 | height: 6, 61 | ), 62 | Text( 63 | date, 64 | style: TextStyle(color: TColor.secondaryText, fontSize: 15), 65 | ), 66 | const SizedBox( 67 | height: 20, 68 | ), 69 | const Divider( 70 | height: 1, 71 | ) 72 | ], 73 | ), 74 | ), 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /lib/common_widget/document_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class DocumentRow extends StatelessWidget { 5 | final Map dObj; 6 | final VoidCallback onPressed; 7 | final VoidCallback onInfo; 8 | final VoidCallback onUpload; 9 | final VoidCallback onAction; 10 | 11 | const DocumentRow( 12 | {super.key, 13 | required this.dObj, 14 | required this.onPressed, 15 | required this.onInfo, 16 | required this.onUpload, 17 | required this.onAction}); 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | var status = dObj["status"] as int? ?? -1; 22 | 23 | return InkWell( 24 | onTap: onPressed, 25 | child: Column( 26 | children: [ 27 | Padding( 28 | padding: const EdgeInsets.symmetric(vertical: 10), 29 | child: Row( 30 | children: [ 31 | Expanded( 32 | child: Column( 33 | mainAxisSize: MainAxisSize.min, 34 | crossAxisAlignment: CrossAxisAlignment.start, 35 | children: [ 36 | Row( 37 | mainAxisAlignment: MainAxisAlignment.start, 38 | children: [ 39 | Text( 40 | dObj["name"] as String? ?? "", 41 | style: TextStyle( 42 | color: TColor.primaryText, 43 | fontSize: 16, 44 | ), 45 | ), 46 | const SizedBox( 47 | width: 8, 48 | ), 49 | InkWell( 50 | onTap: onInfo, 51 | child: Image.asset( 52 | "assets/img/info.png", 53 | width: 15, 54 | height: 15, 55 | ), 56 | ) 57 | ], 58 | ), 59 | // const SizedBox( 60 | // height: 4, 61 | // ), 62 | // Text( 63 | // dObj["detail"] as String? ?? "", 64 | // style: TextStyle( 65 | // color: TColor.secondaryText, 66 | // fontSize: 15, 67 | // ), 68 | // ), 69 | ], 70 | ), 71 | ), 72 | if (status == 2) 73 | Row( 74 | mainAxisSize: MainAxisSize.min, 75 | children: [ 76 | Image.asset( 77 | "assets/img/check_tick.png", 78 | width: 20, 79 | height: 20, 80 | ), 81 | InkWell( 82 | onTap: onAction, 83 | child: Image.asset( 84 | "assets/img/more.png", 85 | width: 20, 86 | height: 20, 87 | ), 88 | ) 89 | ], 90 | ) 91 | else if (status == -1) 92 | TextButton( 93 | onPressed: onUpload, 94 | child: Text( 95 | "UPLOAD", 96 | style: TextStyle( 97 | color: TColor.primary, 98 | fontSize: 15, 99 | fontWeight: FontWeight.w700), 100 | ), 101 | ) 102 | else if (status == 0) 103 | const Text( 104 | "Pending", 105 | style: TextStyle( 106 | color: Colors.blue, 107 | fontSize: 15, 108 | fontWeight: FontWeight.w500), 109 | ) 110 | else 111 | Text( 112 | status == 3 113 | ? "Unapproved" 114 | : status == 4 115 | ? "Expiry in 15 days" 116 | : "Expired", 117 | style: const TextStyle( 118 | color: Colors.red, 119 | fontSize: 15, 120 | fontWeight: FontWeight.w500), 121 | ), 122 | ], 123 | ), 124 | ), 125 | const Divider(), 126 | ], 127 | ), 128 | ); 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /lib/common_widget/drop_down_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class LineDropDownButton extends StatelessWidget { 5 | final String title; 6 | final String hintText; 7 | final Map? selectVal; 8 | final String displayKey; 9 | final List itemsArr; 10 | final Function(dynamic) didChanged; 11 | 12 | const LineDropDownButton({ 13 | super.key, 14 | required this.title, 15 | required this.hintText, 16 | required this.itemsArr, 17 | required this.didChanged, 18 | this.selectVal, 19 | required this.displayKey, 20 | }); 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return Column( 25 | crossAxisAlignment: CrossAxisAlignment.start, 26 | mainAxisSize: MainAxisSize.min, 27 | children: [ 28 | Text( 29 | title, 30 | style: TextStyle(color: TColor.placeholder, fontSize: 14), 31 | ), 32 | DropdownButtonHideUnderline( 33 | 34 | child: DropdownButton( 35 | isExpanded: true, 36 | hint: Text( 37 | hintText, 38 | style: TextStyle( 39 | color: TColor.secondaryText, 40 | fontSize: 16, 41 | ), 42 | ), 43 | value: selectVal, 44 | items: itemsArr.map((itemObj) { 45 | return DropdownMenuItem( 46 | value: itemObj, 47 | child: Text(itemObj[displayKey] as String? ?? ""), 48 | ); 49 | }).toList(), 50 | onChanged: didChanged), 51 | ), 52 | Container( 53 | color: TColor.lightGray, 54 | height: 0.5, 55 | width: double.maxFinite, 56 | ), 57 | ], 58 | ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/common_widget/icon_title_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../common/color_extension.dart'; 4 | 5 | class IconTitleButton extends StatelessWidget { 6 | final String title; 7 | final String icon; 8 | final VoidCallback onPressed; 9 | 10 | const IconTitleButton( 11 | {super.key, 12 | required this.title, 13 | required this.icon, 14 | required this.onPressed}); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return InkWell( 19 | onTap: onPressed, 20 | child: Column( 21 | children: [ 22 | Image.asset( 23 | icon, 24 | width: 35, 25 | height: 35, 26 | ), 27 | const SizedBox( 28 | height: 4, 29 | ), 30 | Text( 31 | title, 32 | style: TextStyle(color: TColor.primaryText, fontSize: 16), 33 | ), 34 | ], 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/common_widget/icon_title_cell.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class IconTitleCell extends StatelessWidget { 5 | final String title; 6 | final String icon; 7 | final double width; 8 | final VoidCallback onPressed; 9 | 10 | const IconTitleCell({super.key, required this.title, required this.icon, required this.onPressed, this.width = 50}); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return InkWell( 15 | onTap: onPressed, 16 | child: Column( 17 | mainAxisSize: MainAxisSize.min, 18 | 19 | children: [ 20 | Image.asset( 21 | icon, 22 | width: width, 23 | height: width, 24 | ), 25 | const SizedBox( 26 | height: 4, 27 | ), 28 | Text( 29 | title, 30 | style: TextStyle( 31 | color: TColor.primaryTextW, 32 | fontSize: 16, 33 | ), 34 | ) 35 | ], 36 | ), 37 | ); 38 | } 39 | } -------------------------------------------------------------------------------- /lib/common_widget/icon_title_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class IconTitleRow extends StatelessWidget { 5 | final String icon; 6 | final String title; 7 | final VoidCallback onPressed; 8 | 9 | const IconTitleRow( 10 | {super.key, 11 | required this.icon, 12 | required this.title, 13 | required this.onPressed}); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return InkWell( 18 | onTap: onPressed, 19 | child: Container( 20 | padding: const EdgeInsets.symmetric(vertical: 10), 21 | child: Row( 22 | children: [ 23 | Image.asset( 24 | icon, 25 | width: 40, 26 | height: 40, 27 | ), 28 | const SizedBox( 29 | width: 15, 30 | ), 31 | Text( 32 | title, 33 | style: TextStyle(color: TColor.primaryText, fontSize: 16), 34 | ), 35 | ], 36 | ), 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/common_widget/image_picker_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:image_picker/image_picker.dart'; 3 | import 'package:taxi_driver/common/color_extension.dart'; 4 | 5 | class ImagePickerView extends StatefulWidget { 6 | final Function(String) didSelect; 7 | const ImagePickerView({super.key, required this.didSelect}); 8 | 9 | @override 10 | State createState() => _ImagePickerViewState(); 11 | } 12 | 13 | class _ImagePickerViewState extends State { 14 | final picker = ImagePicker(); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | var media = MediaQuery.sizeOf(context); 19 | return Container( 20 | width: media.width * 0.9, 21 | height: media.width * 0.7, 22 | padding: const EdgeInsets.all(15), 23 | decoration: BoxDecoration( 24 | color: Colors.white, 25 | borderRadius: BorderRadius.circular(15), 26 | boxShadow: const [ 27 | BoxShadow(color: Colors.black54, blurRadius: 4, spreadRadius: 4) 28 | ]), 29 | child: Column( 30 | mainAxisAlignment: MainAxisAlignment.center, 31 | children: [ 32 | Text( 33 | "Image Picker", 34 | style: TextStyle( 35 | fontWeight: FontWeight.bold, 36 | fontSize: 20, 37 | color: TColor.primaryText, 38 | ), 39 | ), 40 | SizedBox( 41 | height: media.width * 0.04, 42 | ), 43 | Row( 44 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 45 | children: [ 46 | Expanded( 47 | child: TextButton( 48 | onPressed: () { 49 | getImageCamera(); 50 | }, 51 | child: Icon( 52 | Icons.camera_alt, 53 | size: 100, 54 | color: TColor.primaryText, 55 | ), 56 | ), 57 | ), 58 | Expanded( 59 | child: TextButton( 60 | onPressed: () { 61 | getImageGallery(); 62 | }, 63 | child: Icon( 64 | Icons.image, 65 | size: 100, 66 | color: TColor.primaryText, 67 | ), 68 | ), 69 | ) 70 | ], 71 | ), 72 | Row( 73 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 74 | children: [ 75 | Expanded( 76 | child: Text( 77 | "Take Photo", 78 | textAlign: TextAlign.center, 79 | style: TextStyle(color: TColor.primaryText, fontSize: 17), 80 | ), 81 | ), 82 | Expanded( 83 | child: Text( 84 | "Gallery", 85 | textAlign: TextAlign.center, 86 | style: TextStyle(color: TColor.primaryText, fontSize: 17), 87 | ), 88 | ), 89 | ], 90 | ), 91 | SizedBox( 92 | height: media.width * 0.01, 93 | ), 94 | Row( 95 | mainAxisAlignment: MainAxisAlignment.end, 96 | children: [ 97 | TextButton( 98 | onPressed: () { 99 | dismiss(); 100 | }, 101 | child: Text( 102 | "Close", 103 | style: TextStyle( 104 | color: TColor.primary, 105 | fontSize: 20, 106 | fontWeight: FontWeight.w600, 107 | ), 108 | ), 109 | ) 110 | ], 111 | ) 112 | ], 113 | ), 114 | ); 115 | } 116 | 117 | void dismiss() { 118 | Navigator.pop(context); 119 | } 120 | 121 | Future getImageCamera() async { 122 | try { 123 | final pickedFile = await picker.pickImage(source: ImageSource.camera); 124 | if (pickedFile != null) { 125 | widget.didSelect(pickedFile.path); 126 | dismiss(); 127 | } 128 | } catch (err) { 129 | debugPrint(err.toString()); 130 | } 131 | } 132 | 133 | Future getImageGallery() async { 134 | try { 135 | final pickedFile = await picker.pickImage(source: ImageSource.gallery); 136 | if (pickedFile != null) { 137 | widget.didSelect(pickedFile.path); 138 | dismiss(); 139 | } 140 | } catch (err) { 141 | debugPrint(err.toString()); 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /lib/common_widget/line_text_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class LineTextField extends StatelessWidget { 5 | final String title; 6 | final String hintText; 7 | final TextEditingController? controller; 8 | final TextInputType? keyboardType; 9 | final bool? obscureText; 10 | final Widget? right; 11 | final int minLines; 12 | final int maxLines; 13 | 14 | const LineTextField( 15 | {super.key, 16 | required this.title, 17 | required this.hintText, 18 | this.controller, 19 | this.keyboardType, 20 | this.obscureText, 21 | this.right, 22 | this.minLines = 1, 23 | this.maxLines = 1}); 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return Column( 28 | crossAxisAlignment: CrossAxisAlignment.start, 29 | mainAxisSize: MainAxisSize.min, 30 | children: [ 31 | Text( 32 | title, 33 | style: TextStyle(color: TColor.placeholder, fontSize: 14), 34 | ), 35 | TextField( 36 | controller: controller, 37 | keyboardType: keyboardType, 38 | obscureText: obscureText ?? false, 39 | minLines: minLines, 40 | maxLines: maxLines, 41 | style: TextStyle( 42 | color: TColor.primaryText, 43 | fontSize: 16, 44 | ), 45 | decoration: InputDecoration( 46 | enabledBorder: InputBorder.none, 47 | focusedBorder: InputBorder.none, 48 | hintText: hintText, 49 | suffixIcon: right, 50 | hintStyle: TextStyle( 51 | color: TColor.secondaryText, 52 | fontSize: 16, 53 | ), 54 | ), 55 | ), 56 | Container( 57 | color: TColor.lightGray, 58 | height: 0.5, 59 | width: double.maxFinite, 60 | ), 61 | ], 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /lib/common_widget/location_select_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class LocationSelectButton extends StatelessWidget { 5 | final String title; 6 | final String placeholder; 7 | final Color color; 8 | final String value; 9 | final bool isSelect; 10 | final VoidCallback onPressed; 11 | 12 | const LocationSelectButton( 13 | {super.key, 14 | required this.title, 15 | required this.placeholder, 16 | required this.color, 17 | required this.value, 18 | this.isSelect = false, 19 | required this.onPressed}); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return Column( 24 | mainAxisSize: MainAxisSize.min, 25 | crossAxisAlignment: CrossAxisAlignment.start, 26 | children: [ 27 | Row( 28 | children: [ 29 | Text( 30 | title, 31 | style: TextStyle( 32 | color: color, 33 | fontSize: 15, 34 | fontWeight: FontWeight.w700, 35 | ), 36 | ), 37 | ], 38 | ), 39 | InkWell( 40 | onTap: onPressed, 41 | child: Container( 42 | height: 50, 43 | margin: const EdgeInsets.symmetric(vertical: 8), 44 | padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10), 45 | decoration: BoxDecoration( 46 | color: Colors.white, 47 | border: isSelect ? Border.all(color: color, width: 2) : null, 48 | borderRadius: BorderRadius.circular(10), 49 | boxShadow: [ 50 | BoxShadow( 51 | color: isSelect ? color.withOpacity(0.2) : Colors.black12, 52 | blurRadius: 2, 53 | spreadRadius: 2) 54 | ]), 55 | child: Row( 56 | children: [ 57 | Container( 58 | width: 20, 59 | height: 20, 60 | decoration: BoxDecoration( 61 | color: color, borderRadius: BorderRadius.circular(10)), 62 | ), 63 | const SizedBox( 64 | width: 15, 65 | ), 66 | Expanded( 67 | child: Text( 68 | value == "" ? placeholder : value, 69 | textAlign: TextAlign.left, 70 | maxLines: 1, 71 | style: TextStyle( 72 | color: 73 | value == "" ? TColor.placeholder : TColor.primaryText, 74 | fontSize: 15, 75 | ), 76 | ), 77 | ), 78 | Icon( 79 | Icons.arrow_forward_ios_sharp, 80 | color: TColor.secondaryText, 81 | size: 20, 82 | ) 83 | ], 84 | ), 85 | ), 86 | ), 87 | ], 88 | ); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /lib/common_widget/menu_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class MenuRow extends StatelessWidget { 5 | final String title; 6 | final String icon; 7 | final VoidCallback onPressed; 8 | 9 | const MenuRow( 10 | {super.key, 11 | required this.title, 12 | required this.icon, 13 | required this.onPressed}); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return InkWell( 18 | onTap: onPressed, 19 | child: Container( 20 | padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 20), 21 | child: Row( 22 | crossAxisAlignment: CrossAxisAlignment.center, 23 | children: [ 24 | const SizedBox( 25 | width: 12.5, 26 | ), 27 | Image.asset( 28 | icon, 29 | width: 30, 30 | height: 30, 31 | ), 32 | const SizedBox( 33 | width: 12.5, 34 | ), 35 | Expanded( 36 | child: Text( 37 | title, 38 | style: TextStyle( 39 | color: TColor.primaryText, 40 | fontSize: 18, 41 | ), 42 | ), 43 | ), 44 | ], 45 | ), 46 | ), 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/common_widget/my_car_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:taxi_driver/common/color_extension.dart'; 4 | 5 | class MyCarRow extends StatelessWidget { 6 | final Map cObj; 7 | final VoidCallback onPressed; 8 | 9 | const MyCarRow({super.key, required this.cObj, required this.onPressed}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | var imageUrl = cObj["car_image"] as String? ?? ""; 14 | 15 | return Container( 16 | padding: const EdgeInsets.symmetric(vertical: 15), 17 | child: InkWell( 18 | onTap: onPressed, 19 | child: Row( 20 | children: [ 21 | Expanded( 22 | child: Column( 23 | crossAxisAlignment: CrossAxisAlignment.start, 24 | children: [ 25 | Text( 26 | "${cObj["brand_name"] ?? ""} - ${cObj["model_name"] ?? ""} - ${cObj["series_name"] ?? ""}", 27 | style: TextStyle(color: TColor.primaryText, fontSize: 16), 28 | ), 29 | Text( 30 | "${cObj["car_number"] ?? ""}", 31 | style: TextStyle(color: TColor.secondaryText, fontSize: 15), 32 | ), 33 | ], 34 | ), 35 | ), 36 | const SizedBox( 37 | width: 8, 38 | ), 39 | 40 | if( "${cObj["is_set_running"]}" == "1" ) 41 | Padding( 42 | padding: const EdgeInsets.only(right: 8), 43 | child: Icon( 44 | Icons.pin_drop_outlined, 45 | color: TColor.primary, 46 | size: 25, 47 | ), 48 | ), 49 | 50 | if (imageUrl != "") 51 | CachedNetworkImage( 52 | imageUrl: imageUrl, 53 | width: 50, 54 | height: 50, 55 | fit: BoxFit.cover, 56 | ), 57 | 58 | // Image.asset( 59 | // cObj["image"] as String? ?? "", 60 | // width: 50, 61 | // height: 50, 62 | // fit: BoxFit.cover, 63 | // ) 64 | ], 65 | ), 66 | ), 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/common_widget/plan_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class PlanRow extends StatelessWidget { 5 | final Map pObj; 6 | final VoidCallback onPressed; 7 | 8 | const PlanRow({super.key, required this.pObj, required this.onPressed}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Container( 13 | margin: const EdgeInsets.symmetric(vertical: 4), 14 | padding: const EdgeInsets.all(15), 15 | decoration: BoxDecoration( 16 | color: Colors.white, 17 | borderRadius: BorderRadius.circular(5), 18 | boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 1)]), 19 | child: Column( 20 | crossAxisAlignment: CrossAxisAlignment.start, 21 | children: [ 22 | Text( 23 | pObj["name"] as String? ?? "", 24 | style: TextStyle( 25 | color: TColor.primaryText, 26 | fontSize: 18, 27 | ), 28 | ), 29 | 30 | const SizedBox(height: 4,), 31 | Text( 32 | pObj["time"] as String? ?? "", 33 | style: TextStyle( 34 | color: TColor.secondaryText, 35 | fontSize: 15, 36 | ), 37 | ), 38 | const SizedBox(height: 4,), 39 | Text( 40 | pObj["rides"] as String? ?? "", 41 | style: TextStyle( 42 | color: TColor.secondaryText, 43 | fontSize: 16, 44 | ), 45 | ), 46 | const SizedBox( 47 | height: 4, 48 | ), 49 | Text( 50 | pObj["cash_rides"] as String? ?? "", 51 | style: TextStyle( 52 | color: TColor.secondaryText, 53 | fontSize: 16, 54 | ), 55 | ), 56 | const SizedBox( 57 | height: 4, 58 | ), 59 | Text( 60 | pObj["km"] as String? ?? "", 61 | style: TextStyle( 62 | color: TColor.secondaryText, 63 | fontSize: 16, 64 | ), 65 | ), 66 | Row( 67 | mainAxisAlignment: MainAxisAlignment.end, 68 | children: [ 69 | TextButton( 70 | onPressed: onPressed, 71 | child: Text( 72 | pObj["price"] as String? ?? "", 73 | style: TextStyle( 74 | color: TColor.primary, 75 | fontSize: 16, 76 | fontWeight: FontWeight.w700, 77 | ), 78 | ), 79 | ) 80 | ], 81 | ) 82 | ], 83 | ), 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /lib/common_widget/popup_layout.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | 6 | class PopupLayout extends ModalRoute { 7 | 8 | EdgeInsets? margin; 9 | Color? bgColor; 10 | final Widget child; 11 | 12 | 13 | PopupLayout({Key? key, this.bgColor, required this.child, this.margin}); 14 | 15 | @override 16 | // TODO: implement barrierColor 17 | Color? get barrierColor => bgColor ?? Colors.black.withOpacity(0.5); 18 | 19 | @override 20 | // TODO: implement barrierDismissible 21 | bool get barrierDismissible => false; 22 | 23 | @override 24 | // TODO: implement barrierLabel 25 | String? get barrierLabel => null; 26 | 27 | @override 28 | Widget buildPage(BuildContext context, Animation animation, Animation secondaryAnimation) { 29 | margin ??= const EdgeInsets.all(0); 30 | 31 | return GestureDetector( 32 | onTap: (){ 33 | SystemChannels.textInput.invokeMethod("TextInput.hide"); 34 | }, 35 | child: Material( 36 | type: MaterialType.transparency, 37 | child: BackdropFilter(filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5,), child: buildOverlayContent(context), ), 38 | ), 39 | ); 40 | } 41 | 42 | @override 43 | // TODO: implement maintainState 44 | bool get maintainState => false; 45 | 46 | @override 47 | // TODO: implement opaque 48 | bool get opaque => false; 49 | 50 | @override 51 | // TODO: implement transitionDuration 52 | Duration get transitionDuration => const Duration(milliseconds: 100); 53 | 54 | Widget buildOverlayContent(BuildContext context) { 55 | return Container( 56 | margin: margin, 57 | alignment: Alignment.center, 58 | child: child, 59 | ); 60 | } 61 | 62 | @override 63 | Widget buildTransitions(BuildContext context, Animation animation, 64 | Animation secondaryAnimation, Widget child) { 65 | // You can add your own animations for the overlay content 66 | return FadeTransition( 67 | opacity: animation, 68 | child: ScaleTransition( 69 | scale: animation, 70 | child: child, 71 | ), 72 | ); 73 | } 74 | 75 | } -------------------------------------------------------------------------------- /lib/common_widget/price_list_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/common_widget/title_subtitle_cell.dart'; 4 | import 'package:taxi_driver/common_widget/title_subtitle_row.dart'; 5 | 6 | class PriceListView extends StatelessWidget { 7 | final Map dObj; 8 | const PriceListView({super.key, required this.dObj}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Column( 13 | children: [ 14 | const SizedBox( 15 | height: 15, 16 | ), 17 | Container( 18 | width: double.maxFinite, 19 | height: 0.5, 20 | color: TColor.lightGray, 21 | ), 22 | Row( 23 | children: [ 24 | Expanded( 25 | child: TitleSubtitleCell( 26 | title: dObj["trips"], 27 | subtitle: "Trips", 28 | ), 29 | ), 30 | Container( 31 | height: 80, 32 | width: 0.5, 33 | color: TColor.lightGray, 34 | ), 35 | Expanded( 36 | child: TitleSubtitleCell( 37 | title: dObj["hrs"], 38 | subtitle: "Online hrs", 39 | ), 40 | ), 41 | Container( 42 | height: 80, 43 | width: 0.5, 44 | color: TColor.lightGray, 45 | ), 46 | Expanded( 47 | child: TitleSubtitleCell( 48 | title: dObj["cash_trip"], 49 | subtitle: "Cash Trip", 50 | ), 51 | ) 52 | ], 53 | ), 54 | Container( 55 | width: double.maxFinite, 56 | height: 0.5, 57 | color: TColor.lightGray, 58 | ), 59 | Padding( 60 | padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 20), 61 | child: Column( 62 | children: [ 63 | TitleSubtitleRow( 64 | title: "Trip fares", 65 | subtitle: dObj["trips"], 66 | color: TColor.secondaryText, 67 | ), 68 | TitleSubtitleRow( 69 | title: "Fee", 70 | subtitle: dObj["fee"], 71 | color: TColor.secondaryText, 72 | ), 73 | TitleSubtitleRow( 74 | title: "+Tax", 75 | subtitle: dObj["tax"], 76 | color: TColor.secondaryText, 77 | ), 78 | TitleSubtitleRow( 79 | title: "+Tolls", 80 | subtitle: dObj["tolls"], 81 | color: TColor.secondaryText, 82 | ), 83 | TitleSubtitleRow( 84 | title: "Surge", 85 | subtitle: dObj["surge"], 86 | color: TColor.secondaryText, 87 | ), 88 | TitleSubtitleRow( 89 | title: "Discount(-)", 90 | subtitle: dObj["discount"], 91 | color: TColor.secondaryText, 92 | ), 93 | const Divider(), 94 | TitleSubtitleRow( 95 | title: "Total Earnings", 96 | subtitle: dObj["total"], 97 | color: TColor.primary, 98 | weight: FontWeight.w800, 99 | ), 100 | ], 101 | ), 102 | ), 103 | const SizedBox( 104 | height: 8, 105 | ) 106 | ], 107 | ); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /lib/common_widget/rating_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_rating_bar/flutter_rating_bar.dart'; 3 | import 'package:taxi_driver/common/color_extension.dart'; 4 | 5 | class RatingRow extends StatelessWidget { 6 | final Map rObj; 7 | 8 | const RatingRow({super.key, required this.rObj}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Container( 13 | padding: const EdgeInsets.symmetric(vertical: 8), 14 | child: Column( 15 | crossAxisAlignment: CrossAxisAlignment.start, 16 | children: [ 17 | 18 | RatingBar.builder( 19 | initialRating: rObj["rate"] as double? ?? 5.0, 20 | minRating: 1, 21 | direction: Axis.horizontal, 22 | allowHalfRating: true, 23 | itemCount: 5, 24 | itemSize: 20, 25 | itemPadding: const EdgeInsets.symmetric(horizontal: 1.0), 26 | itemBuilder: (context, _) => Icon( 27 | Icons.star, 28 | color: TColor.primary, 29 | ), 30 | onRatingUpdate: (rating) { 31 | print(rating); 32 | }, 33 | ), 34 | 35 | const SizedBox( 36 | height: 8, 37 | ), 38 | 39 | if( (rObj["message"] as String? ?? "") != "" ) 40 | Text( 41 | rObj["message"] as String? ?? "", 42 | style: TextStyle( 43 | color: TColor.primaryText, 44 | fontSize: 16, 45 | ), 46 | ), 47 | 48 | ], 49 | ), 50 | ); 51 | } 52 | } -------------------------------------------------------------------------------- /lib/common_widget/round_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | enum RoundButtonType { primary, secondary, red, boarded } 5 | 6 | class RoundButton extends StatelessWidget { 7 | final String title; 8 | final RoundButtonType type; 9 | final VoidCallback onPressed; 10 | 11 | const RoundButton( 12 | {super.key, 13 | required this.title, 14 | this.type = RoundButtonType.primary, 15 | required this.onPressed}); 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return MaterialButton( 20 | onPressed: onPressed, 21 | minWidth: double.maxFinite, 22 | elevation: 0, 23 | color: type == RoundButtonType.primary 24 | ? TColor.primary 25 | : type == RoundButtonType.secondary 26 | ? TColor.secondary 27 | : type == RoundButtonType.red 28 | ? TColor.red 29 | : Colors.transparent, 30 | height: 45, 31 | shape: RoundedRectangleBorder( 32 | side: type == RoundButtonType.boarded 33 | ? BorderSide(color: TColor.secondaryText) 34 | : BorderSide.none, 35 | borderRadius: BorderRadius.circular(25)), 36 | child: Text( 37 | title, 38 | style: TextStyle( 39 | color: type == RoundButtonType.boarded 40 | ? TColor.secondaryText 41 | : TColor.primaryTextW, 42 | fontSize: 16, 43 | ), 44 | ), 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/common_widget/setting_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class SettingRow extends StatelessWidget { 5 | final String title; 6 | final String icon; 7 | final VoidCallback onPressed; 8 | 9 | const SettingRow( 10 | {super.key, 11 | required this.title, 12 | required this.icon, 13 | required this.onPressed}); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return InkWell( 18 | onTap: onPressed, 19 | child: Container( 20 | color: Colors.white, 21 | padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20), 22 | child: Row( 23 | children: [ 24 | Image.asset( 25 | icon, 26 | width: 30, 27 | height: 30, 28 | ), 29 | const SizedBox( 30 | width: 15, 31 | ), 32 | Expanded( 33 | child: Text( 34 | title, 35 | style: TextStyle(color: TColor.primaryText, fontSize: 18), 36 | ), 37 | ) 38 | ], 39 | ), 40 | ), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/common_widget/support_user_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/common/common_extension.dart'; 4 | 5 | class SupportUserRow extends StatelessWidget { 6 | final Map uObj; 7 | final VoidCallback onPressed; 8 | const SupportUserRow( 9 | {super.key, required this.uObj, required this.onPressed}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | var baseCount = int.tryParse("${uObj["base_count"] ?? ""}") ?? 0; 14 | 15 | return Padding( 16 | padding: const EdgeInsets.only(bottom: 2), 17 | child: InkWell( 18 | onTap: onPressed, 19 | child: Container( 20 | padding: const EdgeInsets.all(15), 21 | decoration: BoxDecoration( 22 | color: Colors.white, 23 | borderRadius: BorderRadius.circular(5) 24 | ), 25 | child: Row( 26 | children: [ 27 | ClipRRect( 28 | borderRadius: BorderRadius.circular(25), 29 | child: Image.asset( 30 | "assets/img/u1.png", 31 | width: 50, 32 | height: 50, 33 | ), 34 | ), 35 | const SizedBox( 36 | width: 15, 37 | ), 38 | Expanded( 39 | child: Column( 40 | crossAxisAlignment: CrossAxisAlignment.start, 41 | children: [ 42 | Row( 43 | children: [ 44 | Expanded( 45 | child: Text( 46 | uObj["name"] as String? ?? "", 47 | style: TextStyle( 48 | color: TColor.primaryText, 49 | fontWeight: FontWeight.w700), 50 | ), 51 | ), 52 | Text( 53 | (uObj["created_date"] as String? ?? "").timeAgo(), 54 | style: TextStyle(color: TColor.secondaryText, fontSize: 13), 55 | ) 56 | ], 57 | ), 58 | Row( 59 | children: [ 60 | Expanded( 61 | child: Text( 62 | uObj["message"] as String? ?? "", 63 | maxLines: 1, 64 | overflow: TextOverflow.ellipsis, 65 | style: 66 | TextStyle(color: TColor.secondaryText, fontSize: 14), 67 | ), 68 | ), 69 | if (baseCount > 0) 70 | Container( 71 | padding: const EdgeInsets.all(2), 72 | constraints: 73 | const BoxConstraints(minWidth: 20, minHeight: 10), 74 | decoration: BoxDecoration( 75 | color: TColor.primary, 76 | borderRadius: BorderRadius.circular(10) 77 | ), 78 | alignment: Alignment.center, 79 | child: Text( 80 | baseCount.toString() , 81 | textAlign: TextAlign.center, 82 | style: TextStyle( 83 | color: TColor.primaryTextW, 84 | fontSize: 11, 85 | fontWeight: FontWeight.w600, 86 | ), 87 | ), 88 | ) 89 | ], 90 | ) 91 | ], 92 | )) 93 | ], 94 | ), 95 | ), 96 | ), 97 | ); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /lib/common_widget/switch_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:taxi_driver/common/color_extension.dart'; 4 | 5 | class SwitchRow extends StatelessWidget { 6 | final Map sObj; 7 | final Function(bool) didChange; 8 | 9 | const SwitchRow({super.key, required this.sObj, required this.didChange}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Container( 14 | padding: const EdgeInsets.symmetric(vertical: 15), 15 | child: Row( 16 | crossAxisAlignment: CrossAxisAlignment.center, 17 | children: [ 18 | Expanded( 19 | child: Column( 20 | crossAxisAlignment: CrossAxisAlignment.start, 21 | children: [ 22 | Text( 23 | sObj["name"] as String? ?? "", 24 | style: TextStyle( 25 | color: TColor.primaryText, 26 | fontSize: 16, 27 | ), 28 | ), 29 | const SizedBox( 30 | height: 4, 31 | ), 32 | Text( 33 | sObj["detail"] as String? ?? "", 34 | style: TextStyle( 35 | color: TColor.secondaryText, 36 | fontSize: 15, 37 | ), 38 | ), 39 | ], 40 | ), 41 | ), 42 | 43 | CupertinoSwitch(value: sObj["value"] as bool? ?? false , onChanged: didChange) 44 | ], 45 | ), 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/common_widget/tag_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class TagButton extends StatelessWidget { 5 | final String title; 6 | final VoidCallback onPressed; 7 | 8 | const TagButton({super.key, required this.title, required this.onPressed}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Padding( 13 | padding: const EdgeInsets.only(right: 8), 14 | child: InkWell( 15 | onTap: onPressed, 16 | borderRadius: BorderRadius.circular(10), 17 | child: Container( 18 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8), 19 | decoration: BoxDecoration( 20 | border: Border.all(color: TColor.primary, width: 1), 21 | borderRadius: BorderRadius.circular(10), 22 | ), 23 | child: Text( 24 | title, 25 | style: TextStyle(color: TColor.primary, fontSize: 16), 26 | ), 27 | ), 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/common_widget/title_subtitle_cell.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class TitleSubtitleCell extends StatelessWidget { 5 | final String title; 6 | final String subtitle; 7 | 8 | const TitleSubtitleCell({super.key, required this.title, required this.subtitle}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Container( 13 | padding: const EdgeInsets.symmetric(vertical: 15), 14 | child: Column( 15 | children: [ 16 | 17 | Text( 18 | title, 19 | style: TextStyle( 20 | color: TColor.primaryText, 21 | fontSize: 18, 22 | fontWeight: FontWeight.w800), 23 | ), 24 | Text( 25 | subtitle, 26 | style: TextStyle( 27 | color: TColor.secondaryText, 28 | fontSize: 16), 29 | ), 30 | 31 | ], 32 | ), 33 | ); 34 | } 35 | } -------------------------------------------------------------------------------- /lib/common_widget/title_subtitle_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../common/color_extension.dart'; 4 | 5 | class TitleSubtitleRow extends StatelessWidget { 6 | final String title; 7 | final String subtitle; 8 | final Color? color; 9 | final FontWeight? weight; 10 | const TitleSubtitleRow( 11 | {super.key, required this.title, required this.subtitle, this.color, this.weight}); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Padding( 16 | padding: const EdgeInsets.symmetric(vertical: 8), 17 | child: Row( 18 | children: [ 19 | Expanded( 20 | child: Text( 21 | title, 22 | style: TextStyle( 23 | color: color ?? TColor.primaryText, 24 | fontSize: 15, 25 | fontWeight: weight ?? FontWeight.w400 26 | ), 27 | ), 28 | ), 29 | Text( 30 | subtitle, 31 | style: TextStyle( 32 | color: color ?? TColor.primaryText, 33 | fontSize: 15, 34 | fontWeight: weight ?? FontWeight.w600, 35 | ), 36 | ) 37 | ], 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/common_widget/today_summary_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/common/common_extension.dart'; 4 | 5 | class TodaySummaryRow extends StatelessWidget { 6 | final Map sObj; 7 | const TodaySummaryRow({super.key, required this.sObj}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | var price = double.tryParse( sObj["amt"].toString() ) ?? 0.0; 12 | return Padding( 13 | padding: const EdgeInsets.symmetric(vertical: 10), 14 | child: Row( 15 | children: [ 16 | Column( 17 | children: [ 18 | Text( 19 | sObj["start_time"] 20 | .toString() 21 | .dataFormat() 22 | .stringFormat(format: "hh:mm"), 23 | style: TextStyle(color: TColor.primaryText, fontSize: 15), 24 | ), 25 | Container( 26 | padding: const EdgeInsets.symmetric(horizontal: 10), 27 | decoration: BoxDecoration( 28 | color: TColor.lightWhite, 29 | borderRadius: BorderRadius.circular(20), 30 | ), 31 | child: Text( 32 | sObj["start_time"] 33 | .toString() 34 | .dataFormat() 35 | .stringFormat(format: "aa"), 36 | style: TextStyle( 37 | color: TColor.secondaryText, 38 | fontSize: 11, 39 | fontWeight: FontWeight.w700, 40 | ), 41 | ), 42 | ) 43 | ], 44 | ), 45 | const SizedBox( 46 | width: 8, 47 | ), 48 | Expanded( 49 | child: Column( 50 | crossAxisAlignment: CrossAxisAlignment.start, 51 | children: [ 52 | Text( 53 | sObj["pickup_address"] as String? ?? "", 54 | maxLines: 1, 55 | style: TextStyle(color: TColor.primaryText, fontSize: 16), 56 | ), 57 | Text( 58 | "Paid by ${ sObj["payment_type"] == 1 ? "cash" : "online" }", 59 | style: TextStyle(color: TColor.secondaryText, fontSize: 15), 60 | ), 61 | ], 62 | ), 63 | ), 64 | const SizedBox( 65 | width: 8, 66 | ), 67 | Text( 68 | "\$${price.toStringAsFixed(2)}" , 69 | style: TextStyle(color: TColor.primaryText, fontSize: 16), 70 | ), 71 | ], 72 | ), 73 | ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/common_widget/wallet_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | 4 | class WalletRow extends StatelessWidget { 5 | final Map wObj; 6 | const WalletRow({super.key, required this.wObj}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Padding( 11 | padding: const EdgeInsets.symmetric(vertical: 10), 12 | child: Row( 13 | children: [ 14 | Image.asset( wObj["icon"] , width: 35, height: 35, ), 15 | const SizedBox( 16 | width: 8, 17 | ), 18 | Expanded( 19 | child: Column( 20 | crossAxisAlignment: CrossAxisAlignment.start, 21 | children: [ 22 | Text( 23 | wObj["name"], 24 | style: TextStyle(color: TColor.primaryText, fontSize: 16), 25 | ), 26 | Text( 27 | wObj["time"], 28 | style: TextStyle(color: TColor.secondaryText, fontSize: 15), 29 | ), 30 | ], 31 | ), 32 | ), 33 | const SizedBox( 34 | width: 8, 35 | ), 36 | Text( 37 | wObj["price"], 38 | style: TextStyle(color: TColor.primaryText, fontSize: 16), 39 | ), 40 | ], 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/common_widget/weekly_summary_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/common/common_extension.dart'; 4 | 5 | class WeeklySummaryRow extends StatelessWidget { 6 | final Map sObj; 7 | const WeeklySummaryRow({super.key, required this.sObj}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | var price = double.tryParse(sObj["total_amt"].toString()) ?? 0.0; 12 | return Padding( 13 | padding: const EdgeInsets.symmetric(vertical: 10), 14 | child: Row( 15 | children: [ 16 | 17 | Expanded( 18 | child: Column( 19 | crossAxisAlignment: CrossAxisAlignment.start, 20 | children: [ 21 | Text( 22 | sObj["date"] 23 | .toString() 24 | .stringFormatToOtherFormat(newFormat: "dd, MMM yyyy"), 25 | style: TextStyle(color: TColor.primaryText, fontSize: 16), 26 | ), 27 | Text( 28 | "Trips ${ sObj["trips_count"] }", 29 | style: TextStyle(color: TColor.secondaryText, fontSize: 15), 30 | ), 31 | ], 32 | ), 33 | ), 34 | const SizedBox( 35 | width: 8, 36 | ), 37 | Text( 38 | "\$${price.toStringAsFixed(2)}", 39 | style: TextStyle(color: TColor.primaryText, fontSize: 16), 40 | ), 41 | ], 42 | ), 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/cubit/login_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:bloc/bloc.dart'; 4 | import 'package:equatable/equatable.dart'; 5 | import 'package:taxi_driver/common/globs.dart'; 6 | import 'package:taxi_driver/common/service_call.dart'; 7 | 8 | part 'login_state.dart'; 9 | 10 | class LoginCubit extends Cubit { 11 | LoginCubit() : super(LoginInitialState()); 12 | 13 | void submitLogin( String mobileCode, String mobile, String userType ) { 14 | try { 15 | 16 | emit(LoginHUDState()); 17 | ServiceCall.post({ 18 | "user_type": userType, 19 | "mobile_code": mobileCode, 20 | "mobile": mobile, 21 | "os_type": Platform.isIOS ? "i" : Platform.isAndroid ? "a" : "w", 22 | "push_token":"", 23 | "socket_id":"", 24 | }, SVKey.svLogin, withSuccess: (responseObj) async { 25 | 26 | if( ( responseObj[KKey.status] as String? ?? "" ) == "1" ) { 27 | ServiceCall.userObj = responseObj[KKey.payload] as Map? ?? {}; 28 | ServiceCall.userType = ServiceCall.userObj["user_type"] as int? ?? 1; 29 | 30 | 31 | Globs.udSet(ServiceCall.userObj, Globs.userPayload); 32 | Globs.udBoolSet(false,"is_online"); 33 | Globs.udBoolSet(true, Globs.userLogin); 34 | emit(LoginApiResultState()); 35 | emit(LoginInitialState()); 36 | }else{ 37 | emit(LoginErrorState(responseObj[KKey.message] ?? MSG.fail ),); 38 | } 39 | 40 | }, failure: (err) async { 41 | emit(LoginErrorState(err)); 42 | }, ); 43 | 44 | } catch (e) { 45 | emit(LoginErrorState(e.toString())); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/cubit/login_state.dart: -------------------------------------------------------------------------------- 1 | part of 'login_cubit.dart'; 2 | 3 | sealed class LoginState extends Equatable { 4 | const LoginState(); 5 | 6 | @override 7 | List get props => []; 8 | } 9 | 10 | final class LoginInitialState extends LoginState {} 11 | final class LoginHUDState extends LoginState {} 12 | final class LoginApiResultState extends LoginState {} 13 | final class LoginErrorState extends LoginState { 14 | final String errorMSG; 15 | const LoginErrorState(this.errorMSG); 16 | 17 | @override 18 | List get props => []; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:firebase_core/firebase_core.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_bloc/flutter_bloc.dart'; 6 | import 'package:shared_preferences/shared_preferences.dart'; 7 | import 'package:taxi_driver/common/color_extension.dart'; 8 | import 'package:taxi_driver/common/db_helper.dart'; 9 | import 'package:taxi_driver/common/globs.dart'; 10 | import 'package:taxi_driver/common/my_http_overrides.dart'; 11 | import 'package:taxi_driver/common/service_call.dart'; 12 | import 'package:taxi_driver/common/socket_manager.dart'; 13 | import 'package:taxi_driver/cubit/login_cubit.dart'; 14 | import 'package:taxi_driver/view/login/splash_view.dart'; 15 | import 'package:flutter_easyloading/flutter_easyloading.dart'; 16 | 17 | SharedPreferences? prefs; 18 | 19 | void main() async { 20 | HttpOverrides.global = MyHttpOverrides(); 21 | WidgetsFlutterBinding.ensureInitialized(); 22 | 23 | DBHelper.shared().db; 24 | 25 | prefs = await SharedPreferences.getInstance(); 26 | await Firebase.initializeApp(); 27 | if (Globs.udValueBool(Globs.userLogin)) { 28 | ServiceCall.userObj = Globs.udValue(Globs.userPayload) as Map? ?? {}; 29 | ServiceCall.userType = ServiceCall.userObj["user_type"] as int? ?? 1; 30 | } 31 | SocketManager.shared.initSocket(); 32 | 33 | runApp(const MyApp()); 34 | configLoading(); 35 | ServiceCall.getStaticDateApi(); 36 | } 37 | 38 | void configLoading() { 39 | EasyLoading.instance 40 | ..indicatorType = EasyLoadingIndicatorType.ring 41 | ..loadingStyle = EasyLoadingStyle.custom 42 | ..indicatorSize = 45.0 43 | ..radius = 5.0 44 | ..progressColor = TColor.primaryText 45 | ..backgroundColor = TColor.primary 46 | ..indicatorColor = Colors.white 47 | ..textColor = TColor.primaryText 48 | ..userInteractions = false 49 | ..dismissOnTap = false; 50 | } 51 | 52 | class MyApp extends StatelessWidget { 53 | const MyApp({super.key}); 54 | 55 | // This widget is the root of your application. 56 | @override 57 | Widget build(BuildContext context) { 58 | return MultiBlocProvider( 59 | providers: [BlocProvider(create: (context) => LoginCubit())], 60 | child: MaterialApp( 61 | title: 'Taxi Driver', 62 | debugShowCheckedModeBanner: false, 63 | theme: ThemeData( 64 | fontFamily: "NunitoSans", 65 | scaffoldBackgroundColor: TColor.bg, 66 | appBarTheme: const AppBarTheme( 67 | elevation: 0, 68 | backgroundColor: Colors.transparent, 69 | ), 70 | colorScheme: ColorScheme.fromSeed(seedColor: TColor.primary), 71 | useMaterial3: false, 72 | ), 73 | home: const SplashView(), 74 | builder: EasyLoading.init(), 75 | ), 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/model/document_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:taxi_driver/common/db_helper.dart'; 2 | 3 | class DocumentModel { 4 | String docId = ""; 5 | String name = ""; 6 | String type = ""; 7 | String status = ""; 8 | String createdDate = ""; 9 | String modifyDate = ""; 10 | 11 | DocumentModel.map(dynamic obj) { 12 | docId = obj["doc_id"].toString(); 13 | name = obj["name"].toString(); 14 | type = obj["type"].toString(); 15 | status = obj["status"].toString(); 16 | createdDate = obj["created_date"].toString(); 17 | modifyDate = obj["modify_date"].toString(); 18 | } 19 | 20 | Map toMap() { 21 | Map obj = {}; 22 | obj["doc_id"] = docId; 23 | obj["name"] = name; 24 | obj["type"] = type; 25 | obj["status"] = status; 26 | obj["created_date"] = createdDate; 27 | obj["modify_date"] = modifyDate; 28 | 29 | return obj; 30 | } 31 | 32 | static Future getList() async { 33 | var db = await DBHelper.shared().db; 34 | if (db != null) { 35 | List list = await db.rawQuery( 36 | 'SELECT * FROM `${DBHelper.tbDocument}` WHERE `${DBHelper.status}` = 1', 37 | []); 38 | return list; 39 | } else { 40 | return []; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/model/price_detail_mode.dart: -------------------------------------------------------------------------------- 1 | import 'package:taxi_driver/common/db_helper.dart'; 2 | import 'package:taxi_driver/common/service_call.dart'; 3 | 4 | class PriceDetailModel { 5 | String priceId = ""; 6 | String zoneId = ""; 7 | String serviceId = ""; 8 | String baseCharge = ""; 9 | String perKmCharge = ""; 10 | String perMinCharge = ""; 11 | String bookingCharge = ""; 12 | String miniFair = ""; 13 | String miniKm = ""; 14 | String cancelCharge = ""; 15 | String status = ""; 16 | String createdDate = ""; 17 | String modifyDate = ""; 18 | 19 | PriceDetailModel.map(dynamic obj) { 20 | priceId = obj["price_id"].toString(); 21 | zoneId = obj["zone_id"].toString(); 22 | serviceId = obj["service_id"].toString(); 23 | baseCharge = obj["base_charge"].toString(); 24 | perKmCharge = obj["per_km_charge"].toString(); 25 | perMinCharge = obj["per_min_charge"].toString(); 26 | bookingCharge = obj["booking_charge"].toString(); 27 | miniFair = obj["mini_fair"].toString(); 28 | miniKm = obj["mini_km"].toString(); 29 | cancelCharge = obj["cancel_charge"].toString(); 30 | status = obj["status"].toString(); 31 | createdDate = obj["created_date"].toString(); 32 | modifyDate = obj["modify_date"].toString(); 33 | } 34 | 35 | Map toMap() { 36 | Map obj = {}; 37 | obj["price_id"] = priceId; 38 | obj["zone_id"] = zoneId; 39 | obj["service_id"] = serviceId; 40 | obj["base_charge"] = baseCharge; 41 | obj["per_km_charge"] = perKmCharge; 42 | obj["per_min_charge"] = perMinCharge; 43 | obj["booking_charge"] = bookingCharge; 44 | obj["mini_fair"] = miniFair; 45 | obj["mini_km"] = miniKm; 46 | obj["cancel_charge"] = cancelCharge; 47 | obj["status"] = status; 48 | obj["created_date"] = createdDate; 49 | obj["modify_date"] = modifyDate; 50 | 51 | return obj; 52 | } 53 | 54 | static Future getList() async { 55 | var db = await DBHelper.shared().db; 56 | if (db != null) { 57 | List list = await db.rawQuery( 58 | 'SELECT * FROM `${DBHelper.tbPriceDetail}` WHERE `${DBHelper.status}` = 1', 59 | []); 60 | return list; 61 | } else { 62 | return []; 63 | } 64 | } 65 | 66 | 67 | static Future getSelectZoneGetServiceAndPriceList(String zoneId) async { 68 | var db = await DBHelper.shared().db; 69 | if (db != null) { 70 | List list = await db.rawQuery( 71 | 'SELECT `sd`.`service_id`, `pd`.`price_id`, `pd`.`base_charge`, `pd`.`per_km_charge`, `pd`.`per_min_charge`, `pd`.`booking_charge`, `pd`.`mini_fair`, `pd`.`mini_km`, `sd`.`service_name`, `sd`.`color`, `sd`.`icon` FROM `${DBHelper.tbServiceDetail}` AS `sd` INNER JOIN `${DBHelper.tbPriceDetail}` AS `pd` ON `pd`.`${DBHelper.serviceId}` = `sd`.`${DBHelper.serviceId}` AND `sd`.`${DBHelper.status}` = 1 AND `pd`.`${DBHelper.status}` = 1 AND ( `sd`.`${DBHelper.gender}` LIKE ? ) WHERE `pd`.`${DBHelper.zoneId}` = ?', 72 | [ "%${ServiceCall.userObj["gender"]}%" , zoneId ]); 73 | return list; 74 | } else { 75 | return []; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/model/service_detail_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:taxi_driver/common/db_helper.dart'; 2 | 3 | class ServiceDetailModel { 4 | String serviceId = ""; 5 | String serviceName = ""; 6 | String seat = ""; 7 | String color = ""; 8 | String icon = ""; 9 | String topIcon = ""; 10 | String gender = ""; 11 | String description = ""; 12 | String status = ""; 13 | String createdDate = ""; 14 | String modifyDate = ""; 15 | 16 | ServiceDetailModel.map(dynamic obj) { 17 | serviceId = obj["service_id"].toString(); 18 | serviceName = obj["service_name"].toString(); 19 | seat = obj["seat"].toString(); 20 | color = obj["color"].toString(); 21 | icon = obj["icon"].toString(); 22 | topIcon = obj["top_icon"].toString(); 23 | gender = obj["gender"].toString(); 24 | description = obj["description"].toString(); 25 | status = obj["status"].toString(); 26 | createdDate = obj["created_date"].toString(); 27 | modifyDate = obj["modify_date"].toString(); 28 | } 29 | 30 | Map toMap() { 31 | Map obj = {}; 32 | obj["service_id"] = serviceId; 33 | obj["service_name"] = serviceName; 34 | obj["seat"] = seat; 35 | obj["color"] = color; 36 | obj["icon"] = icon; 37 | obj["top_icon"] = topIcon; 38 | obj["gender"] = gender; 39 | obj["description"] = description; 40 | obj["status"] = status; 41 | obj["created_date"] = createdDate; 42 | obj["modify_date"] = modifyDate; 43 | 44 | return obj; 45 | } 46 | 47 | static Future getList() async { 48 | var db = await DBHelper.shared().db; 49 | if (db != null) { 50 | List list = await db.rawQuery( 51 | 'SELECT * FROM `${DBHelper.tbServiceDetail}` WHERE `${DBHelper.status}` = 1', 52 | []); 53 | return list; 54 | } else { 55 | return []; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/model/zone_document_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:taxi_driver/common/db_helper.dart'; 2 | 3 | class ZoneDocumentModel { 4 | String zoneDocId = ""; 5 | String zoneId = ""; 6 | String serviceId = ""; 7 | String personalDoc = ""; 8 | String carDoc = ""; 9 | String requiredPersonalDoc = ""; 10 | String requiredCarDoc = ""; 11 | String status = ""; 12 | String createdDate = ""; 13 | String modifyDate = ""; 14 | 15 | ZoneDocumentModel.map(dynamic obj) { 16 | zoneDocId = obj["zone_doc_id"].toString(); 17 | zoneId = obj["zone_id"].toString(); 18 | serviceId = obj["service_id"].toString(); 19 | personalDoc = obj["personal_doc"].toString(); 20 | carDoc = obj["car_doc"].toString(); 21 | requiredPersonalDoc = obj["required_personal_doc"].toString(); 22 | requiredCarDoc = obj["required_car_doc"].toString(); 23 | status = obj["status"].toString(); 24 | createdDate = obj["created_date"].toString(); 25 | modifyDate = obj["modify_date"].toString(); 26 | } 27 | 28 | Map toMap() { 29 | Map obj = {}; 30 | obj["zone_doc_id"] = zoneDocId; 31 | obj["zone_id"] = zoneId; 32 | obj["service_id"] = serviceId; 33 | obj["personal_doc"] = personalDoc; 34 | obj["car_doc"] = carDoc; 35 | obj["required_personal_doc"] = requiredPersonalDoc; 36 | obj["required_car_doc"] = requiredCarDoc; 37 | obj["status"] = status; 38 | obj["created_date"] = createdDate; 39 | obj["modify_date"] = modifyDate; 40 | return obj; 41 | } 42 | 43 | static Future getList() async { 44 | var db = await DBHelper.shared().db; 45 | if (db != null) { 46 | List list = await db.rawQuery( 47 | 'SELECT * FROM `${DBHelper.tbZoneDocument}` WHERE `${DBHelper.status}` = 1', 48 | []); 49 | return list; 50 | } else { 51 | return []; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /lib/model/zone_list_model.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:maps_toolkit/maps_toolkit.dart'; 5 | import 'package:taxi_driver/common/db_helper.dart'; 6 | 7 | class ZoneListModel { 8 | String zoneId = ""; 9 | String zoneName = ""; 10 | String zoneJson = ""; 11 | String city = ""; 12 | String tax = ""; 13 | String status = ""; 14 | String createdDate = ""; 15 | String modifyDate = ""; 16 | List zonePathArr = []; 17 | 18 | ZoneListModel.map(dynamic obj) { 19 | zoneId = obj["zone_id"].toString(); 20 | zoneName = obj["zone_name"].toString(); 21 | zoneJson = obj["zone_json"].toString(); 22 | city = obj["city"].toString(); 23 | tax = obj["tax"].toString(); 24 | status = obj["status"].toString(); 25 | createdDate = obj["created_date"].toString(); 26 | modifyDate = obj["modify_date"].toString(); 27 | 28 | try { 29 | zonePathArr = (json.decode(zoneJson) as List? ?? []) 30 | .map((pObj) => LatLng( 31 | pObj["lat"] as double? ?? 0.0, pObj["lng"] as double? ?? 0.0)) 32 | .toList(); 33 | } catch (e) { 34 | if (kDebugMode) { 35 | print(e.toString()); 36 | } 37 | } 38 | } 39 | 40 | Map toMap() { 41 | Map obj = {}; 42 | obj["zone_id"] = zoneId; 43 | obj["zone_name"] = zoneName; 44 | obj["zone_json"] = zoneJson; 45 | obj["city"] = city; 46 | obj["tax"] = tax; 47 | obj["status"] = status; 48 | obj["created_date"] = createdDate; 49 | obj["modify_date"] = modifyDate; 50 | 51 | return obj; 52 | } 53 | 54 | static Future getList() async { 55 | var db = await DBHelper.shared().db; 56 | if (db != null) { 57 | List list = await db.rawQuery( 58 | 'SELECT * FROM `${DBHelper.tbZoneList}` WHERE `${DBHelper.status}` = 1', 59 | []); 60 | return list; 61 | } else { 62 | return []; 63 | } 64 | } 65 | 66 | static Future> getActiveList() async { 67 | var db = await DBHelper.shared().db; 68 | 69 | if (db != null) { 70 | List list = await db.rawQuery( 71 | "SELECT `zl`.* FROM `${DBHelper.tbZoneList}` AS `zl` INNER JOIN `${DBHelper.tbPriceDetail}` AS `pd` ON `pd`.`${DBHelper.zoneId}` = `zl`.`${DBHelper.zoneId}` AND `pd`.`${DBHelper.status}` = '1' WHERE `zl`.`${DBHelper.status}` = '1' GROUP BY `zl`.`${DBHelper.zoneId}` ", 72 | []); 73 | 74 | return list.map((zObj) => ZoneListModel.map(zObj)).toList(); 75 | } else { 76 | return []; 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /lib/view/home/reason_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/common_widget/round_button.dart'; 4 | 5 | class ReasonView extends StatefulWidget { 6 | const ReasonView({super.key}); 7 | 8 | @override 9 | State createState() => _ReasonViewState(); 10 | } 11 | 12 | class _ReasonViewState extends State { 13 | List reasonArr = [ 14 | "Rider isn't here", 15 | "Wrong address shown", 16 | "Don't charge rider" 17 | ]; 18 | 19 | int selectIndex = 0; 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return Scaffold( 24 | appBar: AppBar( 25 | elevation: 0.5, 26 | backgroundColor: Colors.white, 27 | leading: IconButton( 28 | onPressed: () { 29 | context.pop(); 30 | }, 31 | icon: Image.asset( 32 | "assets/img/close.png", 33 | width: 25, 34 | height: 25, 35 | ), 36 | ), 37 | centerTitle: true, 38 | title: Text( 39 | "Cancel Trip", 40 | style: TextStyle( 41 | color: TColor.primaryText, 42 | fontSize: 18, 43 | fontWeight: FontWeight.w800, 44 | ), 45 | ), 46 | ), 47 | body: Column( 48 | children: [ 49 | Expanded( 50 | child: ListView.separated( 51 | padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 20), 52 | itemCount: reasonArr.length, 53 | separatorBuilder: (context, index) => Divider( 54 | color: TColor.placeholder, 55 | indent: 80, 56 | ), 57 | itemBuilder: (context, index) { 58 | return ListTile( 59 | leading: IconButton( 60 | onPressed: () { 61 | setState(() { 62 | selectIndex = index; 63 | }); 64 | }, 65 | icon: Image.asset( 66 | selectIndex == index 67 | ? "assets/img/check_list.png" 68 | : "assets/img/uncheck_list.png", 69 | width: 20, 70 | height: 20, 71 | ), 72 | ), 73 | title: Text( 74 | reasonArr[index] as String? ?? "", 75 | style: TextStyle( 76 | color: selectIndex == index 77 | ? TColor.primaryText 78 | : TColor.secondaryText, 79 | fontSize: 16, 80 | ), 81 | ), 82 | ); 83 | }, 84 | ), 85 | ), 86 | Padding( 87 | padding: const EdgeInsets.symmetric(horizontal: 20), 88 | child: RoundButton( 89 | title: "DONE", 90 | onPressed: () { 91 | context.pop(); 92 | }), 93 | ), 94 | const SizedBox( 95 | height: 20, 96 | ) 97 | ], 98 | ), 99 | ); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /lib/view/home/support/support_list_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/common/common_extension.dart'; 4 | import 'package:taxi_driver/common/globs.dart'; 5 | import 'package:taxi_driver/common/service_call.dart'; 6 | import 'package:taxi_driver/common/socket_manager.dart'; 7 | import 'package:taxi_driver/common_widget/support_user_row.dart'; 8 | import 'package:taxi_driver/view/home/support/support_message_view.dart'; 9 | 10 | class SupportListView extends StatefulWidget { 11 | const SupportListView({super.key}); 12 | 13 | @override 14 | State createState() => _SupportListViewState(); 15 | } 16 | 17 | class _SupportListViewState extends State { 18 | List listArr = []; 19 | 20 | @override 21 | void initState() { 22 | // TODO: implement initState 23 | super.initState(); 24 | getList(); 25 | 26 | // Received Message In Socket On Event 27 | SocketManager.shared.socket?.on("support_message", (data) { 28 | print("support_message socket get :${data.toString()} "); 29 | if (data[KKey.status] == "1") { 30 | var mObj = data[KKey.payload] as List? ?? []; 31 | var senderUserObj = data["user_info"] as Map? ?? {}; 32 | Map? userObj; 33 | var senderId = mObj[0]["sender_id"]; 34 | var userExits = false; 35 | for (var uObj in listArr) { 36 | if (senderId == uObj["user_id"]) { 37 | uObj["message"] = mObj[0]["message"]; 38 | uObj["message_type"] = mObj[0]["message_type"]; 39 | uObj["created_date"] = mObj[0]["created_date"]; 40 | uObj["base_count"] = (uObj["base_count"] as int? ?? 0) + 1; 41 | userExits = true; 42 | userObj = uObj; 43 | break; 44 | } 45 | } 46 | 47 | if (!userExits) { 48 | senderUserObj["message"] = mObj[0]["message"]; 49 | senderUserObj["message_type"] = mObj[0]["message_type"]; 50 | senderUserObj["created_date"] = mObj[0]["created_date"]; 51 | senderUserObj["base_count"] = 1; 52 | listArr.insert(0, senderUserObj); 53 | }else{ 54 | listArr.remove(userObj); 55 | listArr.insert(0, userObj); 56 | } 57 | 58 | if (mounted) { 59 | setState(() {}); 60 | } 61 | } 62 | }); 63 | } 64 | 65 | @override 66 | Widget build(BuildContext context) { 67 | return Scaffold( 68 | backgroundColor: TColor.lightWhite, 69 | appBar: AppBar( 70 | elevation: 0.5, 71 | backgroundColor: Colors.white, 72 | leading: IconButton( 73 | onPressed: () { 74 | context.pop(); 75 | }, 76 | icon: Image.asset( 77 | "assets/img/back.png", 78 | width: 25, 79 | height: 25, 80 | ), 81 | ), 82 | centerTitle: true, 83 | title: Text( 84 | "Supports", 85 | style: TextStyle( 86 | color: TColor.primaryText, 87 | fontSize: 18, 88 | fontWeight: FontWeight.w800, 89 | ), 90 | ), 91 | ), 92 | body: ListView.builder( 93 | padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 15), 94 | itemBuilder: (context, index) { 95 | var uObj = listArr[index] as Map? ?? {}; 96 | 97 | return SupportUserRow( 98 | uObj: uObj, 99 | onPressed: () async { 100 | await context.push(SupportMessageView( 101 | uObj: uObj, 102 | )); 103 | getList(); 104 | }, 105 | ); 106 | }, 107 | 108 | 109 | itemCount: listArr.length, 110 | ), 111 | ); 112 | } 113 | 114 | //TODO: ApiCalling 115 | 116 | void getList() { 117 | Globs.showHUD(); 118 | ServiceCall.post({ 119 | "socket_id": SocketManager.shared.socket?.id ?? "" 120 | }, SVKey.svSupportList, isTokenApi: true, withSuccess: (responseObj) async { 121 | Globs.hideHUD(); 122 | if (responseObj[KKey.status] == "1") { 123 | listArr = responseObj[KKey.payload] as List? ?? []; 124 | if (mounted) { 125 | setState(() {}); 126 | } 127 | } else { 128 | mdShowAlert(Globs.appName, 129 | responseObj[KKey.message] as String? ?? MSG.fail, () {}); 130 | } 131 | }, failure: (error) async { 132 | Globs.hideHUD(); 133 | mdShowAlert(Globs.appName, error as String? ?? MSG.fail, () {}); 134 | }); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /lib/view/login/change_language_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/view/login/welcome_view.dart'; 4 | 5 | class ChangeLanguageView extends StatefulWidget { 6 | const ChangeLanguageView({super.key}); 7 | 8 | @override 9 | State createState() => _ChangeLanguageViewState(); 10 | } 11 | 12 | class _ChangeLanguageViewState extends State { 13 | List listArr = ["Arabic", "Chinese", "English", "Korean", "Hindi"]; 14 | 15 | int selectChange = 2; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: AppBar( 21 | leading: IconButton( 22 | onPressed: () { 23 | context.pop(); 24 | }, 25 | icon: Image.asset( 26 | "assets/img/back.png", 27 | width: 25, 28 | height: 25, 29 | ), 30 | ), 31 | ), 32 | body: Padding( 33 | padding: const EdgeInsets.symmetric(horizontal: 20), 34 | child: Column( 35 | crossAxisAlignment: CrossAxisAlignment.start, 36 | children: [ 37 | Text( 38 | "Choose language", 39 | style: TextStyle( 40 | color: TColor.primaryText, 41 | fontSize: 25, 42 | fontWeight: FontWeight.w800), 43 | ), 44 | const SizedBox( 45 | height: 15, 46 | ), 47 | Expanded( 48 | child: ListView.builder( 49 | itemCount: listArr.length, 50 | itemBuilder: (context, index) { 51 | return ListTile( 52 | onTap: (){ 53 | setState(() { 54 | selectChange = index; 55 | }); 56 | context.push( const WelcomeView() ); 57 | }, 58 | title: Text( 59 | listArr[index], 60 | style: TextStyle( 61 | color: index == selectChange 62 | ? TColor.primary 63 | : TColor.primaryText, 64 | fontSize: 16), 65 | ), 66 | trailing: index == selectChange 67 | ? Image.asset("assets/img/check_tick.png", width: 25) 68 | : null, 69 | ); 70 | }, 71 | ), 72 | ), 73 | ], 74 | ), 75 | ), 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/view/login/mobile_number_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_country_code_picker/fl_country_code_picker.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:taxi_driver/common/color_extension.dart'; 4 | import 'package:taxi_driver/common_widget/round_button.dart'; 5 | import 'package:taxi_driver/view/login/otp_view.dart'; 6 | 7 | class MobileNumberView extends StatefulWidget { 8 | const MobileNumberView({super.key}); 9 | 10 | @override 11 | State createState() => _MobileNumberViewState(); 12 | } 13 | 14 | class _MobileNumberViewState extends State { 15 | FlCountryCodePicker countryCodePicker = const FlCountryCodePicker(); 16 | TextEditingController txtMobile = TextEditingController(); 17 | late CountryCode countryCode; 18 | 19 | @override 20 | void initState() { 21 | // TODO: implement initState 22 | super.initState(); 23 | 24 | countryCode = countryCodePicker.countryCodes 25 | .firstWhere((element) => element.name == "India"); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Scaffold( 31 | appBar: AppBar( 32 | leading: IconButton( 33 | onPressed: () { 34 | context.pop(); 35 | }, 36 | icon: Image.asset( 37 | "assets/img/back.png", 38 | width: 25, 39 | height: 25, 40 | ), 41 | ), 42 | ), 43 | body: Padding( 44 | padding: const EdgeInsets.symmetric(horizontal: 20), 45 | child: Column( 46 | crossAxisAlignment: CrossAxisAlignment.start, 47 | children: [ 48 | Text( 49 | "Enter mobile number", 50 | style: TextStyle( 51 | color: TColor.primaryText, 52 | fontSize: 25, 53 | fontWeight: FontWeight.w800), 54 | ), 55 | const SizedBox( 56 | height: 30, 57 | ), 58 | Row( 59 | mainAxisAlignment: MainAxisAlignment.start, 60 | children: [ 61 | InkWell( 62 | onTap: () async { 63 | final code = 64 | await countryCodePicker.showPicker(context: context); 65 | if (code != null) { 66 | countryCode = code; 67 | setState(() {}); 68 | } 69 | }, 70 | child: Row( 71 | mainAxisSize: MainAxisSize.min, 72 | children: [ 73 | SizedBox( 74 | width: 30, 75 | height: 20, 76 | child: countryCode.flagImage(), 77 | ), 78 | Text( 79 | " ${countryCode.dialCode}", 80 | style: 81 | TextStyle(color: TColor.primaryText, fontSize: 16), 82 | ), 83 | ], 84 | ), 85 | ), 86 | const SizedBox( 87 | width: 15, 88 | ), 89 | Expanded( 90 | child: TextField( 91 | controller: txtMobile, 92 | keyboardType: TextInputType.phone, 93 | decoration: const InputDecoration( 94 | contentPadding: EdgeInsets.zero, 95 | focusedBorder: InputBorder.none, 96 | enabledBorder: InputBorder.none, 97 | hintText: "9876543210", 98 | ), 99 | ), 100 | ) 101 | ], 102 | ), 103 | const Divider(), 104 | const SizedBox( 105 | height: 8, 106 | ), 107 | Row( 108 | mainAxisAlignment: MainAxisAlignment.center, 109 | children: [ 110 | Text( 111 | "By continuing, I confirm that i have read & agree to the", 112 | style: TextStyle( 113 | color: TColor.secondaryText, 114 | fontSize: 11, 115 | ), 116 | ), 117 | ], 118 | ), 119 | Row( 120 | mainAxisAlignment: MainAxisAlignment.center, 121 | children: [ 122 | Text( 123 | "Terms & conditions", 124 | style: TextStyle( 125 | color: TColor.primaryText, 126 | fontSize: 11, 127 | ), 128 | ), 129 | Text( 130 | " and ", 131 | style: TextStyle( 132 | color: TColor.secondaryText, 133 | fontSize: 11, 134 | ), 135 | ), 136 | Text( 137 | "Privacy policy", 138 | style: TextStyle( 139 | color: TColor.primaryText, 140 | fontSize: 11, 141 | ), 142 | ), 143 | ], 144 | ), 145 | const SizedBox( 146 | height: 15, 147 | ), 148 | RoundButton( 149 | onPressed: () { 150 | context.push( OTPView(number: txtMobile.text, code: countryCode.dialCode) ); 151 | }, 152 | title: "Login AS Driver", 153 | ), 154 | 155 | const SizedBox( 156 | height: 15, 157 | ), 158 | RoundButton( 159 | onPressed: () { 160 | context.push( OTPView(number: txtMobile.text, code: countryCode.dialCode, isDriver: false,) ); 161 | }, 162 | title: "Login AS USER", 163 | ) 164 | ], 165 | ), 166 | ), 167 | ); 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /lib/view/login/profile_image_view.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:taxi_driver/common/color_extension.dart'; 5 | import 'package:taxi_driver/common/common_extension.dart'; 6 | import 'package:taxi_driver/common/globs.dart'; 7 | import 'package:taxi_driver/common/service_call.dart'; 8 | import 'package:taxi_driver/common_widget/image_picker_view.dart'; 9 | import 'package:taxi_driver/common_widget/popup_layout.dart'; 10 | import 'package:taxi_driver/common_widget/round_button.dart'; 11 | import 'package:taxi_driver/view/login/driver_edit_profile_view.dart'; 12 | import 'package:taxi_driver/view/menu/edit_profile_view.dart'; 13 | 14 | class ProfileImageView extends StatefulWidget { 15 | final bool showBack; 16 | const ProfileImageView({super.key, this.showBack = true }); 17 | 18 | @override 19 | State createState() => _ProfileImageViewState(); 20 | } 21 | 22 | class _ProfileImageViewState extends State { 23 | File? image; 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return Scaffold( 28 | appBar: AppBar( 29 | backgroundColor: Colors.white, 30 | elevation: 1, 31 | leading: widget.showBack ? IconButton( 32 | onPressed: () { 33 | context.pop(); 34 | }, 35 | icon: Image.asset( 36 | "assets/img/back.png", 37 | width: 25, 38 | height: 25, 39 | ), 40 | ) : null, 41 | centerTitle: true, 42 | title: Text( 43 | "Profile Image", 44 | style: TextStyle( 45 | color: TColor.primaryText, 46 | fontSize: 25, 47 | fontWeight: FontWeight.w800), 48 | ), 49 | ), 50 | body: SingleChildScrollView( 51 | child: Padding( 52 | padding: const EdgeInsets.symmetric(horizontal: 20), 53 | child: Column( 54 | crossAxisAlignment: CrossAxisAlignment.center, 55 | children: [ 56 | const SizedBox( 57 | height: 50, 58 | ), 59 | InkWell( 60 | onTap: () async { 61 | await Navigator.push( 62 | context, 63 | PopupLayout( 64 | child: ImagePickerView( 65 | didSelect: (imagePath) { 66 | image = File(imagePath); 67 | serviceCall({"image": image!}); 68 | setState(() {}); 69 | }, 70 | ), 71 | ), 72 | ); 73 | }, 74 | child: Container( 75 | width: 200, 76 | height: 200, 77 | decoration: BoxDecoration( 78 | color: Colors.white, 79 | borderRadius: BorderRadius.circular(100), 80 | boxShadow: const [ 81 | BoxShadow(color: Colors.black26, blurRadius: 10) 82 | ]), 83 | child: ClipRRect( 84 | borderRadius: BorderRadius.circular(100), 85 | child: image != null 86 | ? Image.file( 87 | image!, 88 | width: 200, 89 | height: 200, 90 | fit: BoxFit.cover, 91 | ) 92 | : Icon( 93 | Icons.person, 94 | size: 100, 95 | color: TColor.secondaryText, 96 | ), 97 | ), 98 | ), 99 | ), 100 | const SizedBox( 101 | height: 50, 102 | ), 103 | RoundButton( 104 | onPressed: () { 105 | if (ServiceCall.userType == 2) { 106 | context.push(const DriverEditProfileView()); 107 | } else { 108 | context.push(const EditProfileView()); 109 | } 110 | }, 111 | title: "NEXT", 112 | ), 113 | ], 114 | ), 115 | ), 116 | ), 117 | ); 118 | } 119 | 120 | void serviceCall(Map imagePara) { 121 | Globs.showHUD(); 122 | ServiceCall.multipart({}, SVKey.svProfileImageUpload, 123 | isTokenApi: true, imgObj: imagePara, withSuccess: (responseObj) async { 124 | Globs.hideHUD(); 125 | if ((responseObj[KKey.status] ?? "") == "1") { 126 | ServiceCall.userObj = responseObj[KKey.payload] as Map? ?? {}; 127 | Globs.udSet(ServiceCall.userObj, Globs.userPayload); 128 | mdShowAlert("", responseObj[KKey.message] ?? MSG.success, () {}); 129 | } else { 130 | mdShowAlert("Error", responseObj[KKey.message] ?? MSG.fail, () {}); 131 | } 132 | }, failure: (err) async { 133 | Globs.hideHUD(); 134 | mdShowAlert("Error", err, () {}); 135 | }); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /lib/view/login/sign_in_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_country_code_picker/fl_country_code_picker.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:taxi_driver/common/color_extension.dart'; 4 | import 'package:taxi_driver/common_widget/line_text_field.dart'; 5 | import 'package:taxi_driver/common_widget/round_button.dart'; 6 | 7 | class SignInView extends StatefulWidget { 8 | const SignInView({super.key}); 9 | 10 | @override 11 | State createState() => _SignInViewState(); 12 | } 13 | 14 | class _SignInViewState extends State { 15 | FlCountryCodePicker countryCodePicker = const FlCountryCodePicker(); 16 | TextEditingController txtMobile = TextEditingController(); 17 | late CountryCode countryCode; 18 | TextEditingController txtPassword = TextEditingController(); 19 | 20 | @override 21 | void initState() { 22 | // TODO: implement initState 23 | super.initState(); 24 | 25 | countryCode = countryCodePicker.countryCodes 26 | .firstWhere((element) => element.name == "India"); 27 | } 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return Scaffold( 32 | appBar: AppBar( 33 | leading: IconButton( 34 | onPressed: () { 35 | context.pop(); 36 | }, 37 | icon: Image.asset( 38 | "assets/img/back.png", 39 | width: 25, 40 | height: 25, 41 | ), 42 | ), 43 | ), 44 | body: Padding( 45 | padding: const EdgeInsets.symmetric(horizontal: 20), 46 | child: Column( 47 | crossAxisAlignment: CrossAxisAlignment.start, 48 | children: [ 49 | Text( 50 | "Sign In", 51 | style: TextStyle( 52 | color: TColor.primaryText, 53 | fontSize: 25, 54 | fontWeight: FontWeight.w800), 55 | ), 56 | const SizedBox( 57 | height: 30, 58 | ), 59 | Text( 60 | "Mobile Number", 61 | style: TextStyle(color: TColor.placeholder, fontSize: 14), 62 | ), 63 | Row( 64 | mainAxisAlignment: MainAxisAlignment.start, 65 | children: [ 66 | InkWell( 67 | onTap: () async { 68 | final code = 69 | await countryCodePicker.showPicker(context: context); 70 | if (code != null) { 71 | countryCode = code; 72 | setState(() {}); 73 | } 74 | }, 75 | child: Row( 76 | mainAxisSize: MainAxisSize.min, 77 | children: [ 78 | SizedBox( 79 | width: 30, 80 | height: 20, 81 | child: countryCode.flagImage(), 82 | ), 83 | Text( 84 | " ${countryCode.dialCode}", 85 | style: 86 | TextStyle(color: TColor.primaryText, fontSize: 16), 87 | ), 88 | ], 89 | ), 90 | ), 91 | const SizedBox( 92 | width: 15, 93 | ), 94 | Expanded( 95 | child: TextField( 96 | controller: txtMobile, 97 | keyboardType: TextInputType.phone, 98 | decoration: const InputDecoration( 99 | contentPadding: EdgeInsets.zero, 100 | focusedBorder: InputBorder.none, 101 | enabledBorder: InputBorder.none, 102 | hintText: "9876543210", 103 | ), 104 | ), 105 | ) 106 | ], 107 | ), 108 | const Divider(), 109 | const SizedBox( 110 | height: 8, 111 | ), 112 | LineTextField( 113 | title: "Password", 114 | hintText: "******", 115 | controller: txtPassword, 116 | obscureText: true, 117 | right: IconButton(onPressed: (){}, icon: Image.asset("assets/img/password_show.png", width: 25, height: 25, ) ), 118 | ), 119 | const SizedBox( 120 | height: 15, 121 | ), 122 | RoundButton( 123 | onPressed: () {}, 124 | title: "SIGN IN", 125 | ), 126 | Row( 127 | mainAxisAlignment: MainAxisAlignment.center, 128 | children: [ 129 | TextButton( 130 | onPressed: () {}, 131 | child: Text( 132 | "FORGOT PASSWORD", 133 | style: TextStyle( 134 | color: TColor.primary, 135 | fontSize: 14, 136 | fontWeight: FontWeight.w700), 137 | ), 138 | ), 139 | ], 140 | ) 141 | ], 142 | ), 143 | ), 144 | ); 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /lib/view/login/splash_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/services.dart'; 3 | import 'package:taxi_driver/common/color_extension.dart'; 4 | import 'package:taxi_driver/common/globs.dart'; 5 | import 'package:taxi_driver/common/service_call.dart'; 6 | import 'package:taxi_driver/view/home/home_view.dart'; 7 | import 'package:taxi_driver/view/login/change_language_view.dart'; 8 | import 'package:taxi_driver/view/login/profile_image_view.dart'; 9 | import 'package:taxi_driver/view/user/user_home_view.dart'; 10 | 11 | class SplashView extends StatefulWidget { 12 | const SplashView({super.key}); 13 | 14 | @override 15 | State createState() => _SplashViewState(); 16 | } 17 | 18 | class _SplashViewState extends State { 19 | @override 20 | void initState() { 21 | // TODO: implement initState 22 | SystemChrome.setEnabledSystemUIMode(SystemUiMode.leanBack); 23 | super.initState(); 24 | load(); 25 | 26 | } 27 | 28 | void load() async { 29 | await Future.delayed(const Duration(seconds: 3)); 30 | loadNextScreen(); 31 | } 32 | 33 | void loadNextScreen() { 34 | if (Globs.udValueBool(Globs.userLogin)) { 35 | if (ServiceCall.userType == 2) { 36 | //Driver Login 37 | if (ServiceCall.userObj[KKey.status] == 1) { 38 | context.push(const HomeView()); 39 | } else { 40 | context.push(const ProfileImageView()); 41 | } 42 | } else { 43 | //User Login 44 | context.push(const UserHomeView()); 45 | } 46 | } else { 47 | context.push(const ChangeLanguageView()); 48 | } 49 | } 50 | 51 | @override 52 | Widget build(BuildContext context) { 53 | return Scaffold( 54 | backgroundColor: TColor.bg, 55 | body: Stack( 56 | alignment: Alignment.center, 57 | children: [ 58 | Container( 59 | width: context.width, 60 | height: context.height, 61 | color: TColor.primary, 62 | ), 63 | Image.asset( 64 | "assets/img/app_logo.png", 65 | width: context.width * 0.25, 66 | ) 67 | ], 68 | ), 69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/view/login/subscription_plan_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/common_widget/plan_row.dart'; 4 | 5 | class SubscriptionPlanView extends StatefulWidget { 6 | const SubscriptionPlanView({super.key}); 7 | 8 | @override 9 | State createState() => _SubscriptionPlanViewState(); 10 | } 11 | 12 | class _SubscriptionPlanViewState extends State { 13 | List planArr = [ 14 | { 15 | "name": "Basic plan", 16 | "time": "1 Month", 17 | "rides": "• 10 rides Everyday", 18 | "cash_rides": "• 2 Cash rides", 19 | "km": "• 50 km travel rides", 20 | "price": "TRY FREE" 21 | }, 22 | { 23 | "name": "Classic plan", 24 | "time": "3 Month", 25 | "rides": "• 10 rides Everyday", 26 | "cash_rides": "• 2 Cash rides", 27 | "km": "• 50 km travel rides", 28 | "price": "BUY AT \$20.50" 29 | } 30 | ]; 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | return Scaffold( 35 | appBar: AppBar( 36 | backgroundColor: Colors.white, 37 | elevation: 1, 38 | leading: IconButton( 39 | onPressed: () { 40 | context.pop(); 41 | }, 42 | icon: Image.asset( 43 | "assets/img/back.png", 44 | width: 25, 45 | height: 25, 46 | ), 47 | ), 48 | centerTitle: true, 49 | title: Text( 50 | "Subscription plan", 51 | style: TextStyle( 52 | color: TColor.primaryText, 53 | fontSize: 25, 54 | fontWeight: FontWeight.w800), 55 | ), 56 | ), 57 | backgroundColor: TColor.bg, 58 | body: ListView.builder( 59 | padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8), 60 | itemCount: planArr.length, 61 | itemBuilder: (context, index) { 62 | var pObj = planArr[index] as Map? ?? {}; 63 | return PlanRow( 64 | pObj: pObj, 65 | onPressed: () {}, 66 | ); 67 | }), 68 | ); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /lib/view/login/welcome_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/common_widget/round_button.dart'; 4 | import 'package:taxi_driver/view/login/mobile_number_view.dart'; 5 | 6 | class WelcomeView extends StatefulWidget { 7 | const WelcomeView({super.key}); 8 | 9 | @override 10 | State createState() => _WelcomeViewState(); 11 | } 12 | 13 | class _WelcomeViewState extends State { 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | backgroundColor: TColor.bg, 18 | body: Stack( 19 | alignment: Alignment.center, 20 | children: [ 21 | Image.asset( 22 | "assets/img/welcome_bg.png", 23 | width: context.width, 24 | height: context.height, 25 | fit: BoxFit.cover, 26 | ), 27 | Container( 28 | width: context.width, 29 | height: context.height, 30 | color: Colors.black.withOpacity(0.8), 31 | ), 32 | SafeArea( 33 | child: Column( 34 | children: [ 35 | Image.asset( 36 | "assets/img/app_logo.png", 37 | width: context.width * 0.25, 38 | ), 39 | const Spacer(), 40 | 41 | Padding( 42 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), 43 | child: RoundButton(title: "Get Start", onPressed: (){ 44 | context.push( const MobileNumberView() ); 45 | }, ), 46 | ), 47 | 48 | 49 | // TextButton( 50 | // onPressed: () { 51 | // context.push(const SignUpView()); 52 | // }, 53 | // child: Text( 54 | // "SIGN UP", 55 | // style: TextStyle( 56 | // color: TColor.primaryTextW, 57 | // fontSize: 16, 58 | // ), 59 | // ), 60 | // ) 61 | ], 62 | ), 63 | ) 64 | ], 65 | ), 66 | ); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/view/menu/contact_us_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/common/common_extension.dart'; 4 | import 'package:taxi_driver/common/globs.dart'; 5 | import 'package:taxi_driver/common/service_call.dart'; 6 | import 'package:taxi_driver/common_widget/line_text_field.dart'; 7 | import 'package:taxi_driver/common_widget/round_button.dart'; 8 | 9 | class ContactUsView extends StatefulWidget { 10 | const ContactUsView({super.key}); 11 | 12 | @override 13 | State createState() => _ContactUsViewState(); 14 | } 15 | 16 | class _ContactUsViewState extends State { 17 | TextEditingController txtName = TextEditingController(); 18 | TextEditingController txtEmail = TextEditingController(); 19 | TextEditingController txtSubject = TextEditingController(); 20 | TextEditingController txtMessage = TextEditingController(); 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return Scaffold( 25 | appBar: AppBar( 26 | elevation: 0.5, 27 | backgroundColor: Colors.white, 28 | leading: IconButton( 29 | onPressed: () { 30 | context.pop(); 31 | }, 32 | icon: Image.asset( 33 | "assets/img/back.png", 34 | width: 25, 35 | height: 25, 36 | ), 37 | ), 38 | centerTitle: true, 39 | title: Text( 40 | "Contact Us", 41 | style: TextStyle( 42 | color: TColor.primaryText, 43 | fontSize: 18, 44 | fontWeight: FontWeight.w800, 45 | ), 46 | ), 47 | ), 48 | backgroundColor: Colors.white, 49 | body: SingleChildScrollView( 50 | child: Padding( 51 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 25), 52 | child: Column( 53 | children: [ 54 | LineTextField( 55 | title: "Name", 56 | hintText: "Enter Name", 57 | controller: txtName, 58 | ), 59 | const SizedBox( 60 | height: 15, 61 | ), 62 | LineTextField( 63 | title: "Email", 64 | hintText: "Enter Email Address", 65 | keyboardType: TextInputType.emailAddress, 66 | controller: txtEmail, 67 | ), 68 | const SizedBox( 69 | height: 15, 70 | ), 71 | LineTextField( 72 | title: "Subject", 73 | hintText: "Enter Subject", 74 | controller: txtSubject, 75 | ), 76 | const SizedBox( 77 | height: 15, 78 | ), 79 | LineTextField( 80 | title: "Message", 81 | hintText: "Enter Message", 82 | minLines: 5, 83 | maxLines: 10, 84 | controller: txtMessage, 85 | ), 86 | const SizedBox( 87 | height: 35, 88 | ), 89 | RoundButton( 90 | title: "Submit", 91 | onPressed: () { 92 | actionSubmit(); 93 | }) 94 | ], 95 | ), 96 | ), 97 | ), 98 | ); 99 | } 100 | //TODO: Action 101 | 102 | void actionSubmit() { 103 | if (txtName.text.isEmpty) { 104 | mdShowAlert("Error", "Please enter number", () {}); 105 | return; 106 | } 107 | 108 | if (!txtEmail.text.isEmail) { 109 | mdShowAlert("Error", "Please enter valid email address", () {}); 110 | return; 111 | } 112 | 113 | if (txtSubject.text.isEmpty) { 114 | mdShowAlert("Error", "Please enter subject", () {}); 115 | return; 116 | } 117 | 118 | if (txtMessage.text.isEmpty) { 119 | mdShowAlert("Error", "Please enter message", () {}); 120 | return; 121 | } 122 | 123 | endEditing(); 124 | 125 | apiContactSubmit({ 126 | "name": txtName.text, 127 | "email": txtEmail.text, 128 | "subject": txtSubject.text, 129 | "message": txtMessage.text 130 | }); 131 | } 132 | 133 | //TODO: ApiCalling 134 | 135 | void apiContactSubmit(Map parameter) { 136 | Globs.showHUD(); 137 | ServiceCall.post(parameter, SVKey.svContactUs, 138 | withSuccess: (responseObj) async { 139 | Globs.hideHUD(); 140 | 141 | if (responseObj[KKey.status] == "1") { 142 | mdShowAlert( 143 | Globs.appName, responseObj[KKey.message] as String? ?? MSG.success, 144 | () { 145 | context.pop(); 146 | }); 147 | } else { 148 | mdShowAlert( 149 | "Error", responseObj[KKey.message] as String? ?? MSG.fail, () {}); 150 | } 151 | }, failure: (err) async { 152 | Globs.hideHUD(); 153 | mdShowAlert("Error", err.toString(), () {}); 154 | }); 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /lib/view/menu/edit_profile_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_country_code_picker/fl_country_code_picker.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:taxi_driver/common/color_extension.dart'; 4 | import 'package:taxi_driver/common_widget/line_text_field.dart'; 5 | import 'package:taxi_driver/common_widget/round_button.dart'; 6 | 7 | class EditProfileView extends StatefulWidget { 8 | const EditProfileView({super.key}); 9 | 10 | @override 11 | State createState() => _EditProfileViewState(); 12 | } 13 | 14 | class _EditProfileViewState extends State { 15 | FlCountryCodePicker countryCodePicker = const FlCountryCodePicker(); 16 | TextEditingController txtFirstName = TextEditingController(); 17 | TextEditingController txtLastName = TextEditingController(); 18 | TextEditingController txtEmail = TextEditingController(); 19 | TextEditingController txtMobile = TextEditingController(); 20 | late CountryCode countryCode; 21 | 22 | 23 | @override 24 | void initState() { 25 | // TODO: implement initState 26 | super.initState(); 27 | 28 | countryCode = countryCodePicker.countryCodes 29 | .firstWhere((element) => element.name == "India"); 30 | } 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | return Scaffold( 35 | appBar: AppBar( 36 | elevation: 0.5, 37 | backgroundColor: Colors.white, 38 | leading: IconButton( 39 | onPressed: () { 40 | context.pop(); 41 | }, 42 | icon: Image.asset( 43 | "assets/img/back.png", 44 | width: 25, 45 | height: 25, 46 | ), 47 | ), 48 | centerTitle: true, 49 | title: Text( 50 | "Edit Profile", 51 | style: TextStyle( 52 | color: TColor.primaryText, 53 | fontSize: 18, 54 | fontWeight: FontWeight.w800, 55 | ), 56 | ), 57 | ), 58 | body: SingleChildScrollView( 59 | child: Padding( 60 | padding: const EdgeInsets.symmetric(horizontal: 20), 61 | child: Column( 62 | crossAxisAlignment: CrossAxisAlignment.start, 63 | children: [ 64 | 65 | 66 | const SizedBox( 67 | height: 30, 68 | ), 69 | LineTextField( 70 | title: "First name", 71 | hintText: "Ex: Amit", 72 | controller: txtFirstName, 73 | ), 74 | const SizedBox( 75 | height: 8, 76 | ), 77 | LineTextField( 78 | title: "Last name", 79 | hintText: "Ex: Patel", 80 | controller: txtLastName, 81 | ), 82 | const SizedBox( 83 | height: 8, 84 | ), 85 | Text( 86 | "Mobile Number", 87 | style: TextStyle(color: TColor.placeholder, fontSize: 14), 88 | ), 89 | Row( 90 | mainAxisAlignment: MainAxisAlignment.start, 91 | children: [ 92 | InkWell( 93 | onTap: () async { 94 | final code = 95 | await countryCodePicker.showPicker(context: context); 96 | if (code != null) { 97 | countryCode = code; 98 | setState(() {}); 99 | } 100 | }, 101 | child: Row( 102 | mainAxisSize: MainAxisSize.min, 103 | children: [ 104 | SizedBox( 105 | width: 30, 106 | height: 20, 107 | child: countryCode.flagImage(), 108 | ), 109 | Text( 110 | " ${countryCode.dialCode}", 111 | style: TextStyle( 112 | color: TColor.primaryText, fontSize: 16), 113 | ), 114 | ], 115 | ), 116 | ), 117 | const SizedBox( 118 | width: 15, 119 | ), 120 | Expanded( 121 | child: TextField( 122 | controller: txtMobile, 123 | keyboardType: TextInputType.phone, 124 | decoration: const InputDecoration( 125 | contentPadding: EdgeInsets.zero, 126 | focusedBorder: InputBorder.none, 127 | enabledBorder: InputBorder.none, 128 | hintText: "9876543210", 129 | ), 130 | ), 131 | ) 132 | ], 133 | ), 134 | const Divider(), 135 | const SizedBox( 136 | height: 8, 137 | ), 138 | LineTextField( 139 | title: "Email Address", 140 | hintText: "Ex: 123@gmail.com,", 141 | controller: txtEmail, 142 | ), 143 | 144 | const SizedBox( 145 | height: 25, 146 | ), 147 | RoundButton( 148 | onPressed: () { 149 | 150 | }, 151 | title: "SAVE", 152 | ), 153 | ], 154 | ), 155 | ), 156 | ), 157 | ); 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /lib/view/menu/my_car_details_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/common_widget/car_document_row.dart'; 4 | 5 | class MyCarDetailsView extends StatefulWidget { 6 | const MyCarDetailsView({super.key}); 7 | 8 | @override 9 | State createState() => _MyCarDetailsViewState(); 10 | } 11 | 12 | class _MyCarDetailsViewState extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return Scaffold( 16 | appBar: AppBar( 17 | elevation: 0.5, 18 | backgroundColor: Colors.white, 19 | leading: IconButton( 20 | onPressed: () { 21 | context.pop(); 22 | }, 23 | icon: Image.asset( 24 | "assets/img/back.png", 25 | width: 25, 26 | height: 25, 27 | ), 28 | ), 29 | centerTitle: true, 30 | title: Column( 31 | children: [ 32 | Text( 33 | "Toyota Prius", 34 | style: TextStyle( 35 | color: TColor.primaryText, 36 | fontSize: 16, 37 | fontWeight: FontWeight.w800, 38 | ), 39 | ), 40 | Text( 41 | "AB 1234", 42 | style: TextStyle( 43 | color: TColor.secondaryText, 44 | fontSize: 14, 45 | ), 46 | ), 47 | ], 48 | ), 49 | ), 50 | body: SingleChildScrollView( 51 | child: Column( 52 | children: [ 53 | CarDocumentRow( 54 | title: "Vehicle Registration", 55 | date: "Vehicle Registration", 56 | status: "APPROVED", 57 | statusColor: Colors.green, 58 | onPressed: () {}), 59 | 60 | CarDocumentRow( 61 | title: "Vehicle Insurance", 62 | date: "Expires: 31 Dec 2024", 63 | status: "APPROVED", 64 | statusColor: Colors.green, 65 | onPressed: () {}), 66 | 67 | CarDocumentRow( 68 | title: "Vehicle Permit", 69 | date: "Expires: 31 Dec 2024", 70 | status: "APPROVED", 71 | statusColor: Colors.green, 72 | onPressed: () {}), 73 | 74 | CarDocumentRow( 75 | title: "Vehicle Loan EMI Details", 76 | date: "Incorrect document type", 77 | status: "NOT APPROVED", 78 | statusColor: Colors.red, 79 | onPressed: () {}), 80 | ], 81 | ), 82 | ), 83 | ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /lib/view/menu/service_type_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/common_widget/switch_row.dart'; 4 | 5 | class ServiceTypeView extends StatefulWidget { 6 | const ServiceTypeView({super.key}); 7 | 8 | @override 9 | State createState() => _ServiceTypeViewState(); 10 | } 11 | 12 | class _ServiceTypeViewState extends State { 13 | List listArr = [ 14 | {"name": "Executive", "detail": "What is executive", "value": false}, 15 | {"name": "Limo", "detail": "What is limo", "value": true}, 16 | { 17 | "name": "Economy", 18 | "detail": "Describe short brief to undestand", 19 | "value": false 20 | }, 21 | ]; 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return Scaffold( 26 | appBar: AppBar( 27 | elevation: 0.5, 28 | backgroundColor: Colors.white, 29 | leading: IconButton( 30 | onPressed: () { 31 | context.pop(); 32 | }, 33 | icon: Image.asset( 34 | "assets/img/back.png", 35 | width: 25, 36 | height: 25, 37 | ), 38 | ), 39 | centerTitle: true, 40 | title: Text( 41 | "Switch service type", 42 | style: TextStyle( 43 | color: TColor.primaryText, 44 | fontSize: 18, 45 | fontWeight: FontWeight.w800, 46 | ), 47 | ), 48 | ), 49 | body: ListView.separated( 50 | padding: const EdgeInsets.all(20), 51 | itemBuilder: (context, index) { 52 | return SwitchRow( 53 | sObj: listArr[index] as Map? ?? {}, 54 | didChange: (isNew) {}, 55 | ); 56 | }, 57 | separatorBuilder: (context, index) => Divider( 58 | color: TColor.lightGray, 59 | ), 60 | itemCount: listArr.length), 61 | ); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/view/menu/settings_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:taxi_driver/common/color_extension.dart'; 3 | import 'package:taxi_driver/common_widget/setting_row.dart'; 4 | import 'package:taxi_driver/view/home/support/support_list_view.dart'; 5 | import 'package:taxi_driver/view/login/bank_detail_view.dart'; 6 | import 'package:taxi_driver/view/login/document_upload_view.dart'; 7 | import 'package:taxi_driver/view/menu/change_password_view.dart'; 8 | import 'package:taxi_driver/view/menu/contact_us_view.dart'; 9 | import 'package:taxi_driver/view/menu/my_profile_view.dart'; 10 | import 'package:taxi_driver/view/menu/my_vehicle_view.dart'; 11 | 12 | class SettingsView extends StatefulWidget { 13 | const SettingsView({super.key}); 14 | 15 | @override 16 | State createState() => _SettingsViewState(); 17 | } 18 | 19 | class _SettingsViewState extends State { 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | appBar: AppBar( 24 | elevation: 0.5, 25 | backgroundColor: Colors.white, 26 | leading: IconButton( 27 | onPressed: () { 28 | context.pop(); 29 | }, 30 | icon: Image.asset( 31 | "assets/img/back.png", 32 | width: 25, 33 | height: 25, 34 | ), 35 | ), 36 | centerTitle: true, 37 | title: Text( 38 | "Settings", 39 | style: TextStyle( 40 | color: TColor.primaryText, 41 | fontSize: 18, 42 | fontWeight: FontWeight.w800, 43 | ), 44 | ), 45 | ), 46 | backgroundColor: TColor.lightWhite, 47 | body: SingleChildScrollView( 48 | child: Column( 49 | crossAxisAlignment: CrossAxisAlignment.start, 50 | children: [ 51 | const SizedBox( 52 | height: 8, 53 | ), 54 | SettingRow( 55 | title: "My Profile", 56 | icon: "assets/img/sm_profile.png", 57 | onPressed: () { 58 | context.push(const MyProfileView()); 59 | }), 60 | SettingRow( 61 | title: "My Vehicle", 62 | icon: "assets/img/sm_my_vehicle.png", 63 | onPressed: () { 64 | context.push(const MyVehicleView()); 65 | }), 66 | SettingRow( 67 | title: "Personal Documents", 68 | icon: "assets/img/sm_document.png", 69 | onPressed: () { 70 | context.push( 71 | const DocumentUploadView(title: "Personal Document")); 72 | }), 73 | SettingRow( 74 | title: "Bank details", 75 | icon: "assets/img/sm_bank.png", 76 | onPressed: () { 77 | context.push(const BankDetailView()); 78 | }), 79 | SettingRow( 80 | title: "Change Password", 81 | icon: "assets/img/sm_password.png", 82 | onPressed: () { 83 | context.push(const ChangePasswordView()); 84 | }), 85 | const SizedBox( 86 | height: 15, 87 | ), 88 | Padding( 89 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8), 90 | child: Text( 91 | "HELP", 92 | style: TextStyle( 93 | color: TColor.primaryText, 94 | fontSize: 15, 95 | fontWeight: FontWeight.w800, 96 | ), 97 | ), 98 | ), 99 | SettingRow( 100 | title: "Terms & Conditions", 101 | icon: "assets/img/sm_document.png", 102 | onPressed: () {}), 103 | SettingRow( 104 | title: "Privacy Policies", 105 | icon: "assets/img/sm_document.png", 106 | onPressed: () {}), 107 | SettingRow( 108 | title: "About", 109 | icon: "assets/img/sm_document.png", 110 | onPressed: () {}), 111 | SettingRow( 112 | title: "Contact us", 113 | icon: "assets/img/sm_profile.png", 114 | onPressed: () { 115 | context.push(const ContactUsView()); 116 | }), 117 | SettingRow( 118 | title: "Supports", 119 | icon: "assets/img/sm_profile.png", 120 | onPressed: () { 121 | context.push(const SupportListView()); 122 | }), 123 | ], 124 | ), 125 | ), 126 | ); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: taxi_driver 2 | description: A new Flutter project. 3 | # The following line prevents the package from being accidentally published to 4 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 5 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 6 | 7 | # The following defines the version and build number for your application. 8 | # A version number is three numbers separated by dots, like 1.2.43 9 | # followed by an optional build number separated by a +. 10 | # Both the version and the builder number may be overridden in flutter 11 | # build by specifying --build-name and --build-number, respectively. 12 | # In Android, build-name is used as versionName while build-number used as versionCode. 13 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 14 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. 15 | # Read more about iOS versioning at 16 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 17 | # In Windows, build-name is used as the major, minor, and patch parts 18 | # of the product and file versions while build-number is used as the build suffix. 19 | version: 1.0.0+1 20 | 21 | environment: 22 | sdk: '>=3.1.2 <4.0.0' 23 | 24 | # Dependencies specify other packages that your package needs in order to work. 25 | # To automatically upgrade your package dependencies to the latest versions 26 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 27 | # dependencies can be manually updated by changing the version numbers below to 28 | # the latest version available on pub.dev. To see which dependencies have newer 29 | # versions available, run `flutter pub outdated`. 30 | dependencies: 31 | flutter: 32 | sdk: flutter 33 | 34 | 35 | # The following adds the Cupertino Icons font to your application. 36 | # Use with the CupertinoIcons class for iOS style icons. 37 | cupertino_icons: ^1.0.2 38 | fl_country_code_picker: ^0.1.9+1 39 | flutter_otp_text_field: ^1.1.1 40 | otp_timer_button: ^1.1.0 41 | flutter_osm_plugin: ^0.70.3 42 | flutter_timer_countdown: ^1.0.7 43 | flutter_rating_bar: ^4.0.1 44 | fl_chart: ^0.68.0 45 | firebase_core: ^3.1.0 46 | firebase_auth: ^5.1.0 47 | flutter_easyloading: ^3.0.5 48 | shared_preferences: ^2.2.2 49 | intl: ^0.18.1 50 | cached_network_image: ^3.3.0 51 | flutter_timezone: ^1.0.8 52 | http: ^1.1.2 53 | bloc: ^8.1.2 54 | flutter_bloc: ^8.1.3 55 | equatable: ^2.0.5 56 | image_picker: ^1.0.5 57 | flutter_slidable: ^3.0.1 58 | socket_io_client: ^2.0.3+1 59 | bubble: ^1.2.1 60 | timeago: ^3.6.0 61 | sqflite: ^2.3.2 62 | geocoding: ^3.0.0 63 | maps_toolkit: ^3.0.0 64 | geolocator: ^12.0.0 65 | path_provider: ^2.1.2 66 | 67 | dev_dependencies: 68 | flutter_test: 69 | sdk: flutter 70 | 71 | # The "flutter_lints" package below contains a set of recommended lints to 72 | # encourage good coding practices. The lint set provided by the package is 73 | # activated in the `analysis_options.yaml` file located at the root of your 74 | # package. See that file for information about deactivating specific lint 75 | # rules and activating additional ones. 76 | flutter_lints: ^4.0.0 77 | 78 | # For information on the generic Dart part of this file, see the 79 | # following page: https://dart.dev/tools/pub/pubspec 80 | 81 | # The following section is specific to Flutter packages. 82 | flutter: 83 | 84 | # The following line ensures that the Material Icons font is 85 | # included with your application, so that you can use the icons in 86 | # the material Icons class. 87 | uses-material-design: true 88 | 89 | # To add assets to your application, add an assets section, like this: 90 | assets: 91 | - assets/img/ 92 | 93 | # An image asset can refer to one or more resolution-specific "variants", see 94 | # https://flutter.dev/assets-and-images/#resolution-aware 95 | 96 | # For details regarding adding assets from package dependencies, see 97 | # https://flutter.dev/assets-and-images/#from-packages 98 | 99 | # To add custom fonts to your application, add a fonts section here, 100 | # in this "flutter" section. Each entry in this list should have a 101 | # "family" key with the font family name, and a "fonts" key with a 102 | # list giving the asset and other descriptors for the font. For 103 | # example: 104 | fonts: 105 | - family: NunitoSans 106 | fonts: 107 | - asset: assets/font/NunitoSans-Regular.ttf 108 | - asset: assets/font/NunitoSans-Medium.ttf 109 | weight: 500 110 | - asset: assets/font/NunitoSans-SemiBold.ttf 111 | weight: 600 112 | - asset: assets/font/NunitoSans-Bold.ttf 113 | weight: 700 114 | - asset: assets/font/NunitoSans-ExtraBold.ttf 115 | weight: 800 116 | # 117 | # For details regarding fonts from package dependencies, 118 | # see https://flutter.dev/custom-fonts/#from-packages 119 | --------------------------------------------------------------------------------