Merge branch 'master' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into Haroon
# Conflicts: # lib/config/config.dart # lib/pages/BookAppointment/BookingOptions.dart # lib/services/appointment_services/GetDoctorsList.dart # lib/uitl/translations_delegate_base.dart # lib/widgets/others/app_scaffold_widget.dartmerge-requests/34/merge
commit
d8fe501341
@ -0,0 +1,42 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "815750722565",
|
||||
"firebase_url": "https://api-project-815750722565.firebaseio.com",
|
||||
"project_id": "api-project-815750722565",
|
||||
"storage_bucket": "api-project-815750722565.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063",
|
||||
"android_client_info": {
|
||||
"package_name": "com.cloud.diplomaticquarterapp"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDUfg6AKM1-00WyzpvLImUBC46wFrq9-qw"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"analytics_service": {
|
||||
"status": 1
|
||||
},
|
||||
"appinvite_service": {
|
||||
"status": 1,
|
||||
"other_platform_oauth_client": []
|
||||
},
|
||||
"ads_service": {
|
||||
"status": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
@ -0,0 +1 @@
|
||||
include ':app'
|
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
@ -1 +1,2 @@
|
||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||
#include "Generated.xcconfig"
|
||||
|
@ -1 +1,2 @@
|
||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||
#include "Generated.xcconfig"
|
||||
|
@ -0,0 +1,87 @@
|
||||
# Uncomment this line to define a global platform for your project
|
||||
platform :ios, '9.0'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
|
||||
project 'Runner', {
|
||||
'Debug' => :debug,
|
||||
'Profile' => :release,
|
||||
'Release' => :release,
|
||||
}
|
||||
|
||||
def parse_KV_file(file, separator='=')
|
||||
file_abs_path = File.expand_path(file)
|
||||
if !File.exists? file_abs_path
|
||||
return [];
|
||||
end
|
||||
generated_key_values = {}
|
||||
skip_line_start_symbols = ["#", "/"]
|
||||
File.foreach(file_abs_path) do |line|
|
||||
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
|
||||
plugin = line.split(pattern=separator)
|
||||
if plugin.length == 2
|
||||
podname = plugin[0].strip()
|
||||
path = plugin[1].strip()
|
||||
podpath = File.expand_path("#{path}", file_abs_path)
|
||||
generated_key_values[podname] = podpath
|
||||
else
|
||||
puts "Invalid plugin specification: #{line}"
|
||||
end
|
||||
end
|
||||
generated_key_values
|
||||
end
|
||||
|
||||
target 'Runner' do
|
||||
use_frameworks!
|
||||
use_modular_headers!
|
||||
|
||||
# Flutter Pod
|
||||
|
||||
copied_flutter_dir = File.join(__dir__, 'Flutter')
|
||||
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
|
||||
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
|
||||
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
|
||||
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
|
||||
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
|
||||
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
|
||||
|
||||
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
|
||||
unless File.exist?(generated_xcode_build_settings_path)
|
||||
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
|
||||
end
|
||||
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
|
||||
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
|
||||
|
||||
unless File.exist?(copied_framework_path)
|
||||
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
|
||||
end
|
||||
unless File.exist?(copied_podspec_path)
|
||||
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
|
||||
end
|
||||
end
|
||||
|
||||
# Keep pod path relative so it can be checked into Podfile.lock.
|
||||
pod 'Flutter', :path => 'Flutter'
|
||||
|
||||
# Plugin Pods
|
||||
|
||||
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
|
||||
# referring to absolute paths on developers' machines.
|
||||
system('rm -rf .symlinks')
|
||||
system('mkdir -p .symlinks/plugins')
|
||||
plugin_pods = parse_KV_file('../.flutter-plugins')
|
||||
plugin_pods.each do |name, path|
|
||||
symlink = File.join('.symlinks', 'plugins', name)
|
||||
File.symlink(path, symlink)
|
||||
pod name, :path => File.join(symlink, 'ios')
|
||||
end
|
||||
end
|
||||
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['ENABLE_BITCODE'] = 'NO'
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,292 @@
|
||||
PODS:
|
||||
- barcode_scan (0.0.1):
|
||||
- Flutter
|
||||
- MTBBarcodeScanner
|
||||
- SwiftProtobuf
|
||||
- connectivity (0.0.1):
|
||||
- Flutter
|
||||
- Reachability
|
||||
- connectivity_for_web (0.1.0):
|
||||
- Flutter
|
||||
- connectivity_macos (0.0.1):
|
||||
- Flutter
|
||||
- device_info (0.0.1):
|
||||
- Flutter
|
||||
- Firebase/Core (6.23.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseAnalytics (= 6.4.2)
|
||||
- Firebase/CoreOnly (6.23.0):
|
||||
- FirebaseCore (= 6.6.7)
|
||||
- Firebase/Messaging (6.23.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseMessaging (~> 4.3.1)
|
||||
- firebase_messaging (0.0.1):
|
||||
- Firebase/Core
|
||||
- Firebase/Messaging
|
||||
- Flutter
|
||||
- FirebaseAnalytics (6.4.2):
|
||||
- FirebaseCore (~> 6.6)
|
||||
- FirebaseInstallations (~> 1.2)
|
||||
- GoogleAppMeasurement (= 6.4.2)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 6.0)
|
||||
- GoogleUtilities/Network (~> 6.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 6.0)"
|
||||
- nanopb (= 0.3.9011)
|
||||
- FirebaseAnalyticsInterop (1.5.0)
|
||||
- FirebaseCore (6.6.7):
|
||||
- FirebaseCoreDiagnostics (~> 1.2)
|
||||
- FirebaseCoreDiagnosticsInterop (~> 1.2)
|
||||
- GoogleUtilities/Environment (~> 6.5)
|
||||
- GoogleUtilities/Logger (~> 6.5)
|
||||
- FirebaseCoreDiagnostics (1.2.4):
|
||||
- FirebaseCoreDiagnosticsInterop (~> 1.2)
|
||||
- GoogleDataTransportCCTSupport (~> 3.0)
|
||||
- GoogleUtilities/Environment (~> 6.5)
|
||||
- GoogleUtilities/Logger (~> 6.5)
|
||||
- nanopb (~> 0.3.901)
|
||||
- FirebaseCoreDiagnosticsInterop (1.2.0)
|
||||
- FirebaseInstallations (1.2.0):
|
||||
- FirebaseCore (~> 6.6)
|
||||
- GoogleUtilities/Environment (~> 6.6)
|
||||
- GoogleUtilities/UserDefaults (~> 6.6)
|
||||
- PromisesObjC (~> 1.2)
|
||||
- FirebaseInstanceID (4.3.4):
|
||||
- FirebaseCore (~> 6.6)
|
||||
- FirebaseInstallations (~> 1.0)
|
||||
- GoogleUtilities/Environment (~> 6.5)
|
||||
- GoogleUtilities/UserDefaults (~> 6.5)
|
||||
- FirebaseMessaging (4.3.1):
|
||||
- FirebaseAnalyticsInterop (~> 1.5)
|
||||
- FirebaseCore (~> 6.6)
|
||||
- FirebaseInstanceID (~> 4.3)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 6.5)
|
||||
- GoogleUtilities/Environment (~> 6.5)
|
||||
- GoogleUtilities/Reachability (~> 6.5)
|
||||
- GoogleUtilities/UserDefaults (~> 6.5)
|
||||
- Protobuf (>= 3.9.2, ~> 3.9)
|
||||
- Flutter (1.0.0)
|
||||
- flutter_flexible_toast (0.0.1):
|
||||
- Flutter
|
||||
- flutter_local_notifications (0.0.1):
|
||||
- Flutter
|
||||
- flutter_plugin_android_lifecycle (0.0.1):
|
||||
- Flutter
|
||||
- GoogleAppMeasurement (6.4.2):
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 6.0)
|
||||
- GoogleUtilities/Network (~> 6.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 6.0)"
|
||||
- nanopb (= 0.3.9011)
|
||||
- GoogleDataTransport (6.0.0)
|
||||
- GoogleDataTransportCCTSupport (3.0.0):
|
||||
- GoogleDataTransport (~> 6.0)
|
||||
- nanopb (~> 0.3.901)
|
||||
- GoogleUtilities/AppDelegateSwizzler (6.6.0):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Network
|
||||
- GoogleUtilities/Environment (6.6.0):
|
||||
- PromisesObjC (~> 1.2)
|
||||
- GoogleUtilities/Logger (6.6.0):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/MethodSwizzler (6.6.0):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Network (6.6.0):
|
||||
- GoogleUtilities/Logger
|
||||
- "GoogleUtilities/NSData+zlib"
|
||||
- GoogleUtilities/Reachability
|
||||
- "GoogleUtilities/NSData+zlib (6.6.0)"
|
||||
- GoogleUtilities/Reachability (6.6.0):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/UserDefaults (6.6.0):
|
||||
- GoogleUtilities/Logger
|
||||
- hexcolor (0.0.1):
|
||||
- Flutter
|
||||
- image_cropper (0.0.2):
|
||||
- Flutter
|
||||
- TOCropViewController (~> 2.5.2)
|
||||
- image_picker (0.0.1):
|
||||
- Flutter
|
||||
- local_auth (0.0.1):
|
||||
- Flutter
|
||||
- MTBBarcodeScanner (5.0.11)
|
||||
- nanopb (0.3.9011):
|
||||
- nanopb/decode (= 0.3.9011)
|
||||
- nanopb/encode (= 0.3.9011)
|
||||
- nanopb/decode (0.3.9011)
|
||||
- nanopb/encode (0.3.9011)
|
||||
- path_provider_linux (0.0.1):
|
||||
- Flutter
|
||||
- "permission_handler (5.0.1+1)":
|
||||
- Flutter
|
||||
- PromisesObjC (1.2.8)
|
||||
- Protobuf (3.11.4)
|
||||
- Reachability (3.2)
|
||||
- shared_preferences (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_linux (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_macos (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_web (0.0.1):
|
||||
- Flutter
|
||||
- SwiftProtobuf (1.10.2)
|
||||
- TOCropViewController (2.5.4)
|
||||
- url_launcher (0.0.1):
|
||||
- Flutter
|
||||
- url_launcher_linux (0.0.1):
|
||||
- Flutter
|
||||
- url_launcher_macos (0.0.1):
|
||||
- Flutter
|
||||
- url_launcher_web (0.0.1):
|
||||
- Flutter
|
||||
|
||||
DEPENDENCIES:
|
||||
- barcode_scan (from `.symlinks/plugins/barcode_scan/ios`)
|
||||
- connectivity (from `.symlinks/plugins/connectivity/ios`)
|
||||
- connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`)
|
||||
- connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`)
|
||||
- device_info (from `.symlinks/plugins/device_info/ios`)
|
||||
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`)
|
||||
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
|
||||
- flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`)
|
||||
- hexcolor (from `.symlinks/plugins/hexcolor/ios`)
|
||||
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
|
||||
- image_picker (from `.symlinks/plugins/image_picker/ios`)
|
||||
- local_auth (from `.symlinks/plugins/local_auth/ios`)
|
||||
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
|
||||
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
|
||||
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
||||
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
|
||||
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
|
||||
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
|
||||
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
|
||||
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
|
||||
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- Firebase
|
||||
- FirebaseAnalytics
|
||||
- FirebaseAnalyticsInterop
|
||||
- FirebaseCore
|
||||
- FirebaseCoreDiagnostics
|
||||
- FirebaseCoreDiagnosticsInterop
|
||||
- FirebaseInstallations
|
||||
- FirebaseInstanceID
|
||||
- FirebaseMessaging
|
||||
- GoogleAppMeasurement
|
||||
- GoogleDataTransport
|
||||
- GoogleDataTransportCCTSupport
|
||||
- GoogleUtilities
|
||||
- MTBBarcodeScanner
|
||||
- nanopb
|
||||
- PromisesObjC
|
||||
- Protobuf
|
||||
- Reachability
|
||||
- SwiftProtobuf
|
||||
- TOCropViewController
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
barcode_scan:
|
||||
:path: ".symlinks/plugins/barcode_scan/ios"
|
||||
connectivity:
|
||||
:path: ".symlinks/plugins/connectivity/ios"
|
||||
connectivity_for_web:
|
||||
:path: ".symlinks/plugins/connectivity_for_web/ios"
|
||||
connectivity_macos:
|
||||
:path: ".symlinks/plugins/connectivity_macos/ios"
|
||||
device_info:
|
||||
:path: ".symlinks/plugins/device_info/ios"
|
||||
firebase_messaging:
|
||||
:path: ".symlinks/plugins/firebase_messaging/ios"
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
flutter_flexible_toast:
|
||||
:path: ".symlinks/plugins/flutter_flexible_toast/ios"
|
||||
flutter_local_notifications:
|
||||
:path: ".symlinks/plugins/flutter_local_notifications/ios"
|
||||
flutter_plugin_android_lifecycle:
|
||||
:path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios"
|
||||
hexcolor:
|
||||
:path: ".symlinks/plugins/hexcolor/ios"
|
||||
image_cropper:
|
||||
:path: ".symlinks/plugins/image_cropper/ios"
|
||||
image_picker:
|
||||
:path: ".symlinks/plugins/image_picker/ios"
|
||||
local_auth:
|
||||
:path: ".symlinks/plugins/local_auth/ios"
|
||||
path_provider_linux:
|
||||
:path: ".symlinks/plugins/path_provider_linux/ios"
|
||||
permission_handler:
|
||||
:path: ".symlinks/plugins/permission_handler/ios"
|
||||
shared_preferences:
|
||||
:path: ".symlinks/plugins/shared_preferences/ios"
|
||||
shared_preferences_linux:
|
||||
:path: ".symlinks/plugins/shared_preferences_linux/ios"
|
||||
shared_preferences_macos:
|
||||
:path: ".symlinks/plugins/shared_preferences_macos/ios"
|
||||
shared_preferences_web:
|
||||
:path: ".symlinks/plugins/shared_preferences_web/ios"
|
||||
url_launcher:
|
||||
:path: ".symlinks/plugins/url_launcher/ios"
|
||||
url_launcher_linux:
|
||||
:path: ".symlinks/plugins/url_launcher_linux/ios"
|
||||
url_launcher_macos:
|
||||
:path: ".symlinks/plugins/url_launcher_macos/ios"
|
||||
url_launcher_web:
|
||||
:path: ".symlinks/plugins/url_launcher_web/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
barcode_scan: a5c27959edfafaa0c771905bad0b29d6d39e4479
|
||||
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
|
||||
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
|
||||
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
|
||||
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
|
||||
Firebase: 585ae467b3edda6a5444e788fda6888f024d8d6f
|
||||
firebase_messaging: 21344b3b3a7d9d325d63a70e3750c0c798fe1e03
|
||||
FirebaseAnalytics: 558f7a03d19de451093032c806f39d5f9dff096e
|
||||
FirebaseAnalyticsInterop: 3f86269c38ae41f47afeb43ebf32a001f58fcdae
|
||||
FirebaseCore: a2788a0d5f6c1dff17b8f79b4a73654a8d4bfdbd
|
||||
FirebaseCoreDiagnostics: b59c024493a409f8aecba02c99928d0d8431d159
|
||||
FirebaseCoreDiagnosticsInterop: 296e2c5f5314500a850ad0b83e9e7c10b011a850
|
||||
FirebaseInstallations: 2119fb3e46b0a88bfdbf12562f855ee3252462fa
|
||||
FirebaseInstanceID: cef67c4967c7cecb56ea65d8acbb4834825c587b
|
||||
FirebaseMessaging: 828e66eb357a893e3cebd9ee0f6bc1941447cc94
|
||||
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
|
||||
flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143
|
||||
flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186
|
||||
flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35
|
||||
GoogleAppMeasurement: 2253e99c1f22638cf234c059144660c338ad76c3
|
||||
GoogleDataTransport: 061fe7d9b476710e3cd8ea51e8e07d8b67c2b420
|
||||
GoogleDataTransportCCTSupport: 0f39025e8cf51f168711bd3fb773938d7e62ddb5
|
||||
GoogleUtilities: 39530bc0ad980530298e9c4af8549e991fd033b1
|
||||
hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89
|
||||
image_cropper: 3c16d7651730ffe85897f5a1c4e2547e6b54989a
|
||||
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
|
||||
local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd
|
||||
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
||||
nanopb: 18003b5e52dab79db540fe93fe9579f399bd1ccd
|
||||
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
|
||||
permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6
|
||||
PromisesObjC: c119f3cd559f50b7ae681fa59dc1acd19173b7e6
|
||||
Protobuf: 176220c526ad8bd09ab1fb40a978eac3fef665f7
|
||||
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
|
||||
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
|
||||
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
|
||||
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
|
||||
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
|
||||
SwiftProtobuf: bec1ae7d686ff73dd09d79866154f4970b891410
|
||||
TOCropViewController: 2a1ae1242600b1f2d996fd91a5268b2309a33b5c
|
||||
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
|
||||
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
|
||||
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
|
||||
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
|
||||
|
||||
PODFILE CHECKSUM: 2609452b760cd11039b14039a86564367a3d8ab9
|
||||
|
||||
COCOAPODS: 1.9.1
|
@ -1,3 +1,7 @@
|
||||
const TOKEN = 'token';
|
||||
const APP_LANGUAGE = 'language';
|
||||
|
||||
const USER_PROFILE = 'user-profile';
|
||||
const PUSH_TOKEN = 'push-token';
|
||||
const REGISTER_DATA_FOR_REGISTER = 'register-data-for-register';
|
||||
const LOGIN_TOKEN_ID = 'register-data-for-register';
|
||||
const REGISTER_DATA_FOR_LOGIIN = 'register-data-for-login';
|
||||
|
@ -0,0 +1 @@
|
||||
enum ViewState { Idle, Busy, Error }
|
@ -0,0 +1,76 @@
|
||||
class CheckPatientAuthenticationReq {
|
||||
int patientMobileNumber;
|
||||
String zipCode;
|
||||
bool isRegister;
|
||||
String tokenID;
|
||||
int searchType;
|
||||
String patientIdentificationID;
|
||||
int patientID;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
Null sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
|
||||
CheckPatientAuthenticationReq(
|
||||
{this.patientMobileNumber,
|
||||
this.zipCode,
|
||||
this.isRegister,
|
||||
this.tokenID,
|
||||
this.searchType,
|
||||
this.patientIdentificationID,
|
||||
this.patientID,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID});
|
||||
|
||||
CheckPatientAuthenticationReq.fromJson(Map<String, dynamic> json) {
|
||||
patientMobileNumber = json['PatientMobileNumber'];
|
||||
zipCode = json['ZipCode'];
|
||||
isRegister = json['isRegister'];
|
||||
tokenID = json['TokenID'];
|
||||
searchType = json['SearchType'];
|
||||
patientIdentificationID = json['PatientIdentificationID'];
|
||||
patientID = json['PatientID'];
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientMobileNumber'] = this.patientMobileNumber;
|
||||
data['ZipCode'] = this.zipCode;
|
||||
data['isRegister'] = this.isRegister;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['SearchType'] = this.searchType;
|
||||
data['PatientIdentificationID'] = this.patientIdentificationID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
class SelectDeviceIMEIRES {
|
||||
bool biometricEnabled;
|
||||
String createdOn;
|
||||
String editedOn;
|
||||
int iD;
|
||||
String iMEI;
|
||||
String identificationNo;
|
||||
int logInType;
|
||||
String mobile;
|
||||
String name;
|
||||
String nameN;
|
||||
bool outSA;
|
||||
int patientID;
|
||||
int patientType;
|
||||
int preferredLanguage;
|
||||
|
||||
SelectDeviceIMEIRES(
|
||||
{this.biometricEnabled,
|
||||
this.createdOn,
|
||||
this.editedOn,
|
||||
this.iD,
|
||||
this.iMEI,
|
||||
this.identificationNo,
|
||||
this.logInType,
|
||||
this.mobile,
|
||||
this.name,
|
||||
this.nameN,
|
||||
this.outSA,
|
||||
this.patientID,
|
||||
this.patientType,
|
||||
this.preferredLanguage});
|
||||
|
||||
SelectDeviceIMEIRES.fromJson(Map<String, dynamic> json) {
|
||||
biometricEnabled = json['BiometricEnabled'];
|
||||
createdOn = json['CreatedOn'];
|
||||
editedOn = json['EditedOn'];
|
||||
iD = json['ID'];
|
||||
iMEI = json['IMEI'];
|
||||
identificationNo = json['IdentificationNo'];
|
||||
logInType = json['LogInType'];
|
||||
mobile = json['Mobile'];
|
||||
name = json['Name'];
|
||||
nameN = json['NameN'];
|
||||
outSA = json['OutSA'];
|
||||
patientID = json['PatientID'];
|
||||
patientType = json['PatientType'];
|
||||
preferredLanguage = json['PreferredLanguage'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['BiometricEnabled'] = this.biometricEnabled;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['EditedOn'] = this.editedOn;
|
||||
data['ID'] = this.iD;
|
||||
data['IMEI'] = this.iMEI;
|
||||
data['IdentificationNo'] = this.identificationNo;
|
||||
data['LogInType'] = this.logInType;
|
||||
data['Mobile'] = this.mobile;
|
||||
data['Name'] = this.name;
|
||||
data['NameN'] = this.nameN;
|
||||
data['OutSA'] = this.outSA;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['PreferredLanguage'] = this.preferredLanguage;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
class HospitalsModel {
|
||||
String desciption;
|
||||
Null desciptionN;
|
||||
int iD;
|
||||
String legalName;
|
||||
String legalNameN;
|
||||
String name;
|
||||
Null nameN;
|
||||
String phoneNumber;
|
||||
String setupID;
|
||||
int distanceInKilometers;
|
||||
bool isActive;
|
||||
String latitude;
|
||||
String longitude;
|
||||
int mainProjectID;
|
||||
Null projectOutSA;
|
||||
bool usingInDoctorApp;
|
||||
|
||||
HospitalsModel(
|
||||
{this.desciption,
|
||||
this.desciptionN,
|
||||
this.iD,
|
||||
this.legalName,
|
||||
this.legalNameN,
|
||||
this.name,
|
||||
this.nameN,
|
||||
this.phoneNumber,
|
||||
this.setupID,
|
||||
this.distanceInKilometers,
|
||||
this.isActive,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.mainProjectID,
|
||||
this.projectOutSA,
|
||||
this.usingInDoctorApp});
|
||||
|
||||
HospitalsModel.fromJson(Map<String, dynamic> json) {
|
||||
desciption = json['Desciption'];
|
||||
desciptionN = json['DesciptionN'];
|
||||
iD = json['ID'];
|
||||
legalName = json['LegalName'];
|
||||
legalNameN = json['LegalNameN'];
|
||||
name = json['Name'];
|
||||
nameN = json['NameN'];
|
||||
phoneNumber = json['PhoneNumber'];
|
||||
setupID = json['SetupID'];
|
||||
distanceInKilometers = json['DistanceInKilometers'];
|
||||
isActive = json['IsActive'];
|
||||
latitude = json['Latitude'];
|
||||
longitude = json['Longitude'];
|
||||
mainProjectID = json['MainProjectID'];
|
||||
projectOutSA = json['ProjectOutSA'];
|
||||
usingInDoctorApp = json['UsingInDoctorApp'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['Desciption'] = this.desciption;
|
||||
data['DesciptionN'] = this.desciptionN;
|
||||
data['ID'] = this.iD;
|
||||
data['LegalName'] = this.legalName;
|
||||
data['LegalNameN'] = this.legalNameN;
|
||||
data['Name'] = this.name;
|
||||
data['NameN'] = this.nameN;
|
||||
data['PhoneNumber'] = this.phoneNumber;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['DistanceInKilometers'] = this.distanceInKilometers;
|
||||
data['IsActive'] = this.isActive;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['MainProjectID'] = this.mainProjectID;
|
||||
data['ProjectOutSA'] = this.projectOutSA;
|
||||
data['UsingInDoctorApp'] = this.usingInDoctorApp;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
class RequestGetHospitalsModel {
|
||||
int latitude;
|
||||
int longitude;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
|
||||
RequestGetHospitalsModel(
|
||||
{this.latitude,
|
||||
this.longitude,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID});
|
||||
|
||||
RequestGetHospitalsModel.fromJson(Map<String, dynamic> json) {
|
||||
latitude = json['Latitude'];
|
||||
longitude = json['Longitude'];
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['Latitude'] = this.latitude;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
|
||||
import 'client/base_app_client.dart';
|
||||
|
||||
class BaseService{
|
||||
String error;
|
||||
bool hasError = false;
|
||||
BaseAppClient baseAppClient = BaseAppClient();
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/hospitals/request_get_hospitals_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
|
||||
class HospitalService extends BaseService {
|
||||
List<HospitalsModel> _hospitals = List();
|
||||
|
||||
List<HospitalsModel> get hospitals => _hospitals;
|
||||
|
||||
RequestGetHospitalsModel _requestGetHospitalsModel = RequestGetHospitalsModel(
|
||||
latitude: 0,
|
||||
longitude: 0,
|
||||
versionID: 5.2,
|
||||
channel: 3,
|
||||
languageID: 2,
|
||||
iPAdress: '10.20.10.20',
|
||||
generalid: 'Cs2020@2016\$2958',
|
||||
patientOutSA: 0,
|
||||
sessionID: 'JUWuiMBCEGkAAxQpakQ',
|
||||
isDentalAllowedBackend: false,
|
||||
deviceTypeID: 2);
|
||||
|
||||
Future getHospitals() async {
|
||||
await baseAppClient.post(GET_PROJECT,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
_hospitals.clear();
|
||||
response['ListProject'].forEach((hospital) {
|
||||
_hospitals.add(HospitalsModel.fromJson(hospital));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: _requestGetHospitalsModel.toJson());
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BaseViewModel extends ChangeNotifier {
|
||||
ViewState _state = ViewState.Idle;
|
||||
bool isInternetConnection = true;
|
||||
|
||||
ViewState get state => _state;
|
||||
|
||||
String error = "";
|
||||
|
||||
void setState(ViewState viewState) {
|
||||
_state = viewState;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/hospital_service.dart';
|
||||
|
||||
import '../../locator.dart';
|
||||
import 'base_view_model.dart';
|
||||
|
||||
class HospitalViewModel extends BaseViewModel {
|
||||
HospitalService _hospitalService = locator<HospitalService>();
|
||||
|
||||
List<HospitalsModel> get hospitals => _hospitalService.hospitals;
|
||||
|
||||
Future getHospitals() async {
|
||||
setState(ViewState.Busy);
|
||||
await _hospitalService.getHospitals();
|
||||
if (_hospitalService.hasError) {
|
||||
error = _hospitalService.error;
|
||||
setState(ViewState.Error);
|
||||
} else
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import 'package:get_it/get_it.dart';
|
||||
|
||||
import 'core/service/hospital_service.dart';
|
||||
import 'core/viewModels/hospital_view_model.dart';
|
||||
|
||||
GetIt locator = GetIt.instance;
|
||||
|
||||
///di
|
||||
void setupLocator() {
|
||||
/// Services
|
||||
locator.registerLazySingleton(() => HospitalService());
|
||||
|
||||
/// View Model
|
||||
locator.registerFactory(() => HospitalViewModel());
|
||||
}
|
@ -0,0 +1,274 @@
|
||||
class AppoitmentAllHistoryResultList {
|
||||
String setupID;
|
||||
int projectID;
|
||||
int appointmentNo;
|
||||
String appointmentDate;
|
||||
Null appointmentDateN;
|
||||
int appointmentType;
|
||||
String bookDate;
|
||||
int patientType;
|
||||
int patientID;
|
||||
int clinicID;
|
||||
int doctorID;
|
||||
String endDate;
|
||||
String startTime;
|
||||
String endTime;
|
||||
int status;
|
||||
int visitType;
|
||||
int visitFor;
|
||||
int patientStatusType;
|
||||
int companyID;
|
||||
int bookedBy;
|
||||
String bookedOn;
|
||||
Null confirmedBy;
|
||||
Null confirmedOn;
|
||||
Null arrivalChangedBy;
|
||||
Null arrivedOn;
|
||||
Null editedBy;
|
||||
Null editedOn;
|
||||
Null doctorName;
|
||||
Null doctorNameN;
|
||||
String statusDesc;
|
||||
Null statusDescN;
|
||||
bool vitalStatus;
|
||||
Null vitalSignAppointmentNo;
|
||||
int episodeID;
|
||||
int actualDoctorRate;
|
||||
String clinicName;
|
||||
bool complainExists;
|
||||
String doctorImageURL;
|
||||
String doctorNameObj;
|
||||
int doctorRate;
|
||||
List<String> doctorSpeciality;
|
||||
String doctorTitle;
|
||||
int gender;
|
||||
String genderDescription;
|
||||
bool iSAllowOnlineCheckedIN;
|
||||
bool isActiveDoctor;
|
||||
bool isActiveDoctorProfile;
|
||||
bool isDoctorAllowVedioCall;
|
||||
bool isExecludeDoctor;
|
||||
int isFollowup;
|
||||
bool isLiveCareAppointment;
|
||||
bool isMedicalReportRequested;
|
||||
bool isOnlineCheckedIN;
|
||||
String latitude;
|
||||
Null listHISGetContactLensPerscription;
|
||||
Null listHISGetGlassPerscription;
|
||||
String longitude;
|
||||
int nextAction;
|
||||
int noOfPatientsRate;
|
||||
int originalClinicID;
|
||||
int originalProjectID;
|
||||
String projectName;
|
||||
String qR;
|
||||
int remaniningHoursTocanPay;
|
||||
bool sMSButtonVisable;
|
||||
|
||||
AppoitmentAllHistoryResultList(
|
||||
{this.setupID,
|
||||
this.projectID,
|
||||
this.appointmentNo,
|
||||
this.appointmentDate,
|
||||
this.appointmentDateN,
|
||||
this.appointmentType,
|
||||
this.bookDate,
|
||||
this.patientType,
|
||||
this.patientID,
|
||||
this.clinicID,
|
||||
this.doctorID,
|
||||
this.endDate,
|
||||
this.startTime,
|
||||
this.endTime,
|
||||
this.status,
|
||||
this.visitType,
|
||||
this.visitFor,
|
||||
this.patientStatusType,
|
||||
this.companyID,
|
||||
this.bookedBy,
|
||||
this.bookedOn,
|
||||
this.confirmedBy,
|
||||
this.confirmedOn,
|
||||
this.arrivalChangedBy,
|
||||
this.arrivedOn,
|
||||
this.editedBy,
|
||||
this.editedOn,
|
||||
this.doctorName,
|
||||
this.doctorNameN,
|
||||
this.statusDesc,
|
||||
this.statusDescN,
|
||||
this.vitalStatus,
|
||||
this.vitalSignAppointmentNo,
|
||||
this.episodeID,
|
||||
this.actualDoctorRate,
|
||||
this.clinicName,
|
||||
this.complainExists,
|
||||
this.doctorImageURL,
|
||||
this.doctorNameObj,
|
||||
this.doctorRate,
|
||||
this.doctorSpeciality,
|
||||
this.doctorTitle,
|
||||
this.gender,
|
||||
this.genderDescription,
|
||||
this.iSAllowOnlineCheckedIN,
|
||||
this.isActiveDoctor,
|
||||
this.isActiveDoctorProfile,
|
||||
this.isDoctorAllowVedioCall,
|
||||
this.isExecludeDoctor,
|
||||
this.isFollowup,
|
||||
this.isLiveCareAppointment,
|
||||
this.isMedicalReportRequested,
|
||||
this.isOnlineCheckedIN,
|
||||
this.latitude,
|
||||
this.listHISGetContactLensPerscription,
|
||||
this.listHISGetGlassPerscription,
|
||||
this.longitude,
|
||||
this.nextAction,
|
||||
this.noOfPatientsRate,
|
||||
this.originalClinicID,
|
||||
this.originalProjectID,
|
||||
this.projectName,
|
||||
this.qR,
|
||||
this.remaniningHoursTocanPay,
|
||||
this.sMSButtonVisable});
|
||||
|
||||
AppoitmentAllHistoryResultList.fromJson(Map<String, dynamic> json) {
|
||||
setupID = json['SetupID'];
|
||||
projectID = json['ProjectID'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
appointmentDate = json['AppointmentDate'];
|
||||
appointmentDateN = json['AppointmentDateN'];
|
||||
appointmentType = json['AppointmentType'];
|
||||
bookDate = json['BookDate'];
|
||||
patientType = json['PatientType'];
|
||||
patientID = json['PatientID'];
|
||||
clinicID = json['ClinicID'];
|
||||
doctorID = json['DoctorID'];
|
||||
endDate = json['EndDate'];
|
||||
startTime = json['StartTime'];
|
||||
endTime = json['EndTime'];
|
||||
status = json['Status'];
|
||||
visitType = json['VisitType'];
|
||||
visitFor = json['VisitFor'];
|
||||
patientStatusType = json['PatientStatusType'];
|
||||
companyID = json['CompanyID'];
|
||||
bookedBy = json['BookedBy'];
|
||||
bookedOn = json['BookedOn'];
|
||||
confirmedBy = json['ConfirmedBy'];
|
||||
confirmedOn = json['ConfirmedOn'];
|
||||
arrivalChangedBy = json['ArrivalChangedBy'];
|
||||
arrivedOn = json['ArrivedOn'];
|
||||
editedBy = json['EditedBy'];
|
||||
editedOn = json['EditedOn'];
|
||||
doctorName = json['DoctorName'];
|
||||
doctorNameN = json['DoctorNameN'];
|
||||
statusDesc = json['StatusDesc'];
|
||||
statusDescN = json['StatusDescN'];
|
||||
vitalStatus = json['VitalStatus'];
|
||||
vitalSignAppointmentNo = json['VitalSignAppointmentNo'];
|
||||
episodeID = json['EpisodeID'];
|
||||
actualDoctorRate = json['ActualDoctorRate'];
|
||||
clinicName = json['ClinicName'];
|
||||
complainExists = json['ComplainExists'];
|
||||
doctorImageURL = json['DoctorImageURL'];
|
||||
doctorNameObj = json['DoctorNameObj'];
|
||||
doctorRate = json['DoctorRate'];
|
||||
doctorSpeciality = json['DoctorSpeciality'].cast<String>();
|
||||
doctorTitle = json['DoctorTitle'];
|
||||
gender = json['Gender'];
|
||||
genderDescription = json['GenderDescription'];
|
||||
iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN'];
|
||||
isActiveDoctor = json['IsActiveDoctor'];
|
||||
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
|
||||
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
|
||||
isExecludeDoctor = json['IsExecludeDoctor'];
|
||||
isFollowup = json['IsFollowup'];
|
||||
isLiveCareAppointment = json['IsLiveCareAppointment'];
|
||||
isMedicalReportRequested = json['IsMedicalReportRequested'];
|
||||
isOnlineCheckedIN = json['IsOnlineCheckedIN'];
|
||||
latitude = json['Latitude'];
|
||||
listHISGetContactLensPerscription =
|
||||
json['List_HIS_GetContactLensPerscription'];
|
||||
listHISGetGlassPerscription = json['List_HIS_GetGlassPerscription'];
|
||||
longitude = json['Longitude'];
|
||||
nextAction = json['NextAction'];
|
||||
noOfPatientsRate = json['NoOfPatientsRate'];
|
||||
originalClinicID = json['OriginalClinicID'];
|
||||
originalProjectID = json['OriginalProjectID'];
|
||||
projectName = json['ProjectName'];
|
||||
qR = json['QR'];
|
||||
remaniningHoursTocanPay = json['RemaniningHoursTocanPay'];
|
||||
sMSButtonVisable = json['SMSButtonVisable'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['SetupID'] = this.setupID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
data['AppointmentDate'] = this.appointmentDate;
|
||||
data['AppointmentDateN'] = this.appointmentDateN;
|
||||
data['AppointmentType'] = this.appointmentType;
|
||||
data['BookDate'] = this.bookDate;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['EndDate'] = this.endDate;
|
||||
data['StartTime'] = this.startTime;
|
||||
data['EndTime'] = this.endTime;
|
||||
data['Status'] = this.status;
|
||||
data['VisitType'] = this.visitType;
|
||||
data['VisitFor'] = this.visitFor;
|
||||
data['PatientStatusType'] = this.patientStatusType;
|
||||
data['CompanyID'] = this.companyID;
|
||||
data['BookedBy'] = this.bookedBy;
|
||||
data['BookedOn'] = this.bookedOn;
|
||||
data['ConfirmedBy'] = this.confirmedBy;
|
||||
data['ConfirmedOn'] = this.confirmedOn;
|
||||
data['ArrivalChangedBy'] = this.arrivalChangedBy;
|
||||
data['ArrivedOn'] = this.arrivedOn;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['EditedOn'] = this.editedOn;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['DoctorNameN'] = this.doctorNameN;
|
||||
data['StatusDesc'] = this.statusDesc;
|
||||
data['StatusDescN'] = this.statusDescN;
|
||||
data['VitalStatus'] = this.vitalStatus;
|
||||
data['VitalSignAppointmentNo'] = this.vitalSignAppointmentNo;
|
||||
data['EpisodeID'] = this.episodeID;
|
||||
data['ActualDoctorRate'] = this.actualDoctorRate;
|
||||
data['ClinicName'] = this.clinicName;
|
||||
data['ComplainExists'] = this.complainExists;
|
||||
data['DoctorImageURL'] = this.doctorImageURL;
|
||||
data['DoctorNameObj'] = this.doctorNameObj;
|
||||
data['DoctorRate'] = this.doctorRate;
|
||||
data['DoctorSpeciality'] = this.doctorSpeciality;
|
||||
data['DoctorTitle'] = this.doctorTitle;
|
||||
data['Gender'] = this.gender;
|
||||
data['GenderDescription'] = this.genderDescription;
|
||||
data['ISAllowOnlineCheckedIN'] = this.iSAllowOnlineCheckedIN;
|
||||
data['IsActiveDoctor'] = this.isActiveDoctor;
|
||||
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
|
||||
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
|
||||
data['IsExecludeDoctor'] = this.isExecludeDoctor;
|
||||
data['IsFollowup'] = this.isFollowup;
|
||||
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
|
||||
data['IsMedicalReportRequested'] = this.isMedicalReportRequested;
|
||||
data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['List_HIS_GetContactLensPerscription'] =
|
||||
this.listHISGetContactLensPerscription;
|
||||
data['List_HIS_GetGlassPerscription'] = this.listHISGetGlassPerscription;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['NextAction'] = this.nextAction;
|
||||
data['NoOfPatientsRate'] = this.noOfPatientsRate;
|
||||
data['OriginalClinicID'] = this.originalClinicID;
|
||||
data['OriginalProjectID'] = this.originalProjectID;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['QR'] = this.qR;
|
||||
data['RemaniningHoursTocanPay'] = this.remaniningHoursTocanPay;
|
||||
data['SMSButtonVisable'] = this.sMSButtonVisable;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,204 @@
|
||||
class PatientShareResponse {
|
||||
int advanceNumber;
|
||||
String appointmentDate;
|
||||
int appointmentNo;
|
||||
int cashPrice;
|
||||
int cashPriceTax;
|
||||
int cashPriceWithTax;
|
||||
int clinicID;
|
||||
String clinicName;
|
||||
int companyId;
|
||||
String companyName;
|
||||
int companyShareWithTax;
|
||||
String doctorImageURL;
|
||||
String doctorNameObj;
|
||||
List<String> doctorSpeciality;
|
||||
Null errCode;
|
||||
int groupID;
|
||||
bool iSAllowOnlineCheckedIN;
|
||||
Null insurancePolicyNo;
|
||||
bool isExcludedForOnlineCheckin;
|
||||
int isFollowup;
|
||||
bool isLiveCareAppointment;
|
||||
bool isOnlineCheckedIN;
|
||||
String message;
|
||||
int nextAction;
|
||||
Null patientCardID;
|
||||
int patientID;
|
||||
dynamic patientShare;
|
||||
dynamic patientShareWithTax;
|
||||
int patientStatusType;
|
||||
dynamic patientTaxAmount;
|
||||
String patientType;
|
||||
int paymentAmount;
|
||||
String paymentDate;
|
||||
Null paymentMethodName;
|
||||
Null paymentReferenceNumber;
|
||||
int policyId;
|
||||
String policyName;
|
||||
String procedureName;
|
||||
int projectID;
|
||||
String projectName;
|
||||
Null setupID;
|
||||
int sourceType;
|
||||
String startTime;
|
||||
int status;
|
||||
int statusCode;
|
||||
Null statusDesc;
|
||||
Null subPolicyNo;
|
||||
int userID;
|
||||
|
||||
PatientShareResponse(
|
||||
{this.advanceNumber,
|
||||
this.appointmentDate,
|
||||
this.appointmentNo,
|
||||
this.cashPrice,
|
||||
this.cashPriceTax,
|
||||
this.cashPriceWithTax,
|
||||
this.clinicID,
|
||||
this.clinicName,
|
||||
this.companyId,
|
||||
this.companyName,
|
||||
this.companyShareWithTax,
|
||||
this.doctorImageURL,
|
||||
this.doctorNameObj,
|
||||
this.doctorSpeciality,
|
||||
this.errCode,
|
||||
this.groupID,
|
||||
this.iSAllowOnlineCheckedIN,
|
||||
this.insurancePolicyNo,
|
||||
this.isExcludedForOnlineCheckin,
|
||||
this.isFollowup,
|
||||
this.isLiveCareAppointment,
|
||||
this.isOnlineCheckedIN,
|
||||
this.message,
|
||||
this.nextAction,
|
||||
this.patientCardID,
|
||||
this.patientID,
|
||||
this.patientShare,
|
||||
this.patientShareWithTax,
|
||||
this.patientStatusType,
|
||||
this.patientTaxAmount,
|
||||
this.patientType,
|
||||
this.paymentAmount,
|
||||
this.paymentDate,
|
||||
this.paymentMethodName,
|
||||
this.paymentReferenceNumber,
|
||||
this.policyId,
|
||||
this.policyName,
|
||||
this.procedureName,
|
||||
this.projectID,
|
||||
this.projectName,
|
||||
this.setupID,
|
||||
this.sourceType,
|
||||
this.startTime,
|
||||
this.status,
|
||||
this.statusCode,
|
||||
this.statusDesc,
|
||||
this.subPolicyNo,
|
||||
this.userID});
|
||||
|
||||
PatientShareResponse.fromJson(Map<String, dynamic> json) {
|
||||
advanceNumber = json['AdvanceNumber'];
|
||||
appointmentDate = json['AppointmentDate'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
cashPrice = json['CashPrice'];
|
||||
cashPriceTax = json['CashPriceTax'];
|
||||
cashPriceWithTax = json['CashPriceWithTax'];
|
||||
clinicID = json['ClinicID'];
|
||||
clinicName = json['ClinicName'];
|
||||
companyId = json['CompanyId'];
|
||||
companyName = json['CompanyName'];
|
||||
companyShareWithTax = json['CompanyShareWithTax'];
|
||||
doctorImageURL = json['DoctorImageURL'];
|
||||
doctorNameObj = json['DoctorNameObj'];
|
||||
doctorSpeciality = json['DoctorSpeciality'].cast<String>();
|
||||
errCode = json['ErrCode'];
|
||||
groupID = json['GroupID'];
|
||||
iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN'];
|
||||
insurancePolicyNo = json['InsurancePolicyNo'];
|
||||
isExcludedForOnlineCheckin = json['IsExcludedForOnlineCheckin'];
|
||||
isFollowup = json['IsFollowup'];
|
||||
isLiveCareAppointment = json['IsLiveCareAppointment'];
|
||||
isOnlineCheckedIN = json['IsOnlineCheckedIN'];
|
||||
message = json['Message'];
|
||||
nextAction = json['NextAction'];
|
||||
patientCardID = json['PatientCardID'];
|
||||
patientID = json['PatientID'];
|
||||
patientShare = json['PatientShare'];
|
||||
patientShareWithTax = json['PatientShareWithTax'];
|
||||
patientStatusType = json['PatientStatusType'];
|
||||
patientTaxAmount = json['PatientTaxAmount'];
|
||||
patientType = json['PatientType'];
|
||||
paymentAmount = json['PaymentAmount'];
|
||||
paymentDate = json['PaymentDate'];
|
||||
paymentMethodName = json['PaymentMethodName'];
|
||||
paymentReferenceNumber = json['PaymentReferenceNumber'];
|
||||
policyId = json['PolicyId'];
|
||||
policyName = json['PolicyName'];
|
||||
procedureName = json['ProcedureName'];
|
||||
projectID = json['ProjectID'];
|
||||
projectName = json['ProjectName'];
|
||||
setupID = json['SetupID'];
|
||||
sourceType = json['SourceType'];
|
||||
startTime = json['StartTime'];
|
||||
status = json['Status'];
|
||||
statusCode = json['StatusCode'];
|
||||
statusDesc = json['StatusDesc'];
|
||||
subPolicyNo = json['SubPolicyNo'];
|
||||
userID = json['UserID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['AdvanceNumber'] = this.advanceNumber;
|
||||
data['AppointmentDate'] = this.appointmentDate;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
data['CashPrice'] = this.cashPrice;
|
||||
data['CashPriceTax'] = this.cashPriceTax;
|
||||
data['CashPriceWithTax'] = this.cashPriceWithTax;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['ClinicName'] = this.clinicName;
|
||||
data['CompanyId'] = this.companyId;
|
||||
data['CompanyName'] = this.companyName;
|
||||
data['CompanyShareWithTax'] = this.companyShareWithTax;
|
||||
data['DoctorImageURL'] = this.doctorImageURL;
|
||||
data['DoctorNameObj'] = this.doctorNameObj;
|
||||
data['DoctorSpeciality'] = this.doctorSpeciality;
|
||||
data['ErrCode'] = this.errCode;
|
||||
data['GroupID'] = this.groupID;
|
||||
data['ISAllowOnlineCheckedIN'] = this.iSAllowOnlineCheckedIN;
|
||||
data['InsurancePolicyNo'] = this.insurancePolicyNo;
|
||||
data['IsExcludedForOnlineCheckin'] = this.isExcludedForOnlineCheckin;
|
||||
data['IsFollowup'] = this.isFollowup;
|
||||
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
|
||||
data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN;
|
||||
data['Message'] = this.message;
|
||||
data['NextAction'] = this.nextAction;
|
||||
data['PatientCardID'] = this.patientCardID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['PatientShare'] = this.patientShare;
|
||||
data['PatientShareWithTax'] = this.patientShareWithTax;
|
||||
data['PatientStatusType'] = this.patientStatusType;
|
||||
data['PatientTaxAmount'] = this.patientTaxAmount;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['PaymentAmount'] = this.paymentAmount;
|
||||
data['PaymentDate'] = this.paymentDate;
|
||||
data['PaymentMethodName'] = this.paymentMethodName;
|
||||
data['PaymentReferenceNumber'] = this.paymentReferenceNumber;
|
||||
data['PolicyId'] = this.policyId;
|
||||
data['PolicyName'] = this.policyName;
|
||||
data['ProcedureName'] = this.procedureName;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['SourceType'] = this.sourceType;
|
||||
data['StartTime'] = this.startTime;
|
||||
data['Status'] = this.status;
|
||||
data['StatusCode'] = this.statusCode;
|
||||
data['StatusDesc'] = this.statusDesc;
|
||||
data['SubPolicyNo'] = this.subPolicyNo;
|
||||
data['UserID'] = this.userID;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -1,30 +1,70 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/upcomingCard.dart';
|
||||
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ToDo extends StatefulWidget {
|
||||
DoctorsListService service;
|
||||
List<AppoitmentAllHistoryResultList> appoList = [];
|
||||
|
||||
@override
|
||||
_ToDoState createState() => _ToDoState();
|
||||
}
|
||||
|
||||
class _ToDoState extends State<ToDo> {
|
||||
@override
|
||||
void initState() {
|
||||
widget.service = new DoctorsListService();
|
||||
getPatientAppointmentHistory();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).todoList,
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
TodoListCard(),
|
||||
TodoListCard(),
|
||||
TodoListCard(),
|
||||
TodoListCard(),
|
||||
],
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
shrinkWrap: true,
|
||||
physics: ScrollPhysics(),
|
||||
padding: EdgeInsets.all(0.0),
|
||||
itemCount: widget.appoList.length,
|
||||
itemBuilder: (context, index) {
|
||||
return TodoListCard(
|
||||
appo: widget.appoList[index],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
getPatientAppointmentHistory() {
|
||||
widget.service.getPatientAppointmentHistory(true).then((res) {
|
||||
print(res['AppoimentAllHistoryResultList']);
|
||||
|
||||
if (res['MessageStatus'] == 1) {
|
||||
setState(() {
|
||||
if (res['AppoimentAllHistoryResultList'].length != 0) {
|
||||
widget.appoList.clear();
|
||||
res['AppoimentAllHistoryResultList'].forEach((v) {
|
||||
widget.appoList
|
||||
.add(new AppoitmentAllHistoryResultList.fromJson(v));
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
print(widget.appoList.length);
|
||||
} else {
|
||||
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../locator.dart';
|
||||
|
||||
class BaseView<T extends BaseViewModel> extends StatefulWidget {
|
||||
final Widget Function(BuildContext context, T model, Widget child) builder;
|
||||
final Function(T) onModelReady;
|
||||
|
||||
BaseView({
|
||||
this.builder,
|
||||
this.onModelReady,
|
||||
});
|
||||
|
||||
@override
|
||||
_BaseViewState<T> createState() => _BaseViewState<T>();
|
||||
}
|
||||
|
||||
class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> {
|
||||
T model = locator<T>();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
if (widget.onModelReady != null) {
|
||||
widget.onModelReady(model);
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider<T>(
|
||||
create: (BuildContext context) => model,
|
||||
child: Consumer<T>(builder: widget.builder),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MyHomePage extends StatefulWidget {
|
||||
MyHomePage({Key key, this.title}) : super(key: key);
|
||||
|
||||
final String title;
|
||||
|
||||
@override
|
||||
_MyHomePageState createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
int _counter = 0;
|
||||
|
||||
void _incrementCounter() {
|
||||
setState(() {
|
||||
_counter++;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(widget.title),
|
||||
),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'You have pushed the button this many times:',
|
||||
),
|
||||
Text(
|
||||
'$_counter',
|
||||
style: Theme.of(context).textTheme.headline4,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: _incrementCounter,
|
||||
tooltip: 'Increment',
|
||||
child: Icon(Icons.add),
|
||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/hospital_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../base/base_view.dart';
|
||||
|
||||
class HomePage extends StatefulWidget {
|
||||
@override
|
||||
_HomePageState createState() => _HomePageState();
|
||||
}
|
||||
|
||||
class _HomePageState extends State<HomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<HospitalViewModel>(
|
||||
onModelReady: (model) => model.getHospitals(),
|
||||
builder: (BuildContext context, HospitalViewModel model, Widget child) =>
|
||||
AppScaffold(
|
||||
baseViewModel: model,
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () {
|
||||
model.getHospitals();
|
||||
},
|
||||
child: Container(
|
||||
child: Texts('call api '),
|
||||
),
|
||||
|
||||
),
|
||||
Expanded(
|
||||
child: _getHospitals(model.hospitals),
|
||||
)
|
||||
// BaseView<DoctorViewModel>(
|
||||
// onModelReady: (dctorViewModel) => dctorViewModel.getHospitals(),
|
||||
// builder: (BuildContext context, DoctorViewModel dctorViewModel,
|
||||
// Widget child) =>
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// dctorViewModel.getHospitals();
|
||||
// },
|
||||
// child: Container(
|
||||
// width: double.infinity,
|
||||
// height: 150,
|
||||
// child: NetworkBaseView(
|
||||
// baseViewModel: dctorViewModel,
|
||||
// child: Container(
|
||||
// child: Texts('The API 2'),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getHospitals(List<HospitalsModel> hospitals) => ListView.builder(
|
||||
itemCount: hospitals.length,
|
||||
itemBuilder: (BuildContext context, int index) => Container(
|
||||
child: Texts(hospitals[index].name),
|
||||
),
|
||||
);
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ReplayPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
body: Center(
|
||||
child: InkWell(onTap: () {}, child: Texts('Replay Page')),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ForgotPassword extends StatefulWidget {
|
||||
@override
|
||||
_ForgotPassword createState() => _ForgotPassword();
|
||||
}
|
||||
|
||||
class _ForgotPassword extends State<ForgotPassword> {
|
||||
String selectedType = 'Saudi Arabia';
|
||||
final TextEditingController nationalIDorFile = null;
|
||||
final TextEditingController mobileNo = null;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).forgotPassword,
|
||||
isShowAppBar: true,
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: 10, left: 20, right: 20),
|
||||
height: SizeConfig.realScreenHeight * .8,
|
||||
width: SizeConfig.realScreenWidth,
|
||||
child: Column(children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: AppText(
|
||||
TranslationBase.of(context).forgotDesc,
|
||||
fontSize: SizeConfig.textMultiplier * 3.5,
|
||||
textAlign: TextAlign.left,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
// add Expanded to have your dropdown button fill remaining space
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton(
|
||||
isExpanded: true,
|
||||
value: selectedType,
|
||||
iconSize: 40,
|
||||
elevation: 16,
|
||||
onChanged: (String newValue) => {
|
||||
setState(() {
|
||||
selectedType = newValue;
|
||||
})
|
||||
},
|
||||
items: <String>[
|
||||
'Saudi Arabia',
|
||||
'Dubai',
|
||||
].map<DropdownMenuItem<String>>(
|
||||
(String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(value),
|
||||
);
|
||||
}).toList()))),
|
||||
],
|
||||
),
|
||||
MobileNo(controller: mobileNo),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: RaisedButton(
|
||||
color: Colors.grey,
|
||||
textColor: Colors.white,
|
||||
child: Text(TranslationBase.of(context).submit),
|
||||
onPressed: () => {},
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
))
|
||||
]),
|
||||
)));
|
||||
}
|
||||
}
|
@ -0,0 +1,162 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:diplomaticquarterapp/routes.dart';
|
||||
|
||||
class LoginType extends StatelessWidget {
|
||||
static int loginType = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).welcome,
|
||||
isShowAppBar: true,
|
||||
body: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Image.asset(
|
||||
'assets/images/habib-logo.png',
|
||||
height: 80,
|
||||
width: 80,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context).logintypeRadio,
|
||||
fontSize: SizeConfig.textMultiplier * 3.5,
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () => {
|
||||
LoginType.loginType = 1,
|
||||
Navigator.of(context)
|
||||
.pushNamed(LOGIN_PAGE)
|
||||
},
|
||||
child: RoundedContainer(
|
||||
borderColor: Colors.grey,
|
||||
showBorder: true,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
20, 10, 20, 10),
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Image.asset(
|
||||
'assets/images/id_card_icon.png',
|
||||
height: SizeConfig
|
||||
.imageSizeMultiplier *
|
||||
12,
|
||||
width: SizeConfig
|
||||
.imageSizeMultiplier *
|
||||
15,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.nationalID,
|
||||
fontSize:
|
||||
SizeConfig.textMultiplier *
|
||||
2,
|
||||
)
|
||||
],
|
||||
),
|
||||
)))),
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () => {
|
||||
LoginType.loginType = 2,
|
||||
Navigator.of(context)
|
||||
.pushNamed(LOGIN_PAGE)
|
||||
},
|
||||
child: RoundedContainer(
|
||||
borderColor: Colors.grey,
|
||||
showBorder: true,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
25, 10, 25, 10),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Image.asset(
|
||||
'assets/images/my_file_white_icon.png',
|
||||
height: SizeConfig
|
||||
.imageSizeMultiplier *
|
||||
12,
|
||||
width: SizeConfig
|
||||
.imageSizeMultiplier *
|
||||
15,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.fileNo,
|
||||
fontSize:
|
||||
SizeConfig.textMultiplier *
|
||||
2,
|
||||
)
|
||||
],
|
||||
),
|
||||
))))
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
color: Colors.grey,
|
||||
height: 2,
|
||||
),
|
||||
Center(
|
||||
child: InkWell(
|
||||
onTap: () => {
|
||||
Navigator.of(context)
|
||||
.pushNamed(FORGOT_PASSWORD)
|
||||
},
|
||||
child: AppText(
|
||||
TranslationBase.of(context).forgotPassword,
|
||||
fontSize: SizeConfig.textMultiplier * 3,
|
||||
margin: 10,
|
||||
underline: true)))
|
||||
]),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: RaisedButton(
|
||||
color: Colors.grey,
|
||||
textColor: Colors.white,
|
||||
child:
|
||||
Text(TranslationBase.of(context).registerNow),
|
||||
onPressed: () => {
|
||||
Navigator.of(context).pushNamed(
|
||||
REGISTER,
|
||||
)
|
||||
},
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
)));
|
||||
}
|
||||
}
|
@ -0,0 +1,163 @@
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/auth/check_paitent_authentication_req.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
|
||||
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
|
||||
import 'package:diplomaticquarterapp/providers/auth_provider.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Login extends StatefulWidget {
|
||||
@override
|
||||
_Login createState() => _Login();
|
||||
}
|
||||
|
||||
class _Login extends State<Login> {
|
||||
final util = Utils();
|
||||
final nationalIDorFile = TextEditingController();
|
||||
final int loginType = LoginType.loginType;
|
||||
String mobileNo;
|
||||
String countryCode = '966';
|
||||
bool isButtonDisabled = true;
|
||||
final authService = new AuthProvider();
|
||||
var sharedPref = new AppSharedPreferences();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).login,
|
||||
isShowAppBar: true,
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: 10, left: 20, right: 20),
|
||||
height: SizeConfig.realScreenHeight * .8,
|
||||
width: SizeConfig.realScreenWidth,
|
||||
child: Column(children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: AppText(
|
||||
TranslationBase.of(context).enterNationalId,
|
||||
fontSize: SizeConfig.textMultiplier * 3.5,
|
||||
textAlign: TextAlign.left,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
MobileNo(
|
||||
onNumberChange: (value) =>
|
||||
{mobileNo = value, validateForm()},
|
||||
onCountryChange: (value) => countryCode = value),
|
||||
Container(
|
||||
child: TextFields(
|
||||
controller: nationalIDorFile,
|
||||
onChanged: (value) => {validateForm()},
|
||||
prefixIcon: Icon(
|
||||
loginType == 1
|
||||
? Icons.chrome_reader_mode
|
||||
: Icons.receipt,
|
||||
color: Colors.red),
|
||||
padding: EdgeInsets.only(
|
||||
top: 20, bottom: 20, left: 10, right: 10),
|
||||
hintText: loginType == 1
|
||||
? TranslationBase.of(context).nationalID
|
||||
: TranslationBase.of(context).fileNo,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: RaisedButton(
|
||||
color: isButtonDisabled == true
|
||||
? Colors.grey
|
||||
: Colors.grey[600],
|
||||
textColor: Colors.white,
|
||||
child: Text(TranslationBase.of(context).login),
|
||||
onPressed: () => {this.startLogin()},
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
))
|
||||
]),
|
||||
)));
|
||||
}
|
||||
|
||||
startLogin() {
|
||||
if (isButtonDisabled == false) {
|
||||
checkUserAuthentication();
|
||||
}
|
||||
}
|
||||
|
||||
void validateForm() {
|
||||
if (validateIDBox(nationalIDorFile.text) == true &&
|
||||
mobileNo != null &&
|
||||
util.isSAUDIIDValid(nationalIDorFile.text) == true) {
|
||||
setState(() {
|
||||
isButtonDisabled = false;
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
isButtonDisabled = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
bool validateIDBox(String value) {
|
||||
Pattern pattern = loginIDPattern(); //r'^\d+(?:\.\d+)?$';
|
||||
|
||||
RegExp regex = new RegExp(pattern);
|
||||
return regex.hasMatch(value);
|
||||
}
|
||||
|
||||
String loginIDPattern() {
|
||||
var length = loginType == 1 ? 10 : 7;
|
||||
return "([0-9]{" + length.toString() + "})";
|
||||
}
|
||||
|
||||
checkUserAuthentication() {
|
||||
var request = CheckPatientAuthenticationReq();
|
||||
request.isRegister = false;
|
||||
request.patientMobileNumber = int.parse(mobileNo);
|
||||
request.zipCode = countryCode;
|
||||
request.searchType = this.loginType;
|
||||
request.deviceTypeID = this.loginType;
|
||||
if (this.loginType == 1) {
|
||||
request.patientIdentificationID = this.nationalIDorFile.text;
|
||||
request.patientID = 0;
|
||||
} else {
|
||||
request.patientIdentificationID = '';
|
||||
request.patientID = int.parse(nationalIDorFile.text);
|
||||
}
|
||||
sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
|
||||
authService.checkPatientAuthentication(request).then((value) => {
|
||||
if (value.isSMSSent)
|
||||
{
|
||||
sharedPref.setString(LOGIN_TOKEN_ID, value.LogInTokenID),
|
||||
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request),
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value.IsAuthenticated) {this.checkActivationCode()}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
checkActivationCode() {}
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Register extends StatefulWidget {
|
||||
@override
|
||||
_Register createState() => _Register();
|
||||
}
|
||||
|
||||
class _Register extends State<Register> {
|
||||
final TextEditingController nationalIDorFile = null;
|
||||
final int loginType = LoginType.loginType;
|
||||
final TextEditingController mobileNo = null;
|
||||
var isHijri;
|
||||
|
||||
DateTime selectedDate;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).login,
|
||||
isShowAppBar: true,
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: 10, left: 20, right: 20),
|
||||
height: SizeConfig.realScreenHeight * .8,
|
||||
width: SizeConfig.realScreenWidth,
|
||||
child: Column(children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: AppText(
|
||||
TranslationBase.of(context).enterNationalId,
|
||||
fontSize: SizeConfig.textMultiplier * 3.5,
|
||||
textAlign: TextAlign.left,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
MobileNo(controller: mobileNo),
|
||||
Container(
|
||||
child: TextFields(
|
||||
controller: nationalIDorFile,
|
||||
prefixIcon:
|
||||
Icon(Icons.chrome_reader_mode, color: Colors.red),
|
||||
padding: EdgeInsets.only(
|
||||
top: 20, bottom: 20, left: 10, right: 10),
|
||||
hintText: TranslationBase.of(context).nationalID,
|
||||
)),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Radio(
|
||||
value: 1,
|
||||
groupValue: isHijri,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isHijri = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
Text(TranslationBase.of(context).hijriDate),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Radio(
|
||||
value: 0,
|
||||
groupValue: isHijri,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isHijri = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
Text(TranslationBase.of(context).gregorianDate),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(children: <Widget>[
|
||||
Expanded(
|
||||
child: RaisedButton.icon(
|
||||
onPressed: () => {_selectDate(context)},
|
||||
icon: Icon(Icons.date_range),
|
||||
label: Text(selectedDate != null
|
||||
? "${selectedDate.toLocal()}".split(' ')[0]
|
||||
: TranslationBase.of(context).dob)))
|
||||
])
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: RaisedButton(
|
||||
color: Colors.grey,
|
||||
textColor: Colors.white,
|
||||
child: Text(TranslationBase.of(context).login),
|
||||
onPressed: () => {},
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
))
|
||||
]),
|
||||
)));
|
||||
}
|
||||
|
||||
Future<Null> _selectDate(BuildContext context) async {
|
||||
final DateTime picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: DateTime.now(),
|
||||
firstDate: DateTime(2015, 8),
|
||||
lastDate: DateTime(2101));
|
||||
if (picked != null && picked != selectedDate)
|
||||
setState(() {
|
||||
selectedDate = picked;
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:diplomaticquarterapp/routes.dart';
|
||||
|
||||
class WelcomeLogin extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).welcome,
|
||||
isShowAppBar: true,
|
||||
body: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Image.asset(
|
||||
'assets/images/habib-logo.png',
|
||||
height: 80,
|
||||
width: 80,
|
||||
),
|
||||
Text(
|
||||
TranslationBase.of(context).welcome,
|
||||
style: TextStyle(fontSize: 30),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Text(
|
||||
TranslationBase.of(context).welcomeText,
|
||||
style: TextStyle(fontSize: 24),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
Text(
|
||||
TranslationBase.of(context).welcomeText2,
|
||||
style: TextStyle(fontSize: 24),
|
||||
textAlign: TextAlign.left,
|
||||
)
|
||||
]),
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: RaisedButton(
|
||||
color: Colors.red[900],
|
||||
textColor: Colors.white,
|
||||
child: Text(TranslationBase.of(context).yes),
|
||||
onPressed: () => {
|
||||
Navigator.of(context).pushNamed(
|
||||
LOGIN_TYPE,
|
||||
)
|
||||
},
|
||||
))
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: RaisedButton(
|
||||
child: Text(TranslationBase.of(context).no),
|
||||
onPressed: () => {
|
||||
Navigator.of(context).pushNamed(
|
||||
REGISTER,
|
||||
)
|
||||
},
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
)));
|
||||
}
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/auth/check_paitent_authentication_req.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/auth/select_device_imei_res.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
// SharedPreferences sharedPref = new SharedPreferences();
|
||||
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
|
||||
AppSharedPreferences sharedPref = new AppSharedPreferences();
|
||||
|
||||
const String INSERT_DEVICE_IMEI = '/Patients.svc/REST/Patient_INSERTDeviceIMEI';
|
||||
const String SELECT_DEVICE_IMEI =
|
||||
'/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI';
|
||||
const String CHECK_PATIENT_AUTH =
|
||||
'/Authentication.svc/REST/CheckPatientAuthentication';
|
||||
|
||||
class AuthProvider with ChangeNotifier {
|
||||
bool isLogin = false;
|
||||
bool isLoading = true;
|
||||
AuthProvider() {
|
||||
getUserAuthentication();
|
||||
}
|
||||
|
||||
void getUserAuthentication() async {
|
||||
Map profile = await sharedPref.getObject(USER_PROFILE);
|
||||
if (profile != null) {
|
||||
isLoading = false;
|
||||
isLogin = true;
|
||||
} else {
|
||||
isLoading = false;
|
||||
isLogin = false;
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
APP_STATUS get stutas {
|
||||
if (isLoading) {
|
||||
return APP_STATUS.LOADING;
|
||||
} else {
|
||||
if (this.isLogin) {
|
||||
return APP_STATUS.AUTHENTICATED;
|
||||
} else {
|
||||
return APP_STATUS.UNAUTHENTICATED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Future<dynamic> login(UserModel userInfo) async {
|
||||
// try {
|
||||
// dynamic localRes;
|
||||
|
||||
// await BaseAppClient.post(LOGIN_URL,
|
||||
// onSuccess: (dynamic response, int statusCode) {
|
||||
// localRes = response;
|
||||
// }, onFailure: (String error, int statusCode) {
|
||||
// throw error;
|
||||
// }, body: userInfo.toJson());
|
||||
|
||||
// return Future.value(localRes);
|
||||
// } catch (error) {
|
||||
// print(error);
|
||||
// throw error;
|
||||
// }
|
||||
// }
|
||||
|
||||
Future<dynamic> insertDeviceImei(imei) async {
|
||||
try {
|
||||
dynamic localRes;
|
||||
|
||||
await new BaseAppClient().post(INSERT_DEVICE_IMEI,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
localRes = response;
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
throw error;
|
||||
}, body: imei);
|
||||
return Future.value(localRes);
|
||||
} catch (error) {
|
||||
print(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Future<SelectDeviceIMEIRES> selectDeviceImei(imei) async {
|
||||
try {
|
||||
dynamic localRes;
|
||||
await new BaseAppClient().post(SELECT_DEVICE_IMEI,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
localRes = response;
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
throw error;
|
||||
}, body: imei);
|
||||
return Future.value(localRes);
|
||||
} catch (error) {
|
||||
print(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Future<dynamic> checkPatientAuthentication(
|
||||
CheckPatientAuthenticationReq request) async {
|
||||
request.versionID = VERSION_ID;
|
||||
request.channel = CHANNEL;
|
||||
request.iPAdress = IP_ADDRESS;
|
||||
request.generalid = GENERAL_ID;
|
||||
request.languageID = 2;
|
||||
request.patientOutSA = request.zipCode == '966' ? 0 : 1;
|
||||
try {
|
||||
dynamic localRes;
|
||||
await new BaseAppClient().post(CHECK_PATIENT_AUTH,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
localRes = response;
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
throw error;
|
||||
}, body: request.toJson());
|
||||
return Future.value(localRes);
|
||||
} catch (error) {
|
||||
print(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/login/forgot-password.dart';
|
||||
import 'package:diplomaticquarterapp/pages/login/welcome.dart';
|
||||
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
|
||||
import 'package:diplomaticquarterapp/pages/login/login.dart';
|
||||
import 'package:diplomaticquarterapp/pages/login/register.dart';
|
||||
|
||||
const String INIT_ROUTE = '/';
|
||||
const String ROOT = 'root';
|
||||
const String HOME = '/';
|
||||
const String LOGIN = 'login';
|
||||
const String WELCOME_LOGIN = 'welcome-login';
|
||||
const String LOGIN_TYPE = 'login-type';
|
||||
const String LOGIN_PAGE = 'login-page';
|
||||
const String FORGOT_PASSWORD = 'forgot-password';
|
||||
const String REGISTER = 'register';
|
||||
var routes = {
|
||||
// ROOT: (_) => RootPage(),
|
||||
HOME: (_) => LandingPage(),
|
||||
WELCOME_LOGIN: (_) => WelcomeLogin(),
|
||||
LOGIN_TYPE: (_) => LoginType(),
|
||||
LOGIN_PAGE: (_) => Login(),
|
||||
FORGOT_PASSWORD: (_) => ForgotPassword(),
|
||||
REGISTER: (_) => Register()
|
||||
};
|
@ -0,0 +1,148 @@
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// [label] button label
|
||||
/// [icon] button icon its optional
|
||||
/// [color] the background color
|
||||
/// [textColor] the text color
|
||||
/// [onTap] button function
|
||||
/// [loading] show the progress indicator
|
||||
/// [disabled] disabled the button
|
||||
/// [borderColor] the button border color
|
||||
/// [child] the child inside the button
|
||||
/// [disabledPadding] remove padding
|
||||
class BottomButton extends StatelessWidget {
|
||||
final bool loading;
|
||||
final bool disabled;
|
||||
final String label;
|
||||
final Widget icon;
|
||||
final Color color;
|
||||
final Color textColor;
|
||||
final Color borderColor;
|
||||
final Function onTap;
|
||||
final Widget child;
|
||||
final bool disabledPadding;
|
||||
|
||||
BottomButton(
|
||||
{Key key,
|
||||
this.loading = false,
|
||||
this.disabled = false,
|
||||
this.label,
|
||||
this.icon,
|
||||
this.color,
|
||||
this.textColor,
|
||||
this.disabledPadding = false,
|
||||
this.borderColor,
|
||||
this.onTap,
|
||||
this.child})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.bottomCenter,
|
||||
end: Alignment.topCenter,
|
||||
stops: [
|
||||
0.0,
|
||||
0.9
|
||||
],
|
||||
colors: [
|
||||
Theme.of(context).backgroundColor,
|
||||
Theme.of(context).backgroundColor.withOpacity(0)
|
||||
]),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: child != null
|
||||
? EdgeInsets.only(
|
||||
left: 14.0, right: 14.0, top: 14.0, bottom: 14)
|
||||
: EdgeInsets.only(
|
||||
left: 30.0, right: 30.0, top: 14.0, bottom: 14),
|
||||
decoration: BoxDecoration(
|
||||
color: child != null
|
||||
? Theme.of(context).backgroundColor
|
||||
: null,
|
||||
border: child != null
|
||||
? Border.all(
|
||||
color: Theme.of(context).dividerColor, width: 2.0)
|
||||
: Border.all(color: Colors.transparent, width: 0.0),
|
||||
borderRadius: child != null
|
||||
? BorderRadius.circular(16.0)
|
||||
: BorderRadius.circular(0.0),
|
||||
boxShadow: child != null
|
||||
? [
|
||||
BoxShadow(
|
||||
color: Color.fromRGBO(0, 0, 0, 0.04),
|
||||
spreadRadius: -0.0,
|
||||
offset: Offset(0, 4.0),
|
||||
blurRadius: 18.0)
|
||||
]
|
||||
: []),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
if (child != null)
|
||||
Padding(
|
||||
padding: disabledPadding
|
||||
? EdgeInsets.only(
|
||||
left: 0.0,
|
||||
right: 0.0,
|
||||
top: 14.0,
|
||||
bottom: label != null ? 0.0 : 14)
|
||||
: EdgeInsets.only(
|
||||
left: 18.0,
|
||||
right: 18.0,
|
||||
top: 14.0,
|
||||
bottom: label != null ? 0.0 : 14),
|
||||
child: child,
|
||||
),
|
||||
if (child != null)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 14.0, bottom: 14),
|
||||
child: Divider(),
|
||||
),
|
||||
if (label != null)
|
||||
label == null
|
||||
? SizedBox(height: 50.0)
|
||||
: Padding(
|
||||
padding: child != null
|
||||
? EdgeInsets.only(
|
||||
bottom: 16.0, left: 16.0, right: 16.0)
|
||||
: EdgeInsets.zero,
|
||||
child: SecondaryButton(
|
||||
borderColor: borderColor,
|
||||
onTap: () {
|
||||
if (onTap != null) onTap();
|
||||
},
|
||||
loading: loading,
|
||||
disabled: disabled,
|
||||
label: label,
|
||||
icon: icon,
|
||||
color: color,
|
||||
textColor: textColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (label == null && child == null)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 30.0, right: 30.0, top: 14.0, bottom: 14),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// OWNER : Ibrahim albitar
|
||||
// DATE : 05-04-2020
|
||||
// DESCRIPTION : Custom widget for rounded container and custom decoration
|
||||
|
||||
class RoundedContainer extends StatefulWidget {
|
||||
final double width;
|
||||
final double height;
|
||||
final double raduis;
|
||||
final Color backgroundColor;
|
||||
final double margin;
|
||||
final double elevation;
|
||||
final bool showBorder;
|
||||
final Color borderColor;
|
||||
final bool customCornerRaduis;
|
||||
final double topLeft;
|
||||
final double bottomRight;
|
||||
final double topRight;
|
||||
final double bottomLeft;
|
||||
final Widget child;
|
||||
final double borderWidth;
|
||||
|
||||
RoundedContainer(
|
||||
{@required this.child,
|
||||
this.width,
|
||||
this.height,
|
||||
this.raduis = 10,
|
||||
this.backgroundColor = Colors.white,
|
||||
this.margin = 10,
|
||||
this.elevation = 1,
|
||||
this.showBorder = false,
|
||||
this.borderColor = Colors.red,
|
||||
this.customCornerRaduis = false,
|
||||
this.topLeft = 0,
|
||||
this.topRight = 0,
|
||||
this.bottomRight = 0,
|
||||
this.bottomLeft = 0,
|
||||
this.borderWidth = 1});
|
||||
|
||||
@override
|
||||
_RoundedContainerState createState() => _RoundedContainerState();
|
||||
}
|
||||
|
||||
class _RoundedContainerState extends State<RoundedContainer> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
margin: EdgeInsets.all(widget.margin),
|
||||
decoration: widget.showBorder == true
|
||||
? BoxDecoration(
|
||||
color: Theme.of(context).primaryColor,
|
||||
border: Border.all(
|
||||
color: widget.borderColor, width: widget.borderWidth),
|
||||
borderRadius: widget.customCornerRaduis
|
||||
? BorderRadius.only(
|
||||
topLeft: Radius.circular(widget.topLeft),
|
||||
topRight: Radius.circular(widget.topRight),
|
||||
bottomRight: Radius.circular(widget.bottomRight),
|
||||
bottomLeft: Radius.circular(widget.bottomLeft))
|
||||
: BorderRadius.circular(widget.raduis),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.1),
|
||||
spreadRadius: 10,
|
||||
blurRadius: 5,
|
||||
offset: Offset(0, 5), // changes position of shadow
|
||||
),
|
||||
])
|
||||
: null,
|
||||
child: Card(
|
||||
margin: EdgeInsets.all(0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: widget.customCornerRaduis
|
||||
? BorderRadius.only(
|
||||
topLeft: Radius.circular(widget.topLeft),
|
||||
topRight: Radius.circular(widget.topRight),
|
||||
bottomRight: Radius.circular(widget.bottomRight),
|
||||
bottomLeft: Radius.circular(widget.bottomLeft))
|
||||
: BorderRadius.circular(widget.raduis),
|
||||
),
|
||||
color: widget.backgroundColor,
|
||||
child: widget.child,
|
||||
));
|
||||
}
|
||||
}
|
@ -0,0 +1,125 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// OWNER : Ibrahim albitar
|
||||
// DATE : 12-04-2020
|
||||
// DESCRIPTION : Customization for Texts in app
|
||||
|
||||
class MobileNo extends StatefulWidget {
|
||||
final bool disabled;
|
||||
// final String data;
|
||||
final List<Countries> countries = [
|
||||
new Countries(name: 'Saudi Arabia', code: '966'),
|
||||
new Countries(name: 'Dubai', code: '971'),
|
||||
];
|
||||
final double margin;
|
||||
final double marginTop;
|
||||
final double marginRight;
|
||||
final double marginBottom;
|
||||
final double marginLeft;
|
||||
final TextEditingController controller;
|
||||
final Function onNumberChange;
|
||||
final Function onCountryChange;
|
||||
MobileNo(
|
||||
{this.disabled = false,
|
||||
this.marginTop = 0,
|
||||
this.marginRight = 0,
|
||||
this.marginBottom = 0,
|
||||
this.controller,
|
||||
this.marginLeft = 0,
|
||||
this.onNumberChange,
|
||||
this.onCountryChange,
|
||||
this.margin = 0});
|
||||
|
||||
@override
|
||||
_MobileNo createState() => _MobileNo();
|
||||
}
|
||||
|
||||
class _MobileNo extends State<MobileNo> {
|
||||
var _selectedType = '966';
|
||||
String countryCode = '966';
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Visibility(
|
||||
child: Column(children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
// add Expanded to have your dropdown button fill remaining space
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton(
|
||||
isExpanded: true,
|
||||
value: _selectedType,
|
||||
iconSize: 40,
|
||||
elevation: 16,
|
||||
onChanged: (value) => {
|
||||
widget.onCountryChange(value),
|
||||
setState(() {
|
||||
countryCode = value;
|
||||
_selectedType = value;
|
||||
})
|
||||
},
|
||||
items: widget.countries
|
||||
.map<DropdownMenuItem<String>>((Countries value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value.code,
|
||||
child: Text(value.name),
|
||||
);
|
||||
}).toList())))),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey),
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Icon(
|
||||
Icons.phone,
|
||||
color: Colors.red,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
countryCode,
|
||||
overflow: TextOverflow.clip,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Container(
|
||||
margin: widget.margin != null
|
||||
? EdgeInsets.all(widget.margin)
|
||||
: EdgeInsets.only(
|
||||
top: widget.marginTop,
|
||||
right: widget.marginRight,
|
||||
bottom: widget.marginBottom,
|
||||
left: widget.marginLeft),
|
||||
child: TextField(
|
||||
controller: widget.controller,
|
||||
keyboardType: TextInputType.phone,
|
||||
// onChanged: (value) {
|
||||
// widget.controller.text = countryCode;
|
||||
// },
|
||||
onChanged: (value) => widget.onNumberChange(value),
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none, hintText: '5xxxxxxxx'),
|
||||
),
|
||||
),
|
||||
)
|
||||
]),
|
||||
)
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
class Countries {
|
||||
final String name;
|
||||
final String code;
|
||||
Countries({this.name, this.code});
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class NetworkBaseView extends StatelessWidget {
|
||||
final BaseViewModel baseViewModel;
|
||||
final Widget child;
|
||||
|
||||
NetworkBaseView({Key key, this.baseViewModel, this.child});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: buildBaseViewWidget(),
|
||||
);
|
||||
}
|
||||
|
||||
buildBaseViewWidget() {
|
||||
switch (baseViewModel.state) {
|
||||
case ViewState.Idle:
|
||||
return child;
|
||||
break;
|
||||
case ViewState.Busy:
|
||||
return AppCircularProgressIndicator();
|
||||
break;
|
||||
case ViewState.Error:
|
||||
return Center(
|
||||
child: AppEmbeddedError(
|
||||
error: baseViewModel.error,
|
||||
),
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// OWNER : Ibrahim albitar
|
||||
// DATE : 12-04-2020
|
||||
// DESCRIPTION : Customization for Texts in app
|
||||
|
||||
class AppText extends StatefulWidget {
|
||||
final String data;
|
||||
final Color color;
|
||||
final FontWeight fontWeight;
|
||||
final double fontSize;
|
||||
final String fontFamily;
|
||||
final double margin;
|
||||
final double marginTop;
|
||||
final double marginRight;
|
||||
final double marginBottom;
|
||||
final double marginLeft;
|
||||
final bool visibility;
|
||||
final TextAlign textAlign;
|
||||
final Color backGroundcolor;
|
||||
final bool underline;
|
||||
AppText(this.data,
|
||||
{this.color = Colors.black,
|
||||
this.fontWeight = FontWeight.normal,
|
||||
this.fontSize,
|
||||
this.fontFamily = 'WorkSans',
|
||||
this.margin,
|
||||
this.marginTop = 0,
|
||||
this.marginRight = 0,
|
||||
this.marginBottom = 0,
|
||||
this.marginLeft = 0,
|
||||
this.visibility = true,
|
||||
this.textAlign,
|
||||
this.underline = false,
|
||||
this.backGroundcolor = Colors.white});
|
||||
|
||||
@override
|
||||
_AppTextState createState() => _AppTextState();
|
||||
}
|
||||
|
||||
class _AppTextState extends State<AppText> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Visibility(
|
||||
visible: widget.visibility,
|
||||
child: Container(
|
||||
margin: widget.margin != null
|
||||
? EdgeInsets.all(widget.margin)
|
||||
: EdgeInsets.only(
|
||||
top: widget.marginTop,
|
||||
right: widget.marginRight,
|
||||
bottom: widget.marginBottom,
|
||||
left: widget.marginLeft),
|
||||
child: Text(
|
||||
widget.data,
|
||||
textAlign: widget.textAlign,
|
||||
overflow: TextOverflow.clip,
|
||||
style: TextStyle(
|
||||
color: widget.color,
|
||||
fontWeight: widget.fontWeight,
|
||||
fontSize: widget.fontSize ?? (SizeConfig.textMultiplier * 2),
|
||||
fontFamily: widget.fontFamily,
|
||||
decoration: widget.underline == true
|
||||
? TextDecoration.underline
|
||||
: TextDecoration.none
|
||||
// backgroundColor:widget.backGroundcolor
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue