Merge branch 'Haroon' into 'master'
Haroon See merge request Cloud_Solution/diplomatic-quarter!20merge-update-with-lab-changes
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 81 KiB |
@ -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,310 @@
|
||||
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_inappwebview (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
|
||||
- manage_calendar_events (0.0.1):
|
||||
- Flutter
|
||||
- map_launcher (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_inappwebview (from `.symlinks/plugins/flutter_inappwebview/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`)
|
||||
- manage_calendar_events (from `.symlinks/plugins/manage_calendar_events/ios`)
|
||||
- map_launcher (from `.symlinks/plugins/map_launcher/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_inappwebview:
|
||||
:path: ".symlinks/plugins/flutter_inappwebview/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"
|
||||
manage_calendar_events:
|
||||
:path: ".symlinks/plugins/manage_calendar_events/ios"
|
||||
map_launcher:
|
||||
:path: ".symlinks/plugins/map_launcher/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_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189
|
||||
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
|
||||
manage_calendar_events: 0338d505ea26cdfd20cd883279bc28afa11eca34
|
||||
map_launcher: e325db1261d029ff33e08e03baccffe09593ffea
|
||||
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
|
||||
@ -0,0 +1,274 @@
|
||||
class AppoitmentAllHistoryResultList {
|
||||
String setupID;
|
||||
int projectID;
|
||||
int appointmentNo;
|
||||
String appointmentDate;
|
||||
dynamic 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;
|
||||
dynamic confirmedBy;
|
||||
dynamic confirmedOn;
|
||||
dynamic arrivalChangedBy;
|
||||
dynamic arrivedOn;
|
||||
dynamic editedBy;
|
||||
dynamic editedOn;
|
||||
dynamic doctorName;
|
||||
dynamic doctorNameN;
|
||||
String statusDesc;
|
||||
dynamic statusDescN;
|
||||
bool vitalStatus;
|
||||
dynamic 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;
|
||||
dynamic listHISGetContactLensPerscription;
|
||||
dynamic 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'] != null ?json['DoctorSpeciality'].cast<String>() : ["null"];
|
||||
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,168 @@
|
||||
class DoctorList {
|
||||
int clinicID;
|
||||
String clinicName;
|
||||
String doctorTitle;
|
||||
int iD;
|
||||
String name;
|
||||
int projectID;
|
||||
String projectName;
|
||||
int actualDoctorRate;
|
||||
int clinicRoomNo;
|
||||
dynamic date;
|
||||
dynamic dayName;
|
||||
int doctorID;
|
||||
String doctorImageURL;
|
||||
dynamic doctorProfile;
|
||||
dynamic doctorProfileInfo;
|
||||
int doctorRate;
|
||||
int gender;
|
||||
String genderDescription;
|
||||
bool isAppointmentAllowed;
|
||||
bool isDoctorAllowVedioCall;
|
||||
bool isDoctorDummy;
|
||||
bool isLiveCare;
|
||||
String latitude;
|
||||
String longitude;
|
||||
String nationalityFlagURL;
|
||||
String nationalityID;
|
||||
String nationalityName;
|
||||
dynamic nearestFreeSlot;
|
||||
int noOfPatientsRate;
|
||||
int originalClinicID;
|
||||
int personRate;
|
||||
int projectDistanceInKiloMeters;
|
||||
String qR;
|
||||
dynamic qRString;
|
||||
int rateNumber;
|
||||
dynamic serviceID;
|
||||
String setupID;
|
||||
List<String> speciality;
|
||||
dynamic workingHours;
|
||||
|
||||
DoctorList(
|
||||
{this.clinicID,
|
||||
this.clinicName,
|
||||
this.doctorTitle,
|
||||
this.iD,
|
||||
this.name,
|
||||
this.projectID,
|
||||
this.projectName,
|
||||
this.actualDoctorRate,
|
||||
this.clinicRoomNo,
|
||||
this.date,
|
||||
this.dayName,
|
||||
this.doctorID,
|
||||
this.doctorImageURL,
|
||||
this.doctorProfile,
|
||||
this.doctorProfileInfo,
|
||||
this.doctorRate,
|
||||
this.gender,
|
||||
this.genderDescription,
|
||||
this.isAppointmentAllowed,
|
||||
this.isDoctorAllowVedioCall,
|
||||
this.isDoctorDummy,
|
||||
this.isLiveCare,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.nationalityFlagURL,
|
||||
this.nationalityID,
|
||||
this.nationalityName,
|
||||
this.nearestFreeSlot,
|
||||
this.noOfPatientsRate,
|
||||
this.originalClinicID,
|
||||
this.personRate,
|
||||
this.projectDistanceInKiloMeters,
|
||||
this.qR,
|
||||
this.qRString,
|
||||
this.rateNumber,
|
||||
this.serviceID,
|
||||
this.setupID,
|
||||
this.speciality,
|
||||
this.workingHours});
|
||||
|
||||
DoctorList.fromJson(Map<String, dynamic> json) {
|
||||
clinicID = json['ClinicID'];
|
||||
clinicName = json['ClinicName'];
|
||||
doctorTitle = json['DoctorTitle'];
|
||||
iD = json['ID'];
|
||||
name = json['Name'];
|
||||
projectID = json['ProjectID'];
|
||||
projectName = json['ProjectName'];
|
||||
actualDoctorRate = json['ActualDoctorRate'];
|
||||
clinicRoomNo = json['ClinicRoomNo'];
|
||||
date = json['Date'];
|
||||
dayName = json['DayName'];
|
||||
doctorID = json['DoctorID'];
|
||||
doctorImageURL = json['DoctorImageURL'];
|
||||
doctorProfile = json['DoctorProfile'];
|
||||
doctorProfileInfo = json['DoctorProfileInfo'];
|
||||
doctorRate = json['DoctorRate'];
|
||||
gender = json['Gender'];
|
||||
genderDescription = json['GenderDescription'];
|
||||
isAppointmentAllowed = json['IsAppointmentAllowed'];
|
||||
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
|
||||
isDoctorDummy = json['IsDoctorDummy'];
|
||||
isLiveCare = json['IsLiveCare'];
|
||||
latitude = json['Latitude'];
|
||||
longitude = json['Longitude'];
|
||||
nationalityFlagURL = json['NationalityFlagURL'];
|
||||
nationalityID = json['NationalityID'];
|
||||
nationalityName = json['NationalityName'];
|
||||
nearestFreeSlot = json['NearestFreeSlot'];
|
||||
noOfPatientsRate = json['NoOfPatientsRate'];
|
||||
originalClinicID = json['OriginalClinicID'];
|
||||
personRate = json['PersonRate'];
|
||||
projectDistanceInKiloMeters = json['ProjectDistanceInKiloMeters'];
|
||||
qR = json['QR'];
|
||||
qRString = json['QRString'];
|
||||
rateNumber = json['RateNumber'];
|
||||
serviceID = json['ServiceID'];
|
||||
setupID = json['SetupID'];
|
||||
speciality = json['Speciality'].cast<String>();
|
||||
workingHours = json['WorkingHours'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['ClinicName'] = this.clinicName;
|
||||
data['DoctorTitle'] = this.doctorTitle;
|
||||
data['ID'] = this.iD;
|
||||
data['Name'] = this.name;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['ActualDoctorRate'] = this.actualDoctorRate;
|
||||
data['ClinicRoomNo'] = this.clinicRoomNo;
|
||||
data['Date'] = this.date;
|
||||
data['DayName'] = this.dayName;
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['DoctorImageURL'] = this.doctorImageURL;
|
||||
data['DoctorProfile'] = this.doctorProfile;
|
||||
data['DoctorProfileInfo'] = this.doctorProfileInfo;
|
||||
data['DoctorRate'] = this.doctorRate;
|
||||
data['Gender'] = this.gender;
|
||||
data['GenderDescription'] = this.genderDescription;
|
||||
data['IsAppointmentAllowed'] = this.isAppointmentAllowed;
|
||||
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
|
||||
data['IsDoctorDummy'] = this.isDoctorDummy;
|
||||
data['IsLiveCare'] = this.isLiveCare;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['NationalityFlagURL'] = this.nationalityFlagURL;
|
||||
data['NationalityID'] = this.nationalityID;
|
||||
data['NationalityName'] = this.nationalityName;
|
||||
data['NearestFreeSlot'] = this.nearestFreeSlot;
|
||||
data['NoOfPatientsRate'] = this.noOfPatientsRate;
|
||||
data['OriginalClinicID'] = this.originalClinicID;
|
||||
data['PersonRate'] = this.personRate;
|
||||
data['ProjectDistanceInKiloMeters'] = this.projectDistanceInKiloMeters;
|
||||
data['QR'] = this.qR;
|
||||
data['QRString'] = this.qRString;
|
||||
data['RateNumber'] = this.rateNumber;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['Speciality'] = this.speciality;
|
||||
data['WorkingHours'] = this.workingHours;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,176 @@
|
||||
class DoctorProfileList {
|
||||
int doctorID;
|
||||
String doctorName;
|
||||
Null doctorNameN;
|
||||
int clinicID;
|
||||
String clinicDescription;
|
||||
Null clinicDescriptionN;
|
||||
Null licenseExpiry;
|
||||
int employmentType;
|
||||
Null setupID;
|
||||
int projectID;
|
||||
String projectName;
|
||||
String nationalityID;
|
||||
String nationalityName;
|
||||
Null nationalityNameN;
|
||||
int gender;
|
||||
String genderDescription;
|
||||
Null genderDescriptionN;
|
||||
Null doctorTitle;
|
||||
Null projectNameN;
|
||||
bool isAllowWaitList;
|
||||
String titleDescription;
|
||||
Null titleDescriptionN;
|
||||
Null isRegistered;
|
||||
Null isDoctorDummy;
|
||||
bool isActive;
|
||||
Null isDoctorAppointmentDisplayed;
|
||||
bool doctorClinicActive;
|
||||
Null isbookingAllowed;
|
||||
String doctorCases;
|
||||
Null doctorPicture;
|
||||
String doctorProfileInfo;
|
||||
List<String> specialty;
|
||||
int actualDoctorRate;
|
||||
String doctorImageURL;
|
||||
int doctorRate;
|
||||
String doctorTitleForProfile;
|
||||
bool isAppointmentAllowed;
|
||||
String nationalityFlagURL;
|
||||
int noOfPatientsRate;
|
||||
String qR;
|
||||
int serviceID;
|
||||
|
||||
DoctorProfileList(
|
||||
{this.doctorID,
|
||||
this.doctorName,
|
||||
this.doctorNameN,
|
||||
this.clinicID,
|
||||
this.clinicDescription,
|
||||
this.clinicDescriptionN,
|
||||
this.licenseExpiry,
|
||||
this.employmentType,
|
||||
this.setupID,
|
||||
this.projectID,
|
||||
this.projectName,
|
||||
this.nationalityID,
|
||||
this.nationalityName,
|
||||
this.nationalityNameN,
|
||||
this.gender,
|
||||
this.genderDescription,
|
||||
this.genderDescriptionN,
|
||||
this.doctorTitle,
|
||||
this.projectNameN,
|
||||
this.isAllowWaitList,
|
||||
this.titleDescription,
|
||||
this.titleDescriptionN,
|
||||
this.isRegistered,
|
||||
this.isDoctorDummy,
|
||||
this.isActive,
|
||||
this.isDoctorAppointmentDisplayed,
|
||||
this.doctorClinicActive,
|
||||
this.isbookingAllowed,
|
||||
this.doctorCases,
|
||||
this.doctorPicture,
|
||||
this.doctorProfileInfo,
|
||||
this.specialty,
|
||||
this.actualDoctorRate,
|
||||
this.doctorImageURL,
|
||||
this.doctorRate,
|
||||
this.doctorTitleForProfile,
|
||||
this.isAppointmentAllowed,
|
||||
this.nationalityFlagURL,
|
||||
this.noOfPatientsRate,
|
||||
this.qR,
|
||||
this.serviceID});
|
||||
|
||||
DoctorProfileList.fromJson(Map<String, dynamic> json) {
|
||||
doctorID = json['DoctorID'];
|
||||
doctorName = json['DoctorName'];
|
||||
doctorNameN = json['DoctorNameN'];
|
||||
clinicID = json['ClinicID'];
|
||||
clinicDescription = json['ClinicDescription'];
|
||||
clinicDescriptionN = json['ClinicDescriptionN'];
|
||||
licenseExpiry = json['LicenseExpiry'];
|
||||
employmentType = json['EmploymentType'];
|
||||
setupID = json['SetupID'];
|
||||
projectID = json['ProjectID'];
|
||||
projectName = json['ProjectName'];
|
||||
nationalityID = json['NationalityID'];
|
||||
nationalityName = json['NationalityName'];
|
||||
nationalityNameN = json['NationalityNameN'];
|
||||
gender = json['Gender'];
|
||||
genderDescription = json['Gender_Description'];
|
||||
genderDescriptionN = json['Gender_DescriptionN'];
|
||||
doctorTitle = json['DoctorTitle'];
|
||||
projectNameN = json['ProjectNameN'];
|
||||
isAllowWaitList = json['IsAllowWaitList'];
|
||||
titleDescription = json['Title_Description'];
|
||||
titleDescriptionN = json['Title_DescriptionN'];
|
||||
isRegistered = json['IsRegistered'];
|
||||
isDoctorDummy = json['IsDoctorDummy'];
|
||||
isActive = json['IsActive'];
|
||||
isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed'];
|
||||
doctorClinicActive = json['DoctorClinicActive'];
|
||||
isbookingAllowed = json['IsbookingAllowed'];
|
||||
doctorCases = json['DoctorCases'];
|
||||
doctorPicture = json['DoctorPicture'];
|
||||
doctorProfileInfo = json['DoctorProfileInfo'];
|
||||
specialty = json['Specialty'].cast<String>();
|
||||
actualDoctorRate = json['ActualDoctorRate'];
|
||||
doctorImageURL = json['DoctorImageURL'];
|
||||
doctorRate = json['DoctorRate'];
|
||||
doctorTitleForProfile = json['DoctorTitleForProfile'];
|
||||
isAppointmentAllowed = json['IsAppointmentAllowed'];
|
||||
nationalityFlagURL = json['NationalityFlagURL'];
|
||||
noOfPatientsRate = json['NoOfPatientsRate'];
|
||||
qR = json['QR'];
|
||||
serviceID = json['ServiceID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['DoctorNameN'] = this.doctorNameN;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['ClinicDescription'] = this.clinicDescription;
|
||||
data['ClinicDescriptionN'] = this.clinicDescriptionN;
|
||||
data['LicenseExpiry'] = this.licenseExpiry;
|
||||
data['EmploymentType'] = this.employmentType;
|
||||
data['SetupID'] = this.setupID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['NationalityID'] = this.nationalityID;
|
||||
data['NationalityName'] = this.nationalityName;
|
||||
data['NationalityNameN'] = this.nationalityNameN;
|
||||
data['Gender'] = this.gender;
|
||||
data['Gender_Description'] = this.genderDescription;
|
||||
data['Gender_DescriptionN'] = this.genderDescriptionN;
|
||||
data['DoctorTitle'] = this.doctorTitle;
|
||||
data['ProjectNameN'] = this.projectNameN;
|
||||
data['IsAllowWaitList'] = this.isAllowWaitList;
|
||||
data['Title_Description'] = this.titleDescription;
|
||||
data['Title_DescriptionN'] = this.titleDescriptionN;
|
||||
data['IsRegistered'] = this.isRegistered;
|
||||
data['IsDoctorDummy'] = this.isDoctorDummy;
|
||||
data['IsActive'] = this.isActive;
|
||||
data['IsDoctorAppointmentDisplayed'] = this.isDoctorAppointmentDisplayed;
|
||||
data['DoctorClinicActive'] = this.doctorClinicActive;
|
||||
data['IsbookingAllowed'] = this.isbookingAllowed;
|
||||
data['DoctorCases'] = this.doctorCases;
|
||||
data['DoctorPicture'] = this.doctorPicture;
|
||||
data['DoctorProfileInfo'] = this.doctorProfileInfo;
|
||||
data['Specialty'] = this.specialty;
|
||||
data['ActualDoctorRate'] = this.actualDoctorRate;
|
||||
data['DoctorImageURL'] = this.doctorImageURL;
|
||||
data['DoctorRate'] = this.doctorRate;
|
||||
data['DoctorTitleForProfile'] = this.doctorTitleForProfile;
|
||||
data['IsAppointmentAllowed'] = this.isAppointmentAllowed;
|
||||
data['NationalityFlagURL'] = this.nationalityFlagURL;
|
||||
data['NoOfPatientsRate'] = this.noOfPatientsRate;
|
||||
data['QR'] = this.qR;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
import 'package:diplomaticquarterapp/models/Request.dart';
|
||||
|
||||
class InsertAppointmentRequest extends Request {
|
||||
String AppointmentDate; // ???? "/Date(1577750400000)/"
|
||||
int DoctorID;
|
||||
int InitialSlotDuration;
|
||||
String SelectedTime;
|
||||
String StartTime;
|
||||
String EndTime;
|
||||
String TempValue;
|
||||
int VisitFor;
|
||||
int VisitType;
|
||||
bool IsVirtual;
|
||||
List<String> GeneralProcedureList;
|
||||
String DeviceToken;
|
||||
String DeviceType;
|
||||
bool IsForLiveCare;
|
||||
String OriginalClinicID;
|
||||
String OriginalProjectID;
|
||||
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class TimeSlot {
|
||||
String isoTime;
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
|
||||
TimeSlot({@required this.isoTime, @required this.start, @required this.end});
|
||||
|
||||
}
|
||||
@ -0,0 +1,297 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
|
||||
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||
import 'package:diplomaticquarterapp/routes.dart';
|
||||
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class QRCode extends StatefulWidget {
|
||||
PatientShareResponse patientShareResponse;
|
||||
String appoQR;
|
||||
AuthenticatedUser authUser;
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
|
||||
QRCode({@required this.patientShareResponse, @required this.appoQR});
|
||||
|
||||
@override
|
||||
_QRCodeState createState() => _QRCodeState();
|
||||
}
|
||||
|
||||
class _QRCodeState extends State<QRCode> {
|
||||
Uint8List _bytes;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
_bytes = base64.decode(widget.appoQR.split(',').last);
|
||||
widget.authUser = new AuthenticatedUser();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).attendRegisterCode,
|
||||
isShowAppBar: true,
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 30.0),
|
||||
alignment: Alignment.center,
|
||||
child: Image.memory(_bytes, scale: 0.5),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0),
|
||||
child: Divider(
|
||||
color: Colors.red[700],
|
||||
thickness: 0.8,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0),
|
||||
child: Image.asset(
|
||||
"assets/images/new-design/device_icon.png",
|
||||
width: 120.0,
|
||||
height: 120.0),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.5,
|
||||
margin: EdgeInsets.only(
|
||||
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(TranslationBase.of(context).scanQRHospital,
|
||||
style: TextStyle(
|
||||
color: Colors.red[700],
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
|
||||
child: Divider(
|
||||
color: Colors.red[700],
|
||||
thickness: 0.8,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(TranslationBase.of(context).appoInfo,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
color: Colors.grey[700],
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 20.0, bottom: 20.0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.grey[200],
|
||||
boxShadow: [
|
||||
BoxShadow(color: Colors.grey, spreadRadius: 2),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(widget.patientShareResponse.doctorNameObj,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
color: Colors.grey[700],
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(
|
||||
getDoctorSpeciality(
|
||||
widget.patientShareResponse.doctorSpeciality),
|
||||
style: TextStyle(
|
||||
fontSize: 18.0, color: Colors.grey[700])),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(widget.patientShareResponse.projectName,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0, color: Colors.grey[700])),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(
|
||||
getDate(widget.patientShareResponse.appointmentDate),
|
||||
style: TextStyle(
|
||||
fontSize: 18.0, color: Colors.grey[700])),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
ButtonTheme(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
minWidth: MediaQuery.of(context).size.width * 0.7,
|
||||
height: 45.0,
|
||||
child: RaisedButton(
|
||||
color: new Color(0xFF60686b),
|
||||
textColor: Colors.white,
|
||||
disabledTextColor: Colors.white,
|
||||
disabledColor: new Color(0xFFbcc2c4),
|
||||
onPressed: () {
|
||||
// navigateToQR(context);
|
||||
// getAppoQR(context);
|
||||
sendEmail();
|
||||
},
|
||||
child: Text(
|
||||
TranslationBase.of(context).sendEmail.toUpperCase(),
|
||||
style: TextStyle(fontSize: 18.0)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.bottomCenter,
|
||||
height: MediaQuery.of(context).size.height * 0.1,
|
||||
margin: EdgeInsets.only(bottom: 20.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
ButtonTheme(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
minWidth: MediaQuery.of(context).size.width * 0.7,
|
||||
height: 45.0,
|
||||
child: RaisedButton(
|
||||
color: new Color(0xFF60686b),
|
||||
textColor: Colors.white,
|
||||
disabledTextColor: Colors.white,
|
||||
disabledColor: new Color(0xFFbcc2c4),
|
||||
onPressed: () {
|
||||
navigateToHome(context);
|
||||
},
|
||||
child: Text(
|
||||
TranslationBase.of(context).close.toUpperCase(),
|
||||
style: TextStyle(fontSize: 18.0)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
sendEmail() async {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
|
||||
if (await widget.sharedPref.getObject(USER_PROFILE) != null) {
|
||||
var data = AuthenticatedUser.fromJson(
|
||||
await widget.sharedPref.getObject(USER_PROFILE));
|
||||
setState(() {
|
||||
widget.authUser = data;
|
||||
});
|
||||
}
|
||||
|
||||
ConfirmDialog dialog = new ConfirmDialog(
|
||||
context: context,
|
||||
confirmMessage: "Send a copy of this QR to the email " +
|
||||
widget.authUser.emailAddress +
|
||||
"?",
|
||||
okText: TranslationBase.of(context).confirm,
|
||||
cancelText: TranslationBase.of(context).cancel_nocaps,
|
||||
okFunction: () {
|
||||
service
|
||||
.sendAppointmentQREmail(
|
||||
widget.authUser.emailAddress,
|
||||
widget.patientShareResponse.appointmentDate,
|
||||
widget.patientShareResponse.appointmentNo.toString(),
|
||||
widget.patientShareResponse.doctorNameObj,
|
||||
widget.patientShareResponse.projectName,
|
||||
widget.appoQR,
|
||||
getDoctorSpeciality(
|
||||
widget.patientShareResponse.doctorSpeciality),
|
||||
context)
|
||||
.then((res) {
|
||||
print(res);
|
||||
ConfirmDialog.closeAlertDialog(context);
|
||||
}).catchError((err) {
|
||||
ConfirmDialog.closeAlertDialog(context);
|
||||
AppToast.showErrorToast(message: err);
|
||||
print(err);
|
||||
});
|
||||
},
|
||||
cancelFunction: () => {});
|
||||
dialog.showAlertDialog(context);
|
||||
}
|
||||
|
||||
Future navigateToHome(context) async {
|
||||
Navigator.of(context).pushNamed(HOME);
|
||||
}
|
||||
|
||||
getPatientShare(context, String appointmentNo, int clinicID, int projectID,
|
||||
DoctorList docObject) {}
|
||||
|
||||
String getDate(String appoDate) {
|
||||
var appoDateFormatted = "";
|
||||
|
||||
var dateObj = DateUtil.convertStringToDate(appoDate);
|
||||
|
||||
setState(() {
|
||||
appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) +
|
||||
", " +
|
||||
dateObj.day.toString() +
|
||||
" " +
|
||||
DateUtil.getMonth(dateObj.month) +
|
||||
" " +
|
||||
dateObj.year.toString() +
|
||||
", " +
|
||||
dateObj.hour.toString() +
|
||||
":" +
|
||||
dateObj.minute.toString() +
|
||||
":00";
|
||||
});
|
||||
|
||||
return appoDateFormatted;
|
||||
}
|
||||
|
||||
String getDoctorSpeciality(List<String> docSpecial) {
|
||||
String docSpeciality = "";
|
||||
docSpecial.forEach((v) {
|
||||
docSpeciality = docSpeciality + v + "\n";
|
||||
});
|
||||
return docSpeciality;
|
||||
}
|
||||
}
|
||||
@ -1,272 +0,0 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentModel.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtons.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppointmentActions extends StatefulWidget {
|
||||
@override
|
||||
_AppointmentActionsState createState() => _AppointmentActionsState();
|
||||
}
|
||||
|
||||
class _AppointmentActionsState extends State<AppointmentActions> {
|
||||
List<AppoDetailsButton> appoButtonsList = [];
|
||||
var appointment = new AppointmentModel();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
appointment.PatientStatusType = 0;
|
||||
appointment.IsOnlineCheckedIN = true;
|
||||
|
||||
_getAppointmentActionButtons();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var size = MediaQuery.of(context).size;
|
||||
final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2;
|
||||
final double itemWidth = size.width / 2;
|
||||
|
||||
return Container(
|
||||
margin: EdgeInsets.all(5.0),
|
||||
child: CustomScrollView(
|
||||
primary: false,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
slivers: <Widget>[
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
|
||||
sliver: SliverGrid.count(
|
||||
crossAxisCount: 2,
|
||||
childAspectRatio: (itemWidth / itemHeight),
|
||||
children: appoButtonsList
|
||||
.map((e) => GestureDetector(
|
||||
onTap: () {
|
||||
_handleButtonClicks(e);
|
||||
},
|
||||
child: Container(
|
||||
height: 100.0,
|
||||
margin: EdgeInsets.all(9.0),
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey[400],
|
||||
blurRadius: 2.0,
|
||||
spreadRadius: 0.0)
|
||||
],
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
|
||||
child: Text(e.title,
|
||||
overflow: TextOverflow.clip,
|
||||
style: TextStyle(
|
||||
color: new Color(0xFFc5272d),
|
||||
letterSpacing: 1.0,
|
||||
fontSize: 20.0)),
|
||||
),
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
|
||||
child: Text(e.subtitle,
|
||||
overflow: TextOverflow.clip,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
letterSpacing: 1.0,
|
||||
fontSize: 15.0)),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.bottomRight,
|
||||
margin:
|
||||
EdgeInsets.fromLTRB(0.0, 20.0, 10.0, 8.0),
|
||||
child: Image.asset(e.icon,
|
||||
width: 40.0, height: 40.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_handleButtonClicks(AppoDetailsButton) {
|
||||
print(AppoDetailsButton.caller);
|
||||
}
|
||||
|
||||
_getAppointmentActionButtons() {
|
||||
if (appointment != null) {
|
||||
if (isConfirmed()) {
|
||||
if (appointment.IsOnlineCheckedIN) {
|
||||
_getConfirmedCheckInAppoActionsList();
|
||||
} else {
|
||||
_getConfirmedAppoActionsList();
|
||||
}
|
||||
} else {
|
||||
print("isConfirmed Null");
|
||||
}
|
||||
if (isBooked()) {
|
||||
if (appointment.IsOnlineCheckedIN) {
|
||||
_getBookedCheckInAppoActionsList();
|
||||
} else {
|
||||
_getBookedAppoActionsList();
|
||||
}
|
||||
} else {
|
||||
print("isBooked Null");
|
||||
}
|
||||
if (isArrived()) {
|
||||
if (appointment.ClinicID == 17) {
|
||||
_getArrivedInvoiceAppoActionsList();
|
||||
} else {
|
||||
_getArrivedAppoActionsList();
|
||||
}
|
||||
} else {
|
||||
print("isArrived Null");
|
||||
}
|
||||
} else {
|
||||
print("Appo Null");
|
||||
}
|
||||
}
|
||||
|
||||
bool isConfirmed() {
|
||||
return AppointmentType.isConfirmed(this.appointment);
|
||||
}
|
||||
|
||||
bool isArrived() {
|
||||
return AppointmentType.isArrived(this.appointment);
|
||||
}
|
||||
|
||||
bool isCheckedIn() {
|
||||
return this.appointment.IsOnlineCheckedIN;
|
||||
}
|
||||
|
||||
bool isBooked() {
|
||||
return AppointmentType.isBooked(this.appointment);
|
||||
}
|
||||
|
||||
Future<List<AppoDetailsButton>> _getBookedAppoActionsList() async {
|
||||
print("_getBookedAppoActionsList");
|
||||
var bookButtonsJson;
|
||||
List<AppoDetailsButton> buttonsList = [];
|
||||
String data = await DefaultAssetBundle.of(context)
|
||||
.loadString("assets/json/bookedButtons.json");
|
||||
bookButtonsJson = json.decode(data);
|
||||
for (var i = 0; i < bookButtonsJson.length; i++) {
|
||||
buttonsList.add(AppoDetailsButton(
|
||||
title: bookButtonsJson[i]['title'],
|
||||
subtitle: bookButtonsJson[i]['subtitle'],
|
||||
icon: bookButtonsJson[i]['icon'],
|
||||
caller: bookButtonsJson[i]['caller'],
|
||||
));
|
||||
}
|
||||
setState(() {
|
||||
appoButtonsList = buttonsList;
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<AppoDetailsButton>> _getBookedCheckInAppoActionsList() async {
|
||||
// BookedButtons.getContext(context);
|
||||
print("_getBookedCheckInAppoActionsList");
|
||||
List<AppoDetailsButton> buttonsList = [];
|
||||
for (var i = 0; i < BookedButtons.buttons.length; i++) {
|
||||
buttonsList.add(AppoDetailsButton(
|
||||
title: BookedButtons.buttons[i]['title'],
|
||||
subtitle: BookedButtons.buttons[i]['subtitle'],
|
||||
icon: BookedButtons.buttons[i]['icon'],
|
||||
caller: BookedButtons.buttons[i]['caller'],
|
||||
));
|
||||
}
|
||||
setState(() {
|
||||
appoButtonsList = buttonsList;
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<AppoDetailsButton>> _getConfirmedAppoActionsList() async {
|
||||
var bookButtonsJson;
|
||||
List<AppoDetailsButton> buttonsList = [];
|
||||
String data = await DefaultAssetBundle.of(context)
|
||||
.loadString("assets/json/bookedButtons.json");
|
||||
bookButtonsJson = json.decode(data);
|
||||
for (var i = 0; i < bookButtonsJson.length; i++) {
|
||||
buttonsList.add(AppoDetailsButton(
|
||||
title: bookButtonsJson[i]['title'],
|
||||
subtitle: bookButtonsJson[i]['subtitle'],
|
||||
icon: bookButtonsJson[i]['icon'],
|
||||
caller: bookButtonsJson[i]['caller'],
|
||||
));
|
||||
}
|
||||
setState(() {
|
||||
appoButtonsList = buttonsList;
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<AppoDetailsButton>> _getConfirmedCheckInAppoActionsList() async {
|
||||
var bookButtonsJson;
|
||||
List<AppoDetailsButton> buttonsList = [];
|
||||
String data = await DefaultAssetBundle.of(context)
|
||||
.loadString("assets/json/bookedButtons.json");
|
||||
bookButtonsJson = json.decode(data);
|
||||
for (var i = 0; i < bookButtonsJson.length; i++) {
|
||||
buttonsList.add(AppoDetailsButton(
|
||||
title: bookButtonsJson[i]['title'],
|
||||
subtitle: bookButtonsJson[i]['subtitle'],
|
||||
icon: bookButtonsJson[i]['icon'],
|
||||
caller: bookButtonsJson[i]['caller'],
|
||||
));
|
||||
}
|
||||
setState(() {
|
||||
appoButtonsList = buttonsList;
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<AppoDetailsButton>> _getArrivedAppoActionsList() async {
|
||||
var bookButtonsJson;
|
||||
List<AppoDetailsButton> buttonsList = [];
|
||||
String data = await DefaultAssetBundle.of(context)
|
||||
.loadString("assets/json/bookedButtons.json");
|
||||
bookButtonsJson = json.decode(data);
|
||||
for (var i = 0; i < bookButtonsJson.length; i++) {
|
||||
buttonsList.add(AppoDetailsButton(
|
||||
title: bookButtonsJson[i]['title'],
|
||||
subtitle: bookButtonsJson[i]['subtitle'],
|
||||
icon: bookButtonsJson[i]['icon'],
|
||||
caller: bookButtonsJson[i]['caller'],
|
||||
));
|
||||
}
|
||||
setState(() {
|
||||
appoButtonsList = buttonsList;
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<AppoDetailsButton>> _getArrivedInvoiceAppoActionsList() async {
|
||||
var bookButtonsJson;
|
||||
List<AppoDetailsButton> buttonsList = [];
|
||||
String data = await DefaultAssetBundle.of(context)
|
||||
.loadString("assets/json/bookedButtons.json");
|
||||
bookButtonsJson = json.decode(data);
|
||||
for (var i = 0; i < bookButtonsJson.length; i++) {
|
||||
buttonsList.add(AppoDetailsButton(
|
||||
title: bookButtonsJson[i]['title'],
|
||||
subtitle: bookButtonsJson[i]['subtitle'],
|
||||
icon: bookButtonsJson[i]['icon'],
|
||||
caller: bookButtonsJson[i]['caller'],
|
||||
));
|
||||
}
|
||||
setState(() {
|
||||
appoButtonsList = buttonsList;
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,237 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCardView.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 MyAppointments extends StatefulWidget {
|
||||
List<AppoitmentAllHistoryResultList> appoList = [];
|
||||
|
||||
List<AppoitmentAllHistoryResultList> bookedAppoList = [];
|
||||
List<AppoitmentAllHistoryResultList> confirmedAppoList = [];
|
||||
List<AppoitmentAllHistoryResultList> arrivedAppoList = [];
|
||||
|
||||
@override
|
||||
_MyAppointmentsState createState() => _MyAppointmentsState();
|
||||
}
|
||||
|
||||
class _MyAppointmentsState extends State<MyAppointments>
|
||||
with SingleTickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
|
||||
bool isDataLoaded = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_tabController = new TabController(length: 3, vsync: this);
|
||||
WidgetsBinding.instance
|
||||
.addPostFrameCallback((_) => getPatientAppointmentHistory());
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: "My Appointments",
|
||||
isShowAppBar: true,
|
||||
body: Container(
|
||||
child: Column(children: [
|
||||
/// this is will not colored with theme data
|
||||
TabBar(
|
||||
tabs: [
|
||||
Tab(text: TranslationBase.of(context).booked),
|
||||
Tab(text: TranslationBase.of(context).confirmed),
|
||||
Tab(text: TranslationBase.of(context).arrived),
|
||||
],
|
||||
controller: _tabController,
|
||||
),
|
||||
Divider(
|
||||
color: Colors.grey[600],
|
||||
thickness: 0.5,
|
||||
),
|
||||
Expanded(
|
||||
child: new TabBarView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
children: [
|
||||
isDataLoaded ? getBookedAppointments() : Container(),
|
||||
isDataLoaded ? getConfirmedAppointments() : Container(),
|
||||
isDataLoaded ? getArrivedAppointments() : Container()
|
||||
],
|
||||
controller: _tabController,
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
getPatientAppointmentHistory() {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
widget.appoList.clear();
|
||||
widget.bookedAppoList.clear();
|
||||
widget.confirmedAppoList.clear();
|
||||
widget.arrivedAppoList.clear();
|
||||
service.getPatientAppointmentHistory(false, context).then((res) {
|
||||
print(res['AppoimentAllHistoryResultList'].length);
|
||||
if (res['MessageStatus'] == 1) {
|
||||
setState(() {
|
||||
if (res['AppoimentAllHistoryResultList'].length != 0) {
|
||||
res['AppoimentAllHistoryResultList'].forEach((v) {
|
||||
widget.appoList
|
||||
.add(new AppoitmentAllHistoryResultList.fromJson(v));
|
||||
});
|
||||
sortAppointmentList();
|
||||
openAppointmentsTab();
|
||||
isDataLoaded = true;
|
||||
} else {}
|
||||
});
|
||||
} else {
|
||||
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
bool isConfirmed(AppoitmentAllHistoryResultList appo) {
|
||||
return AppointmentType.isConfirmed(appo);
|
||||
}
|
||||
|
||||
bool isArrived(AppoitmentAllHistoryResultList appo) {
|
||||
return AppointmentType.isArrived(appo);
|
||||
}
|
||||
|
||||
bool isBooked(AppoitmentAllHistoryResultList appo) {
|
||||
return AppointmentType.isBooked(appo);
|
||||
}
|
||||
|
||||
sortAppointmentList() {
|
||||
widget.appoList.forEach((v) {
|
||||
if (isBooked(v)) {
|
||||
widget.bookedAppoList.add(v);
|
||||
}
|
||||
|
||||
if (isConfirmed(v)) {
|
||||
widget.confirmedAppoList.add(v);
|
||||
}
|
||||
|
||||
if (isArrived(v)) {
|
||||
widget.arrivedAppoList.add(v);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
openAppointmentsTab() {
|
||||
if (widget.bookedAppoList.length != 0) {
|
||||
_tabController.animateTo((_tabController.index + 1) % 1);
|
||||
} else if (widget.confirmedAppoList.length != 0) {
|
||||
_tabController.animateTo((_tabController.index + 1) % 2);
|
||||
} else if (widget.arrivedAppoList.length != 0) {
|
||||
_tabController.animateTo((_tabController.index + 1) % 3);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Widget getBookedAppointments() {
|
||||
return Container(
|
||||
child: widget.bookedAppoList.length != 0
|
||||
? new ListView.builder(
|
||||
itemCount: widget.bookedAppoList.length,
|
||||
itemBuilder: (context, i) {
|
||||
return AppointmentCard(
|
||||
appo: widget.bookedAppoList[i],
|
||||
onReloadAppointmentHistory: getPatientAppointmentHistory,
|
||||
);
|
||||
},
|
||||
)
|
||||
: Container(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Image.asset(
|
||||
"assets/images/new-design/noAppointmentIcon.png"),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
child: Text("No Booked Appointments",
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget getConfirmedAppointments() {
|
||||
return widget.confirmedAppoList.length != 0
|
||||
? Container(
|
||||
child: new ListView.builder(
|
||||
itemCount: widget.confirmedAppoList.length,
|
||||
itemBuilder: (context, i) {
|
||||
return AppointmentCard(
|
||||
appo: widget.confirmedAppoList[i],
|
||||
onReloadAppointmentHistory: getPatientAppointmentHistory,
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Image.asset("assets/images/new-design/noAppointmentIcon.png"),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
child: Text("No Confirmed Appointments",
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget getArrivedAppointments() {
|
||||
return widget.arrivedAppoList.length != 0
|
||||
? Container(
|
||||
child: new ListView.builder(
|
||||
itemCount: widget.arrivedAppoList.length,
|
||||
itemBuilder: (context, i) {
|
||||
return AppointmentCard(
|
||||
appo: widget.arrivedAppoList[i],
|
||||
onReloadAppointmentHistory: getPatientAppointmentHistory,
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Image.asset("assets/images/new-design/noAppointmentIcon.png"),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
child: Text("No Arrived Appointments",
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.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:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class VisitTicket extends StatefulWidget {
|
||||
List<DoctorList> appoList = [];
|
||||
|
||||
@override
|
||||
_VisitTicketState createState() => _VisitTicketState();
|
||||
}
|
||||
|
||||
class _VisitTicketState extends State<VisitTicket> {
|
||||
bool isLoading = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
getPatientAppointmentCurfewHistory(context);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).todoList,
|
||||
body: isLoading == false
|
||||
? SingleChildScrollView(
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
shrinkWrap: true,
|
||||
physics: ScrollPhysics(),
|
||||
padding: EdgeInsets.all(0.0),
|
||||
itemCount: widget.appoList.length,
|
||||
itemBuilder: (context, index) {
|
||||
return DoctorView(
|
||||
doctor: widget.appoList[index],
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
: AppCircularProgressIndicator(),
|
||||
);
|
||||
}
|
||||
|
||||
getPatientAppointmentCurfewHistory(BuildContext context) {
|
||||
loading(true);
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service.getPatientAppointmentHistory(true, context).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 DoctorList.fromJson(v));
|
||||
});
|
||||
} else {}
|
||||
});
|
||||
loading(false);
|
||||
} else {
|
||||
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
||||
loading(false);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
loading(false);
|
||||
});
|
||||
}
|
||||
|
||||
loading(bool flag) {
|
||||
setState(() {
|
||||
isLoading = flag;
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
|
||||
class ArrivedButtons {
|
||||
static var buttons = [
|
||||
{
|
||||
"title": "Arrived",
|
||||
"subtitle": "Status",
|
||||
"icon": "assets/images/new-design/waiting-room.png",
|
||||
"caller": "openReschedule"
|
||||
},
|
||||
{
|
||||
"title": "Medicines",
|
||||
"subtitle": "Prescriptions",
|
||||
"icon": "assets/images/new-design/medicine_prescriptions_icon.png",
|
||||
"caller": "onCancelAppointment"
|
||||
},
|
||||
{
|
||||
"title": "Radiology",
|
||||
"subtitle": "Services",
|
||||
"icon": "assets/images/new-design/radiology_service_icon.png",
|
||||
"caller": "radiology"
|
||||
},
|
||||
{
|
||||
"title": "Lab",
|
||||
"subtitle": "Result",
|
||||
"icon": "assets/images/new-design/lab_result_icon.png",
|
||||
"caller": "addReminder"
|
||||
},
|
||||
{
|
||||
"title": "Vital Signs",
|
||||
"subtitle": "Values",
|
||||
"icon": "assets/images/new-design/location_icon.png",
|
||||
"caller": "navigateToProject"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).raise,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).complaint,
|
||||
"icon": "assets/images/new-design/Complaint_icon.png",
|
||||
"caller": "insertComplaint"
|
||||
},
|
||||
{
|
||||
"title": "Insurance",
|
||||
"subtitle": "Approvals",
|
||||
"icon": "assets/images/new-design/insurance_approvals_icon.png",
|
||||
"caller": "goToTodoList"
|
||||
},
|
||||
{
|
||||
"title": "Ask Your",
|
||||
"subtitle": "Doctor",
|
||||
"icon": "assets/images/new-design/ask_doctor_icon.png",
|
||||
"caller": "askDoc"
|
||||
},
|
||||
{
|
||||
"title": "Survey",
|
||||
"subtitle": "Service",
|
||||
"icon": "assets/images/new-design/survey.png",
|
||||
"caller": "goToTodoList"
|
||||
}
|
||||
];
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
|
||||
class ArrivedButtons {
|
||||
static var buttons = [
|
||||
{
|
||||
"title": "Arrived",
|
||||
"subtitle": "Status",
|
||||
"icon": "assets/images/new-design/waiting-room.png",
|
||||
"caller": "openReschedule"
|
||||
},
|
||||
{
|
||||
"title": "Medicines",
|
||||
"subtitle": "Prescriptions",
|
||||
"icon": "assets/images/new-design/medicine_prescriptions_icon.png",
|
||||
"caller": "onCancelAppointment"
|
||||
},
|
||||
{
|
||||
"title": "Radiology",
|
||||
"subtitle": "Services",
|
||||
"icon": "assets/images/new-design/radiology_service_icon.png",
|
||||
"caller": "insertComplaint"
|
||||
},
|
||||
{
|
||||
"title": "Lab",
|
||||
"subtitle": "Result",
|
||||
"icon": "assets/images/new-design/lab_result_icon.png",
|
||||
"caller": "addReminder"
|
||||
},
|
||||
{
|
||||
"title": "Vital Signs",
|
||||
"subtitle": "Values",
|
||||
"icon": "assets/images/new-design/location_icon.png",
|
||||
"caller": "navigateToProject"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).raise,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).complaint,
|
||||
"icon": "assets/images/new-design/Complaint_icon.png",
|
||||
"caller": "insertComplaint"
|
||||
},
|
||||
{
|
||||
"title": "Insurance",
|
||||
"subtitle": "Approvals",
|
||||
"icon": "assets/images/new-design/insurance_approvals_icon.png",
|
||||
"caller": "goToTodoList"
|
||||
},
|
||||
{
|
||||
"title": "Ask Your",
|
||||
"subtitle": "Doctor",
|
||||
"icon": "assets/images/new-design/ask_doctor_icon.png",
|
||||
"caller": "goToTodoList"
|
||||
},
|
||||
{
|
||||
"title": "Survey",
|
||||
"subtitle": "Service",
|
||||
"icon": "assets/images/new-design/survey.png",
|
||||
"caller": "goToTodoList"
|
||||
}
|
||||
];
|
||||
}
|
||||
@ -1,60 +1,43 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
|
||||
class BookedButtons {
|
||||
static var context;
|
||||
|
||||
static var buttons = [
|
||||
{
|
||||
"title": TranslationBase.of(context).confirm,
|
||||
"subtitle": TranslationBase.of(context).appointment,
|
||||
"title": TranslationBase.of(AppGlobal.context).confirm,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
|
||||
"icon": "assets/images/new-design/confirm_icon.png",
|
||||
"caller": "confirmAppointment"
|
||||
},
|
||||
// {
|
||||
// "title": "confirm",
|
||||
// "subtitle": "Appointment",
|
||||
// "icon": "assets/images/new-design/confirm_icon.png",
|
||||
// "caller": "confirmAppointment"
|
||||
// },
|
||||
{
|
||||
"title": "reschedule",
|
||||
"subtitle": "appointment",
|
||||
"title": TranslationBase.of(AppGlobal.context).reschedule,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
|
||||
"icon": "assets/images/new-design/reschedule_icon.png",
|
||||
"caller": "openReschedule"
|
||||
},
|
||||
{
|
||||
"title": "cancel",
|
||||
"subtitle": "appointment",
|
||||
"title": TranslationBase.of(AppGlobal.context).cancel_nocaps,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
|
||||
"icon": "assets/images/new-design/cancel_icon.png",
|
||||
"caller": "onCancelAppointment"
|
||||
},
|
||||
{
|
||||
"title": "raise",
|
||||
"subtitle": "complaint",
|
||||
"title": TranslationBase.of(AppGlobal.context).raise,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).complaint,
|
||||
"icon": "assets/images/new-design/Complaint_icon.png",
|
||||
"caller": "insertComplaint"
|
||||
},
|
||||
{
|
||||
"title": "add",
|
||||
"subtitle": "reminder",
|
||||
"title": TranslationBase.of(AppGlobal.context).add,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).reminder,
|
||||
"icon": "assets/images/new-design/reminder_icon.png",
|
||||
"caller": "addReminder"
|
||||
},
|
||||
{
|
||||
"title": "hospital",
|
||||
"subtitle": "locations",
|
||||
"title": TranslationBase.of(AppGlobal.context).hospital,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).location,
|
||||
"icon": "assets/images/new-design/location_icon.png",
|
||||
"caller": "navigateToProject"
|
||||
},
|
||||
{
|
||||
"title": "online",
|
||||
"subtitle": "payment",
|
||||
"icon": "assets/images/new-design/check-in.png",
|
||||
"caller": "goToTodoList(31)"
|
||||
}
|
||||
];
|
||||
|
||||
static setContext(context) {
|
||||
BookedButtons.context = context;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
|
||||
class BookedButtonsAllowCheckIn {
|
||||
static var buttons = [
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).confirm,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
|
||||
"icon": "assets/images/new-design/confirm_icon.png",
|
||||
"caller": "confirmAppointment"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).reschedule,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
|
||||
"icon": "assets/images/new-design/reschedule_icon.png",
|
||||
"caller": "openReschedule"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).cancel_nocaps,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
|
||||
"icon": "assets/images/new-design/cancel_icon.png",
|
||||
"caller": "onCancelAppointment"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).raise,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).complaint,
|
||||
"icon": "assets/images/new-design/Complaint_icon.png",
|
||||
"caller": "insertComplaint"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).add,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).reminder,
|
||||
"icon": "assets/images/new-design/reminder_icon.png",
|
||||
"caller": "addReminder"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).hospital,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).location,
|
||||
"icon": "assets/images/new-design/location_icon.png",
|
||||
"caller": "navigateToProject"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).online,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).payment,
|
||||
"icon": "assets/images/new-design/check-in.png",
|
||||
"caller": "goToTodoList"
|
||||
}
|
||||
];
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
|
||||
class ConfirmedButtons {
|
||||
static var buttons = [
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).reschedule,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
|
||||
"icon": "assets/images/new-design/reschedule_icon.png",
|
||||
"caller": "openReschedule"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).cancel_nocaps,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
|
||||
"icon": "assets/images/new-design/cancel_icon.png",
|
||||
"caller": "onCancelAppointment"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).raise,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).complaint,
|
||||
"icon": "assets/images/new-design/Complaint_icon.png",
|
||||
"caller": "insertComplaint"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).add,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).reminder,
|
||||
"icon": "assets/images/new-design/reminder_icon.png",
|
||||
"caller": "addReminder"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).hospital,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).location,
|
||||
"icon": "assets/images/new-design/location_icon.png",
|
||||
"caller": "navigateToProject"
|
||||
},
|
||||
// {
|
||||
// "title": "Generate",
|
||||
// "subtitle": "Visit Ticket",
|
||||
// "icon": "assets/images/new-design/generate_visit_ticket.png",
|
||||
// "caller": "visitTicket"
|
||||
// },
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).online,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).payment,
|
||||
"icon": "assets/images/new-design/check-in.png",
|
||||
"caller": "goToTodoList"
|
||||
}
|
||||
];
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
|
||||
class ConfirmedButtonsAllowCheckIn {
|
||||
static var buttons = [
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).reschedule,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
|
||||
"icon": "assets/images/new-design/reschedule_icon.png",
|
||||
"caller": "openReschedule"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).cancel_nocaps,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).appointment,
|
||||
"icon": "assets/images/new-design/cancel_icon.png",
|
||||
"caller": "onCancelAppointment"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).raise,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).complaint,
|
||||
"icon": "assets/images/new-design/Complaint_icon.png",
|
||||
"caller": "insertComplaint"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).add,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).reminder,
|
||||
"icon": "assets/images/new-design/reminder_icon.png",
|
||||
"caller": "addReminder"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).hospital,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).location,
|
||||
"icon": "assets/images/new-design/location_icon.png",
|
||||
"caller": "navigateToProject"
|
||||
},
|
||||
{
|
||||
"title": TranslationBase.of(AppGlobal.context).online,
|
||||
"subtitle": TranslationBase.of(AppGlobal.context).payment,
|
||||
"icon": "assets/images/new-design/check-in.png",
|
||||
"caller": "goToTodoList"
|
||||
}
|
||||
];
|
||||
}
|
||||
@ -0,0 +1,430 @@
|
||||
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtons.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtons.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.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/dialogs/confirm_dialog.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class AppointmentActions extends StatefulWidget {
|
||||
AppoitmentAllHistoryResultList appo;
|
||||
TabController tabController;
|
||||
final Function enableFooterButton;
|
||||
|
||||
AppointmentActions({@required this.appo,
|
||||
@required this.tabController,
|
||||
@required this.enableFooterButton});
|
||||
|
||||
@override
|
||||
_AppointmentActionsState createState() => _AppointmentActionsState();
|
||||
}
|
||||
|
||||
class _AppointmentActionsState extends State<AppointmentActions> {
|
||||
List<AppoDetailsButton> appoButtonsList = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_getAppointmentActionButtons();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var size = MediaQuery
|
||||
.of(context)
|
||||
.size;
|
||||
final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2;
|
||||
final double itemWidth = size.width / 2;
|
||||
|
||||
return Container(
|
||||
margin: EdgeInsets.all(5.0),
|
||||
child: CustomScrollView(
|
||||
primary: false,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
slivers: <Widget>[
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
|
||||
sliver: SliverGrid.count(
|
||||
crossAxisCount: 2,
|
||||
childAspectRatio: (itemWidth / itemHeight),
|
||||
children: appoButtonsList
|
||||
.map((e) =>
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_handleButtonClicks(e);
|
||||
},
|
||||
child: Container(
|
||||
height: 100.0,
|
||||
margin: EdgeInsets.all(9.0),
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey[400],
|
||||
blurRadius: 2.0,
|
||||
spreadRadius: 0.0)
|
||||
],
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
|
||||
child: Text(e.title,
|
||||
overflow: TextOverflow.clip,
|
||||
style: TextStyle(
|
||||
color: new Color(0xFFc5272d),
|
||||
letterSpacing: 1.0,
|
||||
fontSize: 20.0)),
|
||||
),
|
||||
Container(
|
||||
margin:
|
||||
EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
|
||||
child: Text(e.subtitle,
|
||||
overflow: TextOverflow.clip,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
letterSpacing: 1.0,
|
||||
fontSize: 15.0)),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.bottomRight,
|
||||
margin:
|
||||
EdgeInsets.fromLTRB(0.0, 10.0, 10.0, 7.0),
|
||||
child: Image.asset(e.icon,
|
||||
width: 45.0, height: 45.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_handleButtonClicks(AppoDetailsButton) {
|
||||
print(AppoDetailsButton.caller);
|
||||
|
||||
switch (AppoDetailsButton.caller) {
|
||||
case "openReschedule":
|
||||
widget.tabController.animateTo((widget.tabController.index + 1) % 2);
|
||||
setState(() {
|
||||
print("Reschedule");
|
||||
widget.enableFooterButton();
|
||||
});
|
||||
break;
|
||||
|
||||
case "onCancelAppointment":
|
||||
ConfirmDialog dialog = new ConfirmDialog(
|
||||
context: context,
|
||||
confirmMessage: TranslationBase
|
||||
.of(context)
|
||||
.cancelAppoMsg,
|
||||
okText: TranslationBase
|
||||
.of(context)
|
||||
.confirm,
|
||||
cancelText: TranslationBase
|
||||
.of(context)
|
||||
.cancel_nocaps,
|
||||
okFunction: () => {cancelAppointment()},
|
||||
cancelFunction: () => {});
|
||||
dialog.showAlertDialog(context);
|
||||
break;
|
||||
|
||||
case "confirmAppointment":
|
||||
confirmAppointment();
|
||||
break;
|
||||
|
||||
case "navigateToProject":
|
||||
openMap(double.parse(widget.appo.latitude),
|
||||
double.parse(widget.appo.longitude));
|
||||
break;
|
||||
|
||||
case "addReminder":
|
||||
showReminderDialog(widget.appo);
|
||||
break;
|
||||
|
||||
case "goToTodoList":
|
||||
Navigator.of(context).pop();
|
||||
break;
|
||||
|
||||
case "askDoc":
|
||||
askYourDoc();
|
||||
break;
|
||||
|
||||
case "radiology":
|
||||
openAppointmentRadiology();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_getAppointmentActionButtons() {
|
||||
if (widget.appo != null) {
|
||||
if (isConfirmed()) {
|
||||
if (widget.appo.isOnlineCheckedIN) {
|
||||
_getConfirmedCheckInAppoActionsList();
|
||||
} else {
|
||||
_getConfirmedAppoActionsList();
|
||||
}
|
||||
} else {
|
||||
print("isConfirmed Null");
|
||||
}
|
||||
if (isBooked()) {
|
||||
if (widget.appo.isOnlineCheckedIN) {
|
||||
_getBookedCheckInAppoActionsList();
|
||||
} else {
|
||||
_getBookedAppoActionsList();
|
||||
}
|
||||
} else {
|
||||
print("isBooked Null");
|
||||
}
|
||||
if (isArrived()) {
|
||||
if (widget.appo.clinicID == 17) {
|
||||
_getArrivedInvoiceAppoActionsList();
|
||||
} else {
|
||||
_getArrivedAppoActionsList();
|
||||
}
|
||||
} else {
|
||||
print("isArrived Null");
|
||||
}
|
||||
} else {
|
||||
print("Appo Null");
|
||||
}
|
||||
}
|
||||
|
||||
bool isConfirmed() {
|
||||
return AppointmentType.isConfirmed(widget.appo);
|
||||
}
|
||||
|
||||
bool isArrived() {
|
||||
return AppointmentType.isArrived(widget.appo);
|
||||
}
|
||||
|
||||
bool isCheckedIn() {
|
||||
return widget.appo.isOnlineCheckedIN;
|
||||
}
|
||||
|
||||
bool isBooked() {
|
||||
return AppointmentType.isBooked(widget.appo);
|
||||
}
|
||||
|
||||
Future<List<AppoDetailsButton>> _getBookedAppoActionsList() async {
|
||||
print("_getBookedAppoActionsList");
|
||||
print(BookedButtons.buttons);
|
||||
List<AppoDetailsButton> buttonsList = [];
|
||||
for (var i = 0; i < BookedButtons.buttons.length; i++) {
|
||||
buttonsList.add(AppoDetailsButton(
|
||||
title: BookedButtons.buttons[i]['title'],
|
||||
subtitle: BookedButtons.buttons[i]['subtitle'],
|
||||
icon: BookedButtons.buttons[i]['icon'],
|
||||
caller: BookedButtons.buttons[i]['caller'],
|
||||
));
|
||||
}
|
||||
setState(() {
|
||||
appoButtonsList = buttonsList;
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<AppoDetailsButton>> _getBookedCheckInAppoActionsList() async {
|
||||
print("_getBookedCheckInAppoActionsList");
|
||||
print(BookedButtonsAllowCheckIn.buttons);
|
||||
List<AppoDetailsButton> buttonsList = [];
|
||||
for (var i = 0; i < BookedButtonsAllowCheckIn.buttons.length; i++) {
|
||||
buttonsList.add(AppoDetailsButton(
|
||||
title: BookedButtonsAllowCheckIn.buttons[i]['title'],
|
||||
subtitle: BookedButtonsAllowCheckIn.buttons[i]['subtitle'],
|
||||
icon: BookedButtonsAllowCheckIn.buttons[i]['icon'],
|
||||
caller: BookedButtonsAllowCheckIn.buttons[i]['caller'],
|
||||
));
|
||||
}
|
||||
setState(() {
|
||||
appoButtonsList = buttonsList;
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<AppoDetailsButton>> _getConfirmedAppoActionsList() async {
|
||||
print("_getConfirmedAppoActionsList");
|
||||
print(ConfirmedButtons.buttons);
|
||||
List<AppoDetailsButton> buttonsList = [];
|
||||
for (var i = 0; i < ConfirmedButtons.buttons.length; i++) {
|
||||
buttonsList.add(AppoDetailsButton(
|
||||
title: ConfirmedButtons.buttons[i]['title'],
|
||||
subtitle: ConfirmedButtons.buttons[i]['subtitle'],
|
||||
icon: ConfirmedButtons.buttons[i]['icon'],
|
||||
caller: ConfirmedButtons.buttons[i]['caller'],
|
||||
));
|
||||
}
|
||||
setState(() {
|
||||
appoButtonsList = buttonsList;
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<AppoDetailsButton>> _getConfirmedCheckInAppoActionsList() async {
|
||||
print("_getConfirmedAllowCheckInAppoActionsList");
|
||||
print(ConfirmedButtonsAllowCheckIn.buttons);
|
||||
List<AppoDetailsButton> buttonsList = [];
|
||||
for (var i = 0; i < ConfirmedButtonsAllowCheckIn.buttons.length; i++) {
|
||||
buttonsList.add(AppoDetailsButton(
|
||||
title: ConfirmedButtonsAllowCheckIn.buttons[i]['title'],
|
||||
subtitle: ConfirmedButtonsAllowCheckIn.buttons[i]['subtitle'],
|
||||
icon: ConfirmedButtonsAllowCheckIn.buttons[i]['icon'],
|
||||
caller: ConfirmedButtonsAllowCheckIn.buttons[i]['caller'],
|
||||
));
|
||||
}
|
||||
setState(() {
|
||||
appoButtonsList = buttonsList;
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<AppoDetailsButton>> _getArrivedAppoActionsList() async {
|
||||
print("_getArrivedAppoActionsList");
|
||||
print(ArrivedButtons.buttons);
|
||||
List<AppoDetailsButton> buttonsList = [];
|
||||
for (var i = 0; i < ArrivedButtons.buttons.length; i++) {
|
||||
buttonsList.add(AppoDetailsButton(
|
||||
title: ArrivedButtons.buttons[i]['title'],
|
||||
subtitle: ArrivedButtons.buttons[i]['subtitle'],
|
||||
icon: ArrivedButtons.buttons[i]['icon'],
|
||||
caller: ArrivedButtons.buttons[i]['caller'],
|
||||
));
|
||||
}
|
||||
setState(() {
|
||||
appoButtonsList = buttonsList;
|
||||
});
|
||||
}
|
||||
|
||||
Future<List<AppoDetailsButton>> _getArrivedInvoiceAppoActionsList() async {
|
||||
print("_getArrivedInvoiceAppoActionsList");
|
||||
print(ArrivedButtons.buttons);
|
||||
List<AppoDetailsButton> buttonsList = [];
|
||||
for (var i = 0; i < ArrivedButtons.buttons.length; i++) {
|
||||
buttonsList.add(AppoDetailsButton(
|
||||
title: ArrivedButtons.buttons[i]['title'],
|
||||
subtitle: ArrivedButtons.buttons[i]['subtitle'],
|
||||
icon: ArrivedButtons.buttons[i]['icon'],
|
||||
caller: ArrivedButtons.buttons[i]['caller'],
|
||||
));
|
||||
}
|
||||
setState(() {
|
||||
appoButtonsList = buttonsList;
|
||||
});
|
||||
}
|
||||
|
||||
cancelAppointment() {
|
||||
ConfirmDialog.closeAlertDialog(context);
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service.cancelAppointment(widget.appo, context).then((res) {
|
||||
print(res);
|
||||
if (res['MessageStatus'] == 1) {
|
||||
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
|
||||
Navigator.of(context).pop();
|
||||
} else {
|
||||
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
openAppointmentRadiology() {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
FinalRadiology finalRadiology = new FinalRadiology();
|
||||
service.getPatientRadOrders(widget.appo.appointmentNo.toString(), context)
|
||||
.then((res) {
|
||||
if (res['MessageStatus'] == 1) {
|
||||
print(res['FinalRadiologyList']);
|
||||
} else {
|
||||
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
static Future<void> openMap(double latitude, double longitude) async {
|
||||
String googleUrl =
|
||||
'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude';
|
||||
if (await canLaunch(googleUrl)) {
|
||||
await launch(googleUrl);
|
||||
} else {
|
||||
throw 'Could not open the map.';
|
||||
}
|
||||
}
|
||||
|
||||
showReminderDialog(AppoitmentAllHistoryResultList appo) {
|
||||
showGeneralDialog(
|
||||
barrierColor: Colors.black.withOpacity(0.5),
|
||||
transitionBuilder: (context, a1, a2, widget) {
|
||||
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
|
||||
return Transform(
|
||||
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
|
||||
child: Opacity(
|
||||
opacity: a1.value,
|
||||
child: ReminderDialog(appo: appo),
|
||||
),
|
||||
);
|
||||
},
|
||||
transitionDuration: Duration(milliseconds: 500),
|
||||
barrierDismissible: true,
|
||||
barrierLabel: '',
|
||||
context: context,
|
||||
pageBuilder: (context, animation1, animation2) {});
|
||||
}
|
||||
|
||||
askYourDoc() {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service
|
||||
.isAllowedToAskDoctor(widget.appo.doctorID, context)
|
||||
.then((res) {
|
||||
print(res['PatientDoctorAppointmentResultList']);
|
||||
if (res['PatientDoctorAppointmentResultList'].length != 0) {
|
||||
|
||||
} else {
|
||||
AppToast.showErrorToast(message: TranslationBase
|
||||
.of(context)
|
||||
.askDocNotAllowed);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
confirmAppointment() {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service
|
||||
.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID,
|
||||
widget.appo.projectID, context)
|
||||
.then((res) {
|
||||
if (res['MessageStatus'] == 1) {
|
||||
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
|
||||
Navigator.of(context).pop();
|
||||
} else {
|
||||
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
loading(bool flag) {
|
||||
setState(() {
|
||||
AppointmentDetails.isLoading = flag;
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,144 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rating_bar/rating_bar.dart';
|
||||
|
||||
import '../AppointmentDetails.dart';
|
||||
|
||||
class AppointmentCard extends StatefulWidget {
|
||||
AppoitmentAllHistoryResultList appo;
|
||||
final Function onReloadAppointmentHistory;
|
||||
|
||||
AppointmentCard(
|
||||
{@required this.appo, @required this.onReloadAppointmentHistory});
|
||||
|
||||
@override
|
||||
_ApointmentCardState createState() => _ApointmentCardState();
|
||||
}
|
||||
|
||||
class _ApointmentCardState extends State<AppointmentCard> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
navigateToAppointmentDetails(context, widget.appo);
|
||||
},
|
||||
child: Card(
|
||||
margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0),
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(),
|
||||
padding: EdgeInsets.all(7.0),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(100.0),
|
||||
child: Image.network(widget.appo.doctorImageURL,
|
||||
fit: BoxFit.fill, height: 60.0, width: 60.0),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.6,
|
||||
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.appo.doctorTitle +
|
||||
" " +
|
||||
widget.appo.doctorNameObj,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
color: Colors.grey[700],
|
||||
letterSpacing: 1.0)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 3.0),
|
||||
child: Text(widget.appo.clinicName,
|
||||
style: TextStyle(
|
||||
fontSize: 12.0,
|
||||
color: Colors.grey[600],
|
||||
letterSpacing: 1.0)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 3.0),
|
||||
child: Text(widget.appo.projectName,
|
||||
style: TextStyle(
|
||||
fontSize: 12.0,
|
||||
color: Colors.grey[600],
|
||||
letterSpacing: 1.0)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
|
||||
child: Text(getDate(widget.appo.appointmentDate).trim(),
|
||||
style: TextStyle(
|
||||
fontSize: 12.0,
|
||||
color: Colors.grey[600],
|
||||
letterSpacing: 1.0)),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
RatingBar.readOnly(
|
||||
initialRating:
|
||||
widget.appo.actualDoctorRate.toDouble(),
|
||||
size: 20.0,
|
||||
filledColor: Colors.yellow[700],
|
||||
emptyColor: Colors.grey[500],
|
||||
isHalfAllowed: true,
|
||||
halfFilledIcon: Icons.star_half,
|
||||
filledIcon: Icons.star,
|
||||
emptyIcon: Icons.star,
|
||||
),
|
||||
Container(
|
||||
transform: Matrix4.translationValues(0.0, -40.0, 0.0),
|
||||
child: Image.asset(
|
||||
"assets/images/new-design/arrow.png",
|
||||
width: 25.0,
|
||||
height: 25.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String getDate(String date) {
|
||||
DateTime dateObj = DateUtil.convertStringToDate(date);
|
||||
return DateUtil.getWeekDay(dateObj.weekday) +
|
||||
", " +
|
||||
dateObj.day.toString() +
|
||||
" " +
|
||||
DateUtil.getMonth(dateObj.month) +
|
||||
" " +
|
||||
dateObj.year.toString();
|
||||
}
|
||||
|
||||
String getDoctorSpeciality(List<String> docSpecial) {
|
||||
String docSpeciality = "";
|
||||
docSpecial.forEach((v) {
|
||||
docSpeciality = docSpeciality + v + "\n";
|
||||
});
|
||||
return docSpeciality;
|
||||
}
|
||||
|
||||
Future navigateToAppointmentDetails(context, appo) async {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => AppointmentDetails(appo: appo)))
|
||||
.then((value) {
|
||||
widget.onReloadAppointmentHistory();
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CustomRadio extends StatefulWidget {
|
||||
@override
|
||||
createState() {
|
||||
return new CustomRadioState();
|
||||
}
|
||||
}
|
||||
|
||||
class CustomRadioState extends State<CustomRadio> {
|
||||
List<RadioModel> sampleData = new List<RadioModel>();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
sampleData.add(new RadioModel(false, "Before 30 Mins", 30));
|
||||
sampleData.add(new RadioModel(false, 'Before 1 Hour', 60));
|
||||
sampleData.add(new RadioModel(false, 'Before 2 Hours', 120));
|
||||
sampleData.add(new RadioModel(false, 'Before 4 Hours', 240));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: sampleData.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return new InkWell(
|
||||
//highlightColor: Colors.red,
|
||||
splashColor: Colors.transparent,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
sampleData.forEach((element) => element.isSelected = false);
|
||||
sampleData[index].isSelected = true;
|
||||
ReminderDialog.selectedDuration =
|
||||
sampleData[index].duration * 60000;
|
||||
});
|
||||
},
|
||||
child: new RadioItem(sampleData[index]),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class RadioItem extends StatelessWidget {
|
||||
final RadioModel _item;
|
||||
|
||||
RadioItem(this._item);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Container(
|
||||
margin: new EdgeInsets.all(15.0),
|
||||
child: new Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
new Container(
|
||||
height: 30.0,
|
||||
width: 30.0,
|
||||
child: new Center(
|
||||
child: Image.asset("assets/images/new-design/check_icon.png",
|
||||
width: 15.0, height: 15.0),
|
||||
),
|
||||
decoration: new BoxDecoration(
|
||||
color: _item.isSelected ? Colors.blue : Colors.transparent,
|
||||
border: new Border.all(
|
||||
width: 1.0,
|
||||
color: _item.isSelected ? Colors.blue : Colors.grey),
|
||||
borderRadius: const BorderRadius.all(const Radius.circular(50.0)),
|
||||
),
|
||||
),
|
||||
new Container(
|
||||
margin: new EdgeInsets.only(left: 15.0),
|
||||
child: new Text(_item.text, style: TextStyle(fontSize: 16.0)),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class RadioModel {
|
||||
bool isSelected;
|
||||
final String text;
|
||||
final int duration;
|
||||
|
||||
RadioModel(this.isSelected, this.text, this.duration);
|
||||
}
|
||||
@ -0,0 +1,134 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/custom_radio.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:manage_calendar_events/manage_calendar_events.dart';
|
||||
|
||||
class ReminderDialog extends StatefulWidget {
|
||||
static var selectedDuration;
|
||||
|
||||
AppoitmentAllHistoryResultList appo;
|
||||
|
||||
ReminderDialog({@required this.appo});
|
||||
|
||||
@override
|
||||
_ReminderDialogState createState() => _ReminderDialogState();
|
||||
}
|
||||
|
||||
class _ReminderDialogState extends State<ReminderDialog> {
|
||||
final CalendarPlugin _myPlugin = CalendarPlugin();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: Dialog(
|
||||
shape:
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.57,
|
||||
width: 450.0,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.all(20.0),
|
||||
child: Text(TranslationBase.of(context).setReminder,
|
||||
style: TextStyle(
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: "Open-Sans-Bold")),
|
||||
),
|
||||
Container(
|
||||
transform: Matrix4.translationValues(0.0, -30.0, 0.0),
|
||||
child: CustomRadio(),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 40.0,
|
||||
margin: EdgeInsets.only(left: 30.0, top: 0.0, right: 30.0),
|
||||
child: RaisedButton(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
side: BorderSide(color: Colors.blue)),
|
||||
color: Colors.blue,
|
||||
onPressed: () {
|
||||
print(ReminderDialog.selectedDuration);
|
||||
createCalendarEvent();
|
||||
},
|
||||
child: Text(TranslationBase.of(context).confirm,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: 'Open-Sans-Bold')),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0),
|
||||
child: OutlineButton(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0)),
|
||||
color: Colors.red,
|
||||
borderSide: BorderSide(color: Colors.red),
|
||||
highlightColor: Colors.red,
|
||||
highlightedBorderColor: Colors.red,
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text(TranslationBase.of(context).cancel_nocaps,
|
||||
style: TextStyle(
|
||||
color: Colors.red,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: 'Open-Sans-Bold')),
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
createCalendarEvent() {
|
||||
_myPlugin.hasPermissions().then((value) {
|
||||
if (!value) {
|
||||
_myPlugin.requestPermissions();
|
||||
} else {
|
||||
_myPlugin.getCalendars().then((value) => {print(value.length)});
|
||||
}
|
||||
});
|
||||
|
||||
CalendarEvent calendarEvent = new CalendarEvent(
|
||||
eventId: widget.appo.appointmentNo.toString(),
|
||||
title: "Doctor Appointment",
|
||||
description: "You have an appointment with " +
|
||||
widget.appo.doctorTitle +
|
||||
" " +
|
||||
widget.appo.doctorNameObj,
|
||||
startDate: DateUtil.convertStringToDate(widget.appo.appointmentDate)
|
||||
.subtract(
|
||||
new Duration(microseconds: ReminderDialog.selectedDuration)),
|
||||
endDate: DateUtil.convertStringToDate(widget.appo.appointmentDate),
|
||||
location: widget.appo.projectName,
|
||||
duration: new Duration(minutes: 15).inMinutes,
|
||||
isAllDay: false,
|
||||
hasAlarm: true);
|
||||
|
||||
_myPlugin
|
||||
.createEvent(calendarId: "207749556", event: calendarEvent)
|
||||
.then((value) {
|
||||
print("Cal event");
|
||||
print(value);
|
||||
if (int.parse(value) == widget.appo.appointmentNo) {
|
||||
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
|
||||
}
|
||||
Navigator.of(context).pop();
|
||||
}).catchError((err) {
|
||||
print("Cal Error");
|
||||
print(err);
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1,31 +1,675 @@
|
||||
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/upcomingCard.dart';
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
|
||||
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
|
||||
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
|
||||
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
||||
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rating_bar/rating_bar.dart';
|
||||
|
||||
class ToDo extends StatefulWidget {
|
||||
PatientShareResponse patientShareResponse;
|
||||
List<AppoitmentAllHistoryResultList> appoList = [];
|
||||
var languageID;
|
||||
MyInAppBrowser browser;
|
||||
|
||||
@override
|
||||
_ToDoState createState() => _ToDoState();
|
||||
}
|
||||
|
||||
class _ToDoState extends State<ToDo> {
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
|
||||
AuthenticatedUser authUser;
|
||||
AuthProvider authProvider = new AuthProvider();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// authUser = authProvider.getAuthenticatedUser();
|
||||
print("initState!!!!!");
|
||||
widget.patientShareResponse = new PatientShareResponse();
|
||||
WidgetsBinding.instance
|
||||
.addPostFrameCallback((_) => getPatientAppointmentHistory());
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(TranslationBase.of(context).todoList),
|
||||
),
|
||||
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 Container(
|
||||
margin: EdgeInsets.all(10.0),
|
||||
child: Card(
|
||||
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0),
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
padding: EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Image.asset(
|
||||
"assets/images/new-design/time_icon.png",
|
||||
width: 20.0,
|
||||
height: 20.0),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 10.0, right: 30.0),
|
||||
child: Text(
|
||||
getDate(
|
||||
widget.appoList[index].appointmentDate),
|
||||
style: TextStyle(fontSize: 12.0)),
|
||||
),
|
||||
Image.asset(
|
||||
"assets/images/new-design/hospital_address_icon.png",
|
||||
width: 20.0,
|
||||
height: 20.0),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 10.0, right: 10.0),
|
||||
child: Text(widget.appoList[index].projectName,
|
||||
style: TextStyle(fontSize: 12.0)),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5.0),
|
||||
child: Divider(
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
),
|
||||
Flex(
|
||||
direction: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
height:
|
||||
MediaQuery.of(context).size.height * 0.1,
|
||||
margin: EdgeInsets.only(top: 5.0),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(100.0),
|
||||
child: Image.network(
|
||||
widget.appoList[index].doctorImageURL,
|
||||
fit: BoxFit.fill),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 20.0, left: 20.0, right: 20.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.appoList[index].doctorTitle +
|
||||
" " +
|
||||
widget
|
||||
.appoList[index].doctorNameObj,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
letterSpacing: 1.0)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 3.0, bottom: 3.0),
|
||||
child: Text(
|
||||
getDoctorSpeciality(widget
|
||||
.appoList[index]
|
||||
.doctorSpeciality)
|
||||
.trim(),
|
||||
style: TextStyle(
|
||||
fontSize: 12.0,
|
||||
color: Colors.grey[600],
|
||||
letterSpacing: 1.0)),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
RatingBar.readOnly(
|
||||
initialRating: widget
|
||||
.appoList[index].actualDoctorRate
|
||||
.toDouble(),
|
||||
size: 20.0,
|
||||
filledColor: Colors.yellow[700],
|
||||
emptyColor: Colors.grey[500],
|
||||
isHalfAllowed: true,
|
||||
halfFilledIcon: Icons.star_half,
|
||||
filledIcon: Icons.star,
|
||||
emptyIcon: Icons.star,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () =>
|
||||
performNextAction(widget.appoList[index]),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 20.0),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Image.asset(
|
||||
getNextActionImage(widget
|
||||
.appoList[index].nextAction),
|
||||
width: 50.0,
|
||||
height: 50.0),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 5.0),
|
||||
child: Text(
|
||||
getNextActionText(widget
|
||||
.appoList[index].nextAction),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 12.0)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
Flex(
|
||||
direction: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Container(
|
||||
child: Text(
|
||||
getNextActionDescription(
|
||||
widget.appoList[index].nextAction),
|
||||
style: TextStyle(
|
||||
fontSize: 12.0,
|
||||
color: Colors.grey[700])),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
navigateToAppointmentDetails(
|
||||
context, widget.appoList[index]);
|
||||
},
|
||||
child: Container(
|
||||
child: Text(
|
||||
TranslationBase.of(context)
|
||||
.upcomingDetails,
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 12.0,
|
||||
color: Colors.red[600],
|
||||
decoration:
|
||||
TextDecoration.underline)),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String getNextActionImage(nextAction) {
|
||||
switch (nextAction) {
|
||||
case 0:
|
||||
return "No Action";
|
||||
break;
|
||||
case 10:
|
||||
return "assets/images/new-design/confirm_button.png";
|
||||
break;
|
||||
|
||||
case 15:
|
||||
return widget.languageID == 'ar'
|
||||
? "assets/images/new-design/pay_online_button_arabic_disabled.png"
|
||||
: "assets/images/new-design/pay_online_button_disabled.png";
|
||||
break;
|
||||
|
||||
case 20:
|
||||
return widget.languageID == 'ar'
|
||||
? "assets/images/new-design/pay_online_button_arabic.png"
|
||||
: "assets/images/new-design/pay_online_button.png";
|
||||
break;
|
||||
|
||||
case 30:
|
||||
return "assets/images/new-design/qr_code_button.png";
|
||||
break;
|
||||
|
||||
case 40:
|
||||
return "assets/images/new-design/video_call_instruction.png";
|
||||
break;
|
||||
|
||||
case 50:
|
||||
return "assets/images/new-design/liveCare_logo_icon.png";
|
||||
break;
|
||||
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
performNextAction(AppoitmentAllHistoryResultList appo) {
|
||||
switch (appo.nextAction) {
|
||||
case 10:
|
||||
confirmAppointment(appo);
|
||||
break;
|
||||
|
||||
case 20:
|
||||
getPatientShare(context, appo);
|
||||
break;
|
||||
|
||||
case 30:
|
||||
getAppoQR(context, appo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
String getNextActionText(nextAction) {
|
||||
switch (nextAction) {
|
||||
case 0:
|
||||
return "No Action";
|
||||
break;
|
||||
case 10:
|
||||
return TranslationBase.of(context).confirm;
|
||||
break;
|
||||
|
||||
case 15:
|
||||
return TranslationBase.of(context).pendingPayment;
|
||||
break;
|
||||
|
||||
case 20:
|
||||
return TranslationBase.of(context).payNow;
|
||||
break;
|
||||
|
||||
case 30:
|
||||
return TranslationBase.of(context).viewQR;
|
||||
break;
|
||||
|
||||
case 40:
|
||||
return TranslationBase.of(context).instruction;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
return TranslationBase.of(context).livecare;
|
||||
break;
|
||||
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
String getNextActionDescription(nextAction) {
|
||||
switch (nextAction) {
|
||||
case 0:
|
||||
return "No Action";
|
||||
break;
|
||||
case 10:
|
||||
return TranslationBase.of(context).upcomingConfirm;
|
||||
break;
|
||||
|
||||
case 15:
|
||||
return TranslationBase.of(context).upcomingPaymentPending;
|
||||
break;
|
||||
|
||||
case 20:
|
||||
return TranslationBase.of(context).upcomingPaymentNow;
|
||||
break;
|
||||
|
||||
case 30:
|
||||
return TranslationBase.of(context).upcomingQR;
|
||||
break;
|
||||
|
||||
case 40:
|
||||
return TranslationBase.of(context).upcomingVirtual;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
return TranslationBase.of(context).upcomingLivecare;
|
||||
break;
|
||||
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
getLanguageID() async {
|
||||
var languageID = await sharedPref.getString(APP_LANGUAGE);
|
||||
setState(() {
|
||||
widget.languageID = languageID;
|
||||
});
|
||||
}
|
||||
|
||||
String getDate(String date) {
|
||||
DateTime dateObj = DateUtil.convertStringToDate(date);
|
||||
return DateUtil.getWeekDay(dateObj.weekday) +
|
||||
", " +
|
||||
dateObj.day.toString() +
|
||||
" " +
|
||||
DateUtil.getMonth(dateObj.month) +
|
||||
" " +
|
||||
dateObj.year.toString() +
|
||||
" " +
|
||||
dateObj.hour.toString() +
|
||||
":" +
|
||||
getMinute(dateObj);
|
||||
}
|
||||
|
||||
String getMinute(DateTime dateObj) {
|
||||
if (dateObj.minute == 0) {
|
||||
return dateObj.minute.toString() + "0";
|
||||
} else {
|
||||
return dateObj.minute.toString();
|
||||
}
|
||||
}
|
||||
|
||||
String getDoctorSpeciality(List<String> docSpecial) {
|
||||
String docSpeciality = "";
|
||||
docSpecial.forEach((v) {
|
||||
docSpeciality = docSpeciality + v + "\n";
|
||||
});
|
||||
return docSpeciality;
|
||||
}
|
||||
|
||||
Future navigateToAppointmentDetails(context, appo) async {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => AppointmentDetails(appo: appo)))
|
||||
.then((value) {
|
||||
getPatientAppointmentHistory();
|
||||
});
|
||||
}
|
||||
|
||||
getPatientAppointmentHistory() {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service.getPatientAppointmentHistory(true, context).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 {}
|
||||
});
|
||||
} else {
|
||||
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
getPatientShare(context, AppoitmentAllHistoryResultList appo) {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service
|
||||
.getPatientShare(appo.appointmentNo.toString(), appo.clinicID,
|
||||
appo.projectID, context)
|
||||
.then((res) {
|
||||
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
|
||||
openPaymentDialog(appo, widget.patientShareResponse);
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
getAppoQR(context, AppoitmentAllHistoryResultList appo) {
|
||||
PatientShareResponse patientShareResponse = new PatientShareResponse();
|
||||
|
||||
patientShareResponse.doctorNameObj = appo.doctorNameObj;
|
||||
patientShareResponse.doctorSpeciality = appo.doctorSpeciality;
|
||||
patientShareResponse.projectName = appo.projectName;
|
||||
patientShareResponse.appointmentDate = appo.appointmentDate;
|
||||
patientShareResponse.appointmentNo = appo.appointmentNo;
|
||||
patientShareResponse.clinicID = appo.clinicID;
|
||||
patientShareResponse.projectID = appo.projectID;
|
||||
patientShareResponse.isFollowup = appo.isFollowup;
|
||||
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service.generateAppointmentQR(patientShareResponse, context).then((res) {
|
||||
print(res);
|
||||
navigateToQR(context, res['AppointmentQR'], patientShareResponse);
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
Future navigateToQR(
|
||||
context, String appoQR, PatientShareResponse patientShareResponse) async {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => QRCode(
|
||||
patientShareResponse: patientShareResponse,
|
||||
appoQR: appoQR,
|
||||
))).then((value) {
|
||||
getPatientAppointmentHistory();
|
||||
});
|
||||
}
|
||||
|
||||
openPaymentDialog(AppoitmentAllHistoryResultList appo,
|
||||
PatientShareResponse patientShareResponse) {
|
||||
showGeneralDialog(
|
||||
barrierColor: Colors.black.withOpacity(0.5),
|
||||
transitionBuilder: (context, a1, a2, widget) {
|
||||
final curvedValue =
|
||||
Curves.easeInOutBack.transform(a1.value) - 1.0;
|
||||
return Transform(
|
||||
transform:
|
||||
Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
|
||||
child: Opacity(
|
||||
opacity: a1.value,
|
||||
child: PaymentDialog(
|
||||
appo: appo, patientShareResponse: patientShareResponse),
|
||||
),
|
||||
);
|
||||
},
|
||||
transitionDuration: Duration(milliseconds: 500),
|
||||
barrierDismissible: false,
|
||||
barrierLabel: '',
|
||||
context: context,
|
||||
pageBuilder: (context, animation1, animation2) {})
|
||||
.then((value) {
|
||||
print(value);
|
||||
|
||||
if (value != null) {
|
||||
navigateToPaymentMethod(context, value, appo);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
openPayment(
|
||||
String paymentMethod,
|
||||
AuthenticatedUser authenticatedUser,
|
||||
double amount,
|
||||
PatientShareResponse patientShareResponse,
|
||||
AppoitmentAllHistoryResultList appo) {
|
||||
widget.browser = new MyInAppBrowser(
|
||||
onExitCallback: onBrowserExit,
|
||||
appo: appo,
|
||||
onLoadStartCallback: onBrowserLoadStart);
|
||||
|
||||
widget.browser.openPaymentBrowser(
|
||||
amount,
|
||||
"Appointment check in",
|
||||
Utils.getAppointmentTransID(
|
||||
appo.projectID, appo.clinicID, appo.appointmentNo),
|
||||
appo.projectID.toString(),
|
||||
authenticatedUser.emailAddress,
|
||||
paymentMethod,
|
||||
authenticatedUser,
|
||||
widget.browser);
|
||||
}
|
||||
|
||||
onBrowserLoadStart(String url) {
|
||||
print("onBrowserLoadStart");
|
||||
print(url);
|
||||
|
||||
MyInAppBrowser.successURLS.forEach((element) {
|
||||
if (url.contains(element)) {
|
||||
if (widget.browser.isOpened()) widget.browser.close();
|
||||
MyInAppBrowser.isPaymentDone = true;
|
||||
Utils.hideProgressDialog();
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
MyInAppBrowser.errorURLS.forEach((element) {
|
||||
if (url.contains(element)) {
|
||||
if (widget.browser.isOpened()) widget.browser.close();
|
||||
MyInAppBrowser.isPaymentDone = false;
|
||||
Utils.hideProgressDialog();
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
|
||||
print("onBrowserExit Called!!!!");
|
||||
if (isPaymentMade) checkPaymentStatus(appo);
|
||||
}
|
||||
|
||||
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service
|
||||
.checkPaymentStatus(
|
||||
Utils.getAppointmentTransID(
|
||||
appo.projectID, appo.clinicID, appo.appointmentNo),
|
||||
context)
|
||||
.then((res) {
|
||||
print("Printing Payment Status Reponse!!!!");
|
||||
print(res);
|
||||
String paymentInfo = res['Response_Message'];
|
||||
if (paymentInfo == 'Success') {
|
||||
createAdvancePayment(res, appo);
|
||||
} else {
|
||||
AppToast.showErrorToast(message: res['Response_Message']);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
String paymentReference = res['Fort_id'].toString();
|
||||
service
|
||||
.createAdvancePayment(
|
||||
appo, res['Amount'], res['Fort_id'], res['PaymentMethod'], context)
|
||||
.then((res) {
|
||||
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
|
||||
addAdvancedNumberRequest(
|
||||
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
|
||||
paymentReference,
|
||||
appo.appointmentNo.toString(),
|
||||
appo);
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
addAdvancedNumberRequest(String advanceNumber, String paymentReference,
|
||||
String appointmentID, AppoitmentAllHistoryResultList appo) {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service
|
||||
.addAdvancedNumberRequest(
|
||||
advanceNumber, paymentReference, appointmentID, context)
|
||||
.then((res) {
|
||||
print(res);
|
||||
getAppoQR(context, appo);
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
|
||||
Future navigateToPaymentMethod(
|
||||
context,
|
||||
PatientShareResponse patientShareResponse,
|
||||
AppoitmentAllHistoryResultList appo) async {
|
||||
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
|
||||
var data = AuthenticatedUser.fromJson(
|
||||
await this.sharedPref.getObject(USER_PROFILE));
|
||||
setState(() {
|
||||
authUser = data;
|
||||
});
|
||||
}
|
||||
|
||||
Navigator.push(
|
||||
context, MaterialPageRoute(builder: (context) => PaymentMethod()))
|
||||
.then((value) {
|
||||
print(value);
|
||||
getPatientAppointmentHistory();
|
||||
|
||||
if (value != null) {
|
||||
openPayment(
|
||||
value,
|
||||
authUser,
|
||||
double.parse(patientShareResponse.patientShareWithTax.toString()),
|
||||
patientShareResponse,
|
||||
appo);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
confirmAppointment(AppoitmentAllHistoryResultList appo) {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
service
|
||||
.confirmAppointment(
|
||||
appo.appointmentNo, appo.clinicID, appo.projectID, context)
|
||||
.then((res) {
|
||||
if (res['MessageStatus'] == 1) {
|
||||
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
|
||||
getPatientAppointmentHistory();
|
||||
} else {
|
||||
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
||||
}
|
||||
}).catchError((err) {
|
||||
print(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,239 @@
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PaymentMethod extends StatefulWidget {
|
||||
@override
|
||||
_PaymentMethodState createState() => _PaymentMethodState();
|
||||
}
|
||||
|
||||
class _PaymentMethodState extends State<PaymentMethod> {
|
||||
String selectedPaymentMethod = "MADA";
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).paymentMethod,
|
||||
isShowAppBar: true,
|
||||
body: Container(
|
||||
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 0.0),
|
||||
alignment: Alignment.center,
|
||||
child: Text("Select Payment Method",
|
||||
style: TextStyle(
|
||||
fontSize: 26.0, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 25.0),
|
||||
child: Flex(
|
||||
direction: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
updateSelectedPaymentMethod("MADA");
|
||||
},
|
||||
child: Card(
|
||||
elevation: 3.0,
|
||||
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
side: selectedPaymentMethod == "MADA"
|
||||
? BorderSide(
|
||||
color: Colors.green, width: 5.0)
|
||||
: BorderSide(
|
||||
color: Colors.transparent, width: 0.0),
|
||||
),
|
||||
child: Container(
|
||||
height: 120.0,
|
||||
padding: EdgeInsets.all(7.0),
|
||||
width: MediaQuery.of(context).size.width * 0.45,
|
||||
child: Image.asset(
|
||||
"assets/images/new-design/mada.png"),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
updateSelectedPaymentMethod("SADAD");
|
||||
},
|
||||
child: Card(
|
||||
elevation: 3.0,
|
||||
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
side: selectedPaymentMethod == "SADAD"
|
||||
? BorderSide(
|
||||
color: Colors.green, width: 5.0)
|
||||
: BorderSide(
|
||||
color: Colors.transparent, width: 0.0),
|
||||
),
|
||||
child: Container(
|
||||
height: 120.0,
|
||||
padding: EdgeInsets.all(7.0),
|
||||
width: MediaQuery.of(context).size.width * 0.45,
|
||||
child: Image.asset(
|
||||
"assets/images/new-design/sadad.png"),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 25.0),
|
||||
child: Flex(
|
||||
direction: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
updateSelectedPaymentMethod("VISA");
|
||||
},
|
||||
child: Card(
|
||||
elevation: 3.0,
|
||||
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
side: selectedPaymentMethod == "VISA"
|
||||
? BorderSide(
|
||||
color: Colors.green, width: 5.0)
|
||||
: BorderSide(
|
||||
color: Colors.transparent, width: 0.0),
|
||||
),
|
||||
child: Container(
|
||||
height: 120.0,
|
||||
padding: EdgeInsets.all(7.0),
|
||||
width: MediaQuery.of(context).size.width * 0.45,
|
||||
child: Image.asset(
|
||||
"assets/images/new-design/visa.png"),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
updateSelectedPaymentMethod("MASTERCARD");
|
||||
},
|
||||
child: Card(
|
||||
elevation: 3.0,
|
||||
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
side: selectedPaymentMethod == "MASTERCARD"
|
||||
? BorderSide(
|
||||
color: Colors.green, width: 5.0)
|
||||
: BorderSide(
|
||||
color: Colors.transparent, width: 0.0),
|
||||
),
|
||||
child: Container(
|
||||
height: 120.0,
|
||||
padding: EdgeInsets.all(7.0),
|
||||
width: MediaQuery.of(context).size.width * 0.45,
|
||||
child: Image.asset(
|
||||
"assets/images/new-design/mastercard.png"),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 25.0),
|
||||
child: Flex(
|
||||
direction: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
updateSelectedPaymentMethod("Installment");
|
||||
},
|
||||
child: Card(
|
||||
elevation: 3.0,
|
||||
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
side: selectedPaymentMethod == "Installment"
|
||||
? BorderSide(
|
||||
color: Colors.green, width: 5.0)
|
||||
: BorderSide(
|
||||
color: Colors.transparent, width: 0.0),
|
||||
),
|
||||
child: Container(
|
||||
height: 120.0,
|
||||
padding: EdgeInsets.all(7.0),
|
||||
width: MediaQuery.of(context).size.width * 0.45,
|
||||
child: Image.asset(
|
||||
"assets/images/new-design/installment.png"),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
bottomSheet: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 50.0,
|
||||
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0),
|
||||
child: ButtonTheme(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
minWidth: MediaQuery.of(context).size.width * 0.7,
|
||||
height: 45.0,
|
||||
child: RaisedButton(
|
||||
color: new Color(0xFF60686b),
|
||||
textColor: Colors.white,
|
||||
disabledTextColor: Colors.white,
|
||||
disabledColor: new Color(0xFFbcc2c4),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, selectedPaymentMethod);
|
||||
},
|
||||
child: Text(TranslationBase.of(context).confirm,
|
||||
style: TextStyle(fontSize: 18.0)),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
updateSelectedPaymentMethod(String selectedMethod) {
|
||||
setState(() {
|
||||
selectedPaymentMethod = selectedMethod;
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,227 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PaymentDialog extends StatefulWidget {
|
||||
AppoitmentAllHistoryResultList appo;
|
||||
PatientShareResponse patientShareResponse;
|
||||
|
||||
final Function onPaymentMethodSelected;
|
||||
|
||||
PaymentDialog({@required this.appo, @required this.onPaymentMethodSelected, this.patientShareResponse});
|
||||
|
||||
@override
|
||||
_PaymentDialogState createState() => _PaymentDialogState();
|
||||
}
|
||||
|
||||
class _PaymentDialogState extends State<PaymentDialog> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: Dialog(
|
||||
shape:
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.67,
|
||||
width: 450.0,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0),
|
||||
child: Text("Invoice Detail",
|
||||
style: TextStyle(
|
||||
fontSize: 25.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: "Open-Sans-Bold")),
|
||||
),
|
||||
Divider(
|
||||
color: Colors.grey,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0),
|
||||
child: Text("Appointment Details",
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: "Open-Sans-Bold")),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0),
|
||||
child: Text(
|
||||
widget.appo.doctorTitle + " " + widget.appo.doctorNameObj,
|
||||
style: TextStyle(
|
||||
color: Colors.grey[700],
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: "Open-Sans-Bold")),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0),
|
||||
child: Text(getDate(widget.appo.appointmentDate),
|
||||
style: getTextStyle()),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0),
|
||||
child: Text(widget.appo.projectName, style: getTextStyle()),
|
||||
),
|
||||
Divider(
|
||||
color: Colors.grey,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0),
|
||||
child: Table(
|
||||
children: [
|
||||
TableRow(children: [
|
||||
TableCell(
|
||||
child: _getNormalText(
|
||||
TranslationBase.of(context).patientShareToDo)),
|
||||
TableCell(
|
||||
child: _getNormalText(widget
|
||||
.patientShareResponse.patientShare
|
||||
.toString())),
|
||||
]),
|
||||
TableRow(children: [
|
||||
TableCell(
|
||||
child: _getNormalText(
|
||||
TranslationBase.of(context).patientTaxToDo)),
|
||||
TableCell(
|
||||
child: _getNormalText(widget
|
||||
.patientShareResponse.patientTaxAmount
|
||||
.toString())),
|
||||
]),
|
||||
TableRow(children: [
|
||||
TableCell(
|
||||
child: _getNormalText(TranslationBase.of(context)
|
||||
.patientShareTotalToDo)),
|
||||
TableCell(
|
||||
child: _getNormalText(widget
|
||||
.patientShareResponse.patientShareWithTax
|
||||
.toString())),
|
||||
]),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0),
|
||||
child: Text("You can pay by following options: ",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: "Open-Sans")),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0),
|
||||
child: Image.asset(
|
||||
"assets/images/new-design/payment_options_invoice_confirmation.png",
|
||||
width: 300),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 15.0),
|
||||
child: Text(
|
||||
"Are You Sure You Want To Make payment for this Appointment?",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
color: Colors.red[700],
|
||||
fontFamily: "Open-Sans")),
|
||||
),
|
||||
Divider(
|
||||
color: Colors.grey,
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
height: 40.0,
|
||||
child: Flex(
|
||||
direction: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context, null);
|
||||
},
|
||||
child: Container(
|
||||
child: Text("Cancel",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0, color: Colors.red[700])),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context, widget.patientShareResponse);
|
||||
// widget.onPaymentMethodSelected();
|
||||
},
|
||||
child: Container(
|
||||
child: Text("Ok",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_getNormalText(text) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 10.0, right: 10.0),
|
||||
child: Text(text,
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontFamily: 'Open-Sans',
|
||||
letterSpacing: 0.5,
|
||||
color: Colors.grey[700])),
|
||||
);
|
||||
}
|
||||
|
||||
TextStyle getTextStyle() {
|
||||
return TextStyle(
|
||||
color: Colors.grey[700], fontSize: 15.0, fontFamily: "Open-Sans-Bold");
|
||||
}
|
||||
|
||||
// Future navigateToPaymentMethod(context) async {
|
||||
// Navigator.push(
|
||||
// context, MaterialPageRoute(builder: (context) => PaymentMethod()));
|
||||
// }
|
||||
|
||||
String getDate(String date) {
|
||||
DateTime dateObj = DateUtil.convertStringToDate(date);
|
||||
return DateUtil.getWeekDay(dateObj.weekday) +
|
||||
", " +
|
||||
dateObj.day.toString() +
|
||||
" " +
|
||||
DateUtil.getMonth(dateObj.month) +
|
||||
" " +
|
||||
dateObj.year.toString() +
|
||||
" " +
|
||||
dateObj.hour.toString() +
|
||||
":" +
|
||||
getMinute(dateObj);
|
||||
}
|
||||
|
||||
String getMinute(DateTime dateObj) {
|
||||
if (dateObj.minute == 0) {
|
||||
return dateObj.minute.toString() + "0";
|
||||
} else {
|
||||
return dateObj.minute.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ConfirmDialog {
|
||||
final BuildContext context;
|
||||
|
||||
final confirmMessage;
|
||||
final okText;
|
||||
final cancelText;
|
||||
final Function okFunction;
|
||||
final Function cancelFunction;
|
||||
|
||||
ConfirmDialog(
|
||||
{@required this.context,
|
||||
@required this.confirmMessage,
|
||||
@required this.okText,
|
||||
@required this.cancelText,
|
||||
@required this.okFunction,
|
||||
@required this.cancelFunction});
|
||||
|
||||
showAlertDialog(BuildContext context) {
|
||||
// set up the buttons
|
||||
Widget cancelButton = FlatButton(
|
||||
child: Text(this.cancelText),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
Widget continueButton =
|
||||
FlatButton(child: Text(this.okText), onPressed: this.okFunction);
|
||||
|
||||
// set up the AlertDialog
|
||||
AlertDialog alert = AlertDialog(
|
||||
title: Text(TranslationBase.of(context).confirm),
|
||||
content: Text(this.confirmMessage),
|
||||
actions: [
|
||||
cancelButton,
|
||||
continueButton,
|
||||
],
|
||||
);
|
||||
|
||||
// show the dialog
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return alert;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
static closeAlertDialog(BuildContext context) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,270 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||
|
||||
class MyInAppBrowser extends InAppBrowser {
|
||||
// static String SERVICE_URL =
|
||||
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
|
||||
// ignore: non_constant_identifier_names
|
||||
|
||||
static String SERVICE_URL =
|
||||
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
|
||||
|
||||
// static String PREAUTH_SERVICE_URL =
|
||||
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
|
||||
|
||||
static String PREAUTH_SERVICE_URL =
|
||||
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
|
||||
|
||||
static List<String> successURLS = [
|
||||
'success',
|
||||
'PayFortResponse',
|
||||
'PayFortSucess'
|
||||
];
|
||||
|
||||
static List<String> errorURLS = ['PayfortCancel'];
|
||||
|
||||
final Function onExitCallback;
|
||||
final Function onLoadStartCallback;
|
||||
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
AuthProvider authProvider = new AuthProvider();
|
||||
InAppBrowser browser = new InAppBrowser();
|
||||
|
||||
AuthenticatedUser authUser;
|
||||
AppoitmentAllHistoryResultList appo;
|
||||
|
||||
static bool isPaymentDone = false;
|
||||
|
||||
MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback});
|
||||
|
||||
Future onBrowserCreated() async {
|
||||
print("\n\nBrowser Created!\n\n");
|
||||
}
|
||||
|
||||
@override
|
||||
Future onLoadStart(String url) async {
|
||||
onLoadStartCallback(url);
|
||||
// print("\n\nStarted $url\n\n");
|
||||
|
||||
// if (successURLS.length != 0) {
|
||||
// successURLS.forEach((element) {
|
||||
// if (url.contains(element)) {
|
||||
// try {
|
||||
// if (browser.isOpened()) browser.close();
|
||||
// isPaymentDone = true;
|
||||
// Utils.hideProgressDialog();
|
||||
// return;
|
||||
// } on MissingPluginException catch (exception) {
|
||||
// Utils.hideProgressDialog();
|
||||
// } catch (error) {
|
||||
// Utils.hideProgressDialog();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// if (errorURLS.length != 0) {
|
||||
// errorURLS.forEach((element) {
|
||||
// if (url.contains(element)) {
|
||||
// try {
|
||||
// if (browser.isOpened()) browser.close();
|
||||
// isPaymentDone = false;
|
||||
// Utils.hideProgressDialog();
|
||||
// return;
|
||||
// } on MissingPluginException catch (exception) {
|
||||
// Utils.hideProgressDialog();
|
||||
// } catch (error) {
|
||||
// Utils.hideProgressDialog();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
@override
|
||||
Future onLoadStop(String url) async {
|
||||
print("\n\nStopped $url\n\n");
|
||||
}
|
||||
|
||||
@override
|
||||
void onLoadError(String url, int code, String message) {
|
||||
print("Can't load $url.. Error: $message");
|
||||
}
|
||||
|
||||
@override
|
||||
void onProgressChanged(int progress) {
|
||||
print("Progress: $progress");
|
||||
}
|
||||
|
||||
@override
|
||||
void onExit() {
|
||||
print("\n\nBrowser closed!\n\n");
|
||||
onExitCallback(appo, isPaymentDone);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ShouldOverrideUrlLoadingAction> shouldOverrideUrlLoading(
|
||||
ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async {
|
||||
print("\n\n override ${shouldOverrideUrlLoadingRequest.url}\n\n");
|
||||
return ShouldOverrideUrlLoadingAction.ALLOW;
|
||||
}
|
||||
|
||||
getLanguageID() async {
|
||||
return await sharedPref.getString(APP_LANGUAGE);
|
||||
}
|
||||
|
||||
Future<String> getDeviceToken() async {
|
||||
String deviceToken = await sharedPref.getString(PUSH_TOKEN);
|
||||
return deviceToken;
|
||||
}
|
||||
|
||||
getPatientData() async {
|
||||
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
|
||||
var data = AuthenticatedUser.fromJson(
|
||||
await this.sharedPref.getObject(USER_PROFILE));
|
||||
authUser = data;
|
||||
}
|
||||
}
|
||||
|
||||
openPaymentBrowser(
|
||||
double amount,
|
||||
String orderDesc,
|
||||
String transactionID,
|
||||
String projId,
|
||||
String emailId,
|
||||
String paymentMethod,
|
||||
AuthenticatedUser authenticatedUser,
|
||||
InAppBrowser browser,
|
||||
) {
|
||||
this.browser = browser;
|
||||
this.browser.openUrl(
|
||||
url: generateURL(amount, orderDesc, transactionID, projId, emailId,
|
||||
paymentMethod, authenticatedUser));
|
||||
|
||||
// this.browser.openData(
|
||||
// data: generateURL(amount, orderDesc, transactionID, projId, emailId,
|
||||
// paymentMethod, authenticatedUser),
|
||||
// baseUrl:
|
||||
// "https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx");
|
||||
}
|
||||
|
||||
String generateURL(
|
||||
double amount,
|
||||
String orderDesc,
|
||||
String transactionID,
|
||||
String projId,
|
||||
String emailId,
|
||||
String paymentMethod,
|
||||
AuthenticatedUser authUser,
|
||||
[var patientData,
|
||||
var servID,
|
||||
var LiveServID]) {
|
||||
getPatientData();
|
||||
String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN';
|
||||
String form = getForm();
|
||||
String deviceToken;
|
||||
|
||||
getDeviceToken().then((value) {
|
||||
print(value);
|
||||
deviceToken = value;
|
||||
});
|
||||
|
||||
if (authUser != null) {
|
||||
form = form.replaceFirst("EMAIL_VALUE", authUser.emailAddress);
|
||||
} else {
|
||||
form = form.replaceFirst("EMAIL_VALUE", emailId);
|
||||
}
|
||||
|
||||
form = form.replaceFirst('AMOUNT_VALUE', amount.toString());
|
||||
form = form.replaceFirst('ORDER_DESCRIPTION_VALUE', orderDesc);
|
||||
form = form.replaceFirst('ORDER_ID_VALUE', transactionID);
|
||||
form = form.replaceFirst('REQUEST_ID_VALUE', transactionID);
|
||||
form = form.replaceFirst('PROJECT_ID_VALUE', projId);
|
||||
form = form.replaceFirst('PAYMENT_OPTION_VALUE', paymentMethod);
|
||||
form = form.replaceFirst('LANG_VALUE', currentLanguageID);
|
||||
form = form.replaceFirst('PATIENT_OUT_SA',
|
||||
authUser.outSA == 0 ? false.toString() : true.toString());
|
||||
form = form.replaceFirst(
|
||||
'PATIENT_TYPE_ID',
|
||||
patientData == null
|
||||
? authUser.patientType.toString()
|
||||
: patientData.PatientType);
|
||||
|
||||
// form = form.replaceFirst('DEVICE_TOKEN', this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false) + "," + this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false));
|
||||
// form = form.replaceFirst('LATITUDE_VALUE', this.cs.sharedService.getSharedData('userLat', false));
|
||||
// form = form.replaceFirst('LONGITUDE_VALUE', this.cs.sharedService.getSharedData('userLong', false));
|
||||
|
||||
form = form.replaceFirst('LATITUDE_VALUE', "24.708488");
|
||||
form = form.replaceFirst('LONGITUDE_VALUE', "46.665925");
|
||||
form = form.replaceFirst('DEVICE_TOKEN',
|
||||
"e8wKxa4EGK8:APA91bGtygxh5E22pSARVKlngyi0iQbyRUvvUWiCIsaAcbE0hiffhUR094WVx22O5bsvwc706LspzIuJthUyK_748jzuaedD-ZwDm9BX_yyYV2K2YnuFBlHQ9pOKy65RfoprtvqyTN1O");
|
||||
|
||||
if (servID == "4")
|
||||
form = form.replaceFirst(
|
||||
'SERVICE_URL_VALUE', MyInAppBrowser.PREAUTH_SERVICE_URL);
|
||||
else
|
||||
form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.SERVICE_URL);
|
||||
|
||||
if (servID != null) {
|
||||
form = form.replaceFirst('SERV_ID', servID);
|
||||
form = form.replaceFirst('LIVE_SERVICE_ID', LiveServID);
|
||||
} else {
|
||||
form = form.replaceFirst('SERV_ID', "2");
|
||||
form = form.replaceFirst('LIVE_SERVICE_ID', "2");
|
||||
}
|
||||
|
||||
if (patientData == null) {
|
||||
form = form.replaceFirst('CUSTNAME_VALUE', authUser.firstName);
|
||||
form = form.replaceFirst('CUSTID_VALUE', authUser.patientID.toString());
|
||||
} else {
|
||||
form = form.replaceFirst('CUSTNAME_VALUE', patientData.FirstName);
|
||||
form = form.replaceFirst('CUSTID_VALUE', patientData.PatientID);
|
||||
}
|
||||
|
||||
var bytes = utf8.encode(form);
|
||||
var base64Str = base64.encode(bytes);
|
||||
print(form);
|
||||
print('data:text/html;base64,' + base64Str);
|
||||
return 'data:text/html;base64,' + base64Str;
|
||||
}
|
||||
|
||||
String getForm() {
|
||||
return '<html> ' +
|
||||
'<head></head>' +
|
||||
'<body>' +
|
||||
'<form id="paymentForm" action="SERVICE_URL_VALUE" method="post">' +
|
||||
'<input type="hidden" name="Amount" value="AMOUNT_VALUE">' +
|
||||
'<input type="hidden" name="ProjID" value="PROJECT_ID_VALUE">' +
|
||||
'<input type="hidden" name="Order_Desc" value="ORDER_DESCRIPTION_VALUE">' +
|
||||
'<input type="hidden" name="OrderID" value="ORDER_ID_VALUE">' +
|
||||
// '<input type="hidden" name="reqID" value="REQUEST_ID_VALUE">' +
|
||||
'<input type="hidden" name="PaymentOption" value="PAYMENT_OPTION_VALUE">' +
|
||||
'<input type="hidden" name="Email" value="EMAIL_VALUE">' +
|
||||
'<input type="hidden" name="ServID" value="SERV_ID" >' +
|
||||
'<input type="hidden" name="ChannelID" value="2" >' +
|
||||
'<input type="hidden" name="Lang" value="LANG_VALUE" >' +
|
||||
'<input type="hidden" name="ReturnURL" value="" >' +
|
||||
'<input type="hidden" name="CustName" value="CUSTNAME_VALUE" >' +
|
||||
'<input type="hidden" name="PatientOutSA" value="PATIENT_OUT_SA" >' +
|
||||
'<input type="hidden" name="PatientTypeID" value="PATIENT_TYPE_ID" >' +
|
||||
'<input type="hidden" name="DeviceToken" value="DEVICE_TOKEN" >' +
|
||||
'<input type="hidden" name="Longitude" value="LONGITUDE_VALUE" >' +
|
||||
'<input type="hidden" name="Latitude" value="LATITUDE_VALUE" >' +
|
||||
'<input type="hidden" name="Live_ServiceID" value="LIVE_SERVICE_ID" >' +
|
||||
'<input type="hidden" name="CustID" value="CUSTID_VALUE" >' +
|
||||
'<input type="hidden" name="ResponseContinueURL" value="http://hmg.com/Documents/success.html" >' +
|
||||
'<input type="hidden" name="BackClickUrl" value="http://hmg.com/Documents/success.html" >' +
|
||||
'</form>' +
|
||||
'<script type="text/javascript"> document.getElementById("paymentForm").submit(); </script>' +
|
||||
'</body>' +
|
||||
'</html>';
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.2 KiB |