Merge branch 'Haroon' into 'master'

Haroon

See merge request Cloud_Solution/diplomatic-quarter!20
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit 5a17411961

@ -60,4 +60,8 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

@ -39,6 +39,6 @@
"title": "online",
"subtitle": "payment",
"icon": "assets/images/new-design/check-in.png",
"caller": "goToTodoList(31)"
"caller": "goToTodoList"
}
]

File diff suppressed because it is too large Load Diff

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

@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
5A016D0DD1095D385566337C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC606583E610E227F8186476 /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@ -29,6 +30,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
09DDD2020D673759BD0E86B8 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
@ -42,6 +44,9 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A8949DBAE70E5B302D91F1DB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
AC606583E610E227F8186476 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E2D9C922B5D0172FE487333D /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -49,12 +54,32 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5A016D0DD1095D385566337C /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
0A1F078D9C068A8B18DE1EDB /* Pods */ = {
isa = PBXGroup;
children = (
A8949DBAE70E5B302D91F1DB /* Pods-Runner.debug.xcconfig */,
E2D9C922B5D0172FE487333D /* Pods-Runner.release.xcconfig */,
09DDD2020D673759BD0E86B8 /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
44EDA189DE1BB86E3A41BD4A /* Frameworks */ = {
isa = PBXGroup;
children = (
AC606583E610E227F8186476 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
@ -72,6 +97,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
0A1F078D9C068A8B18DE1EDB /* Pods */,
44EDA189DE1BB86E3A41BD4A /* Frameworks */,
);
sourceTree = "<group>";
};
@ -113,12 +140,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
B4860726BBF5BF6213BBC91C /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
72E9699567A7106FD141B9B3 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@ -191,6 +220,70 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
72E9699567A7106FD141B9B3 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
"${BUILT_PRODUCTS_DIR}/MTBBarcodeScanner/MTBBarcodeScanner.framework",
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
"${BUILT_PRODUCTS_DIR}/Protobuf/protobuf.framework",
"${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/SwiftProtobuf/SwiftProtobuf.framework",
"${BUILT_PRODUCTS_DIR}/TOCropViewController/TOCropViewController.framework",
"${BUILT_PRODUCTS_DIR}/barcode_scan/barcode_scan.framework",
"${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework",
"${BUILT_PRODUCTS_DIR}/device_info/device_info.framework",
"${BUILT_PRODUCTS_DIR}/flutter_flexible_toast/flutter_flexible_toast.framework",
"${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework",
"${BUILT_PRODUCTS_DIR}/flutter_local_notifications/flutter_local_notifications.framework",
"${BUILT_PRODUCTS_DIR}/flutter_plugin_android_lifecycle/flutter_plugin_android_lifecycle.framework",
"${BUILT_PRODUCTS_DIR}/hexcolor/hexcolor.framework",
"${BUILT_PRODUCTS_DIR}/image_cropper/image_cropper.framework",
"${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework",
"${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework",
"${BUILT_PRODUCTS_DIR}/manage_calendar_events/manage_calendar_events.framework",
"${BUILT_PRODUCTS_DIR}/map_launcher/map_launcher.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
"${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework",
"${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MTBBarcodeScanner.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/protobuf.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftProtobuf.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TOCropViewController.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/barcode_scan.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_flexible_toast.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_local_notifications.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_plugin_android_lifecycle.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hexcolor.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_cropper.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/manage_calendar_events.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/map_launcher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@ -205,6 +298,28 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
B4860726BBF5BF6213BBC91C /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */

@ -4,4 +4,7 @@
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

@ -1,6 +1,7 @@
import 'dart:io';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'dart:io';
const MAX_SMALL_SCREEN = 660;
@ -38,14 +39,56 @@ const SEND_RAD_REPORT_EMAIL = '/Notifications.svc/REST/SendRadReportEmail';
const SEND_FEEDBACK = '/COCWS.svc/REST/InsertCOCItemInSPList';
const GET_STATUS_FOR_COCO = '/COCWS.svc/REST/GetStatusforCOC';
//const BASE_URL = 'https://hmgwebservices.com/'; // Production Environment
//const BASE_URL = 'https://hmgwebservices.com/Services'; // Production Environment
//const BASE_URL = 'https://uat.hmgwebservices.com/Services'; // UAT Environment
//URL to get clinic list
const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
const GET_CLINICS_LIST_URL = "/lists.svc/REST/GetClinicCentralized";
//URL to get doctors list
const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime";
const GET_DOCTORS_LIST_URL = "/Doctors.svc/REST/SearchDoctorsByTime";
//URL to get doctor free slots
const GET_DOCTOR_FREE_SLOTS = "/Doctors.svc/REST/GetDoctorFreeSlots";
//URL to insert appointment
const INSERT_SPECIFIC_APPOINTMENT =
"/Doctors.svc/REST/InsertSpecificAppointment";
//URL to get patient share
const GET_PATIENT_SHARE =
"/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY =
"/Doctors.svc/REST/PateintHasAppoimentHistory";
//URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
"/Doctors.svc/REST/AppoimentHistoryForCurfew";
//URL to confirm appointment
const CONFIRM_APPOINTMENT = "/MobileNotifications.svc/REST/ConfirmAppointment";
//URL to cancel appointment
const CANCEL_APPOINTMENT = "/Doctors.svc/REST/CancelAppointment";
//URL get appointment QR
const GENERATE_QR_APPOINTMENT = "/Doctors.svc/REST/GenerateQRAppointmentNo";
//URL send email appointment QR
const EMAIL_QR_APPOINTMENT = "/Notifications.svc/REST/sendEmailForOnLineCheckin";
//URL check payment status
const CHECK_PAYMENT_STATUS = "/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
//URL create advance payment
const CREATE_ADVANCE_PAYMENT = "/Doctors.svc/REST/CreateAdvancePayment";
const ADD_ADVANCE_NUMBER_REQUEST = '/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
const IS_ALLOW_ASK_DOCTOR = '/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
//URL to get medicine and pharmacies list
const CHANNEL = 3;
const GENERAL_ID = 'Cs2020@2016\$2958';
@ -75,16 +118,19 @@ class AppGlobal {
Request getPublicRequest() {
Request request = new Request();
request.VersionID = 5.5; //3.6;
request.Channel = 3;
request.IPAdress = "10.20.10.20";
request.generalid = 'Cs2020@2016\$2958';
request.VersionID = VERSION_ID; //5.3; //3.6;
request.Channel = CHANNEL; //3;
// request.LanguageID = await sharedPref.getString(APP_LANGUAGE);
request.IPAdress = IP_ADDRESS; //"10.20.10.20";
request.generalid = GENERAL_ID; //'Cs2020@2016\$2958';
request.PatientOutSA = 0;
request.SessionID = null;
request.SessionID = "wEVNbagIkaNhGECWZjHaA";
request.TokenID = "@dm!n";
request.isDentalAllowedBackend = false;
request.DeviceTypeID = DeviceTypeID;
// Platform.isIOS ? 1 : 2;
request.DeviceTypeID = Platform.isIOS ? 1 : 2;
return request;
}

@ -10,10 +10,12 @@ const Map<String, Map<String, String>> localizedValues = {
'home': {'en': 'Home', 'ar': 'الرئيسية'},
'services': {'en': 'SERVICES', 'ar': 'الخدمات'},
'mySchedule': {'en': 'My Schedule', 'ar': 'جدولي'},
'logout': {'en': 'Sign Out', 'ar': 'تسجيل خروج'},
'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'},
'bookAppo': {'en': 'Book Appointment', 'ar': 'حجز موعد'},
'searchBy': {'en': 'Search By:', 'ar': 'البحث عن طريق:'},
'clinic': {'en': 'Clinic', 'ar': 'العيادة'},
'hospital': {'en': 'Hospital', 'ar': 'المستشفى'},
'name': {'en': 'Name', 'ar': 'الإسم'},
'doctor': {'en': 'Doctor', 'ar': 'الطبيب'},
'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'},
@ -30,7 +32,7 @@ const Map<String, Map<String, String>> localizedValues = {
'appoInfo': {'en': 'Appointment Information', 'ar': 'معلومات الموعد'},
'availableAppo': {'en': 'Available Appointments', 'ar': 'المواعيد المتاحة'},
'gender': {'en': 'Gender', 'ar': 'الجنس'},
'nationality': {'en': 'nationality', 'ar': 'الجنسية'},
'nationality': {'en': 'Nationality', 'ar': 'الجنسية'},
'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'},
'confirmAppoHeading': {
'en': 'Kindly confirm your Appointment',
@ -49,6 +51,34 @@ const Map<String, Map<String, String>> localizedValues = {
'confirmLater': {'en': 'Confirm Later', 'ar': 'تأكيد لاحقا'},
'todoList': {'en': 'Todo List', 'ar': 'مهامي'},
'appoActions': {'en': 'Appointment Actions', 'ar': 'إجراءات الموعد'},
'date': {'en': 'Date', 'ar': 'التاريخ'},
'time': {'en': 'Time', 'ar': 'الوقت'},
'pendingPayment': {'en': 'Pending for payment', 'ar': 'في انتظار الدفع'},
'payNow': {'en': 'Pay Now', 'ar': 'ادفع الآن'},
'viewQR': {'en': 'View QR Code', 'ar': 'عرض رمز الاستجابة السريعة'},
'instruction': {'en': 'Instructions', 'ar': 'تعليمات'},
'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'},
'cancelAppoMsg': {'en': 'Are you sure you want to cancel this appointment?', 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'},
'upcoming-noAction': {'en': 'No Action Required', 'ar': 'لا يوجد إجراء مطلوب'},
'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'},
'upcoming-payment-pending': {'en': 'Online Payment will be Activated before 24 Hours of Appointment Time', 'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز'},
'upcoming-payment-now': {'en': 'Pay Online now to avoid long waiting queue', 'ar': 'ادفع الآن لتفادي الانتظار'},
'upcoming-QR': {'en': 'Use the QR Code to Check-In in hospital', 'ar': 'استخدم الرمز لتسجيل الحضور في المستشفى'},
'upcoming-virtual': {'en': 'This is a virtual appointment, Please adhere to the instructions for a seamless experience.', 'ar': 'هذا موعد اتصال مرئي عن بعد ، يرجى اتباع تعليمات الخدمة.'},
'upcoming-livecare': {'en': 'This is a LiveCare appointment', 'ar': 'هذا موعد لايف كير'},
'upcoming-details': {'en': 'More Details', 'ar': 'المزيد'},
'reschedule': {'en': 'Reschedule', 'ar': 'إعادة جدولة'},
'raise': {'en': 'Raise', 'ar': 'رفع'},
'complaint': {'en': 'Complaint', 'ar': 'شكوى'},
'add': {'en': 'Add', 'ar': 'إضافة'},
'reminder': {'en': 'Reminder', 'ar': 'تذكير'},
'location': {'en': 'Locations', 'ar': 'مواقعنا'},
'online': {'en': 'Online', 'ar': 'الالكترونية'},
'payment': {'en': 'Payment', 'ar': 'الدفع'},
'cancel-nocaps': {'en': 'Cancel', 'ar': 'الغاء'},
'set-reminder': {'en': 'Set Reminder', 'ar': 'تعيين تذكير'},
'login': {'en': 'Login', 'ar': 'تسجيل الدخول'},
'loginregister': {'en': 'Login / Register', 'ar': 'دخولتسجيل'},
'welcome': {'en': 'Welcome', 'ar': 'أهلا بك'},
@ -128,6 +158,30 @@ const Map<String, Map<String, String>> localizedValues = {
"notification": {"en": "Notifications", "ar": "إشعارات"},
"app-settings": {"en": "App Settings", "ar": "إعدادات التطبيق"},
"rate-app": {"en": "Rate Our App", "ar": "قيم التطبيق"},
"before": {"en": "Before", "ar": "قبل"},
"minute": {"en": "Minutes", "ar": "دقيقة"},
"hour": {"en": "Hour", "ar": "ساعة"},
"reminderSuccess": {"en": "The reminder has been added successfully", "ar": "يضاف التذكير بنجاح"},
"patientShareToDo": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"},
"patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"},
"patientShareTotalToDo": {"en": "Total amount Due: ", "ar": "المبلغ الإجمالي المستحق:"},
'paymentMethod': {'en': 'Payment Method', 'ar': 'طريقة الدفع او السداد'},
'noNeedToWaitInLine': {'en': 'No need to stand in line.', 'ar': 'لا داعي للوقوف في الطابور.'},
'useQRAppoAttend': {'en': 'Use the QR code to register the appointment attendance.', 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.'},
'passQRAppoAttend': {'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'},
'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'},
'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'},
'scanQRHospital': {'en': 'Scan above QR Code to Check-In on the Machine in Hospital', 'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى'},
"sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"},
"close": {"en": "Close", "ar": "مغلق"},
"booked": {"en": "Booked", "ar": "محجوز"},
"confirmed": {"en": "Confirmed", "ar": "مؤكد"},
"arrived": {"en": "Arrived", "ar": "تم الحضور"},
"payNowBookSuccess": {"en": "Pay now via Al Habib App", "ar": "ادفع الآن عبر تطبيق الحبيب"},
"payNowBookSuccesstext1": {"en": "Pay Now using online payment service From secure payment gateways", "ar": "ادفع الآن باستخدام خدمة الدفع عبر الإنترنت من بوابات الدفع الآمنة"},
"payNowBookSuccesstext2": {"en": "You can also Pay Later via online payment Or in Hospital", "ar": "يمكنك أيضًا الدفع لاحقًا عبر الدفع عبر الإنترنت أو في المستشفى"},
'payLater': {'en': 'Pay Later', 'ar': 'ادفع لاحقا'},
'askDocNotAllowed': {'en': 'This service will be available for last 15 days doctor Visit only', 'ar': 'هذه الخدمة متاحة للزيارات خلال اخر 15 يوم فقط'},
"more-verify": {
"en": "More Verification Options",
"ar": "المزيد من خيارات التحقق"
@ -186,5 +240,5 @@ const Map<String, Map<String, String>> localizedValues = {
"patientCard": {"en": "Patient Card ID: ", "ar": "رقم الاشتراك"},
"policyNumber": {"en": "Policy Number: ", "ar": "رقم بوليصة التاميت:"},
"seeDetails": {"en": "SEE DETAILS", "ar": "منافعك التامينية"},
"insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"},
"insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}
};

@ -3,10 +3,10 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart';
import 'config/size_config.dart';
import 'core/viewModels/project_view_model.dart';
import 'locator.dart';
import 'pages/landing/landing_page.dart';
void main() {
setupLocator();

@ -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});
}

@ -1,21 +1,58 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.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/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';
import 'package:intl/intl.dart';
import 'package:rating_bar/rating_bar.dart';
import 'BookSuccess.dart';
class BookConfirm extends StatefulWidget {
DoctorList doctor;
String selectedDate;
String selectedTime;
String appoDateFormatted = "";
String appoTimeFormatted = "";
BookConfirm(
{@required this.doctor,
@required this.selectedDate,
@required this.selectedTime});
DoctorsListService service;
PatientShareResponse patientShareResponse;
AuthenticatedUser authUser;
@override
_BookConfirmState createState() => _BookConfirmState();
}
class _BookConfirmState extends State<BookConfirm> {
@override
void initState() {
widget.authUser = new AuthenticatedUser();
getPatientData();
widget.service = new DoctorsListService();
widget.patientShareResponse = new PatientShareResponse();
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(TranslationBase.of(context).bookAppo),
),
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(20.0),
@ -57,11 +94,8 @@ class _BookConfirmState extends State<BookConfirm> {
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(
"https://hmgwebservices.com/Images/MobileImages/OALAY/2477.png",
fit: BoxFit.fill,
height: 70.0,
width: 70.0),
child: Image.network(widget.doctor.doctorImageURL,
fit: BoxFit.fill, height: 70.0, width: 70.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.6,
@ -69,14 +103,17 @@ class _BookConfirmState extends State<BookConfirm> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Dr. EYAD ISMAIL ABU-JAYAD",
Text(
widget.doctor.doctorTitle +
"" +
widget.doctor.name,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text("INTERNAL MEDICINE CLINIC",
child: Text(widget.doctor.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -84,7 +121,10 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text("General Practioner",
child: Text(
getDoctorSpeciality(
widget.doctor.speciality)
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -96,7 +136,9 @@ class _BookConfirmState extends State<BookConfirm> {
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: 4.0,
initialRating: widget
.doctor.actualDoctorRate
.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
@ -146,7 +188,10 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text("Hospital: Olaya Hospital",
child: Text(
TranslationBase.of(context).hospital +
": " +
widget.doctor.projectName,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
@ -164,7 +209,10 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text("Clinic: INTERNAL MEDICINE CLINIC",
child: Text(
TranslationBase.of(context).clinic +
": " +
widget.doctor.clinicName,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
@ -183,7 +231,10 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text("Date: Olaya Hospital",
child: Text(
TranslationBase.of(context).date +
": " +
getDate(),
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
@ -202,7 +253,10 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text("Hospital: Olaya Hospital",
child: Text(
TranslationBase.of(context).time +
": " +
widget.selectedTime,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
@ -249,14 +303,14 @@ class _BookConfirmState extends State<BookConfirm> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("TAMER FANASHEH",
Text(widget.authUser.firstName + " " + widget.authUser.lastName,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text("Gender: Male",
child: Text("Gender: " + widget.authUser.genderDescription,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -264,7 +318,7 @@ class _BookConfirmState extends State<BookConfirm> {
),
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
child: Text("Age: 33",
child: Text("Age: " + widget.authUser.age.toString(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -298,17 +352,146 @@ class _BookConfirmState extends State<BookConfirm> {
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
navigateToBookSuccess(context);
// navigateToBookSuccess(context);
insertAppointment(context, widget.doctor);
},
child: Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 18.0)),
),
),
),
);
}
Future navigateToBookSuccess(context) async {
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) {
ConfirmDialog.closeAlertDialog(context);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) {
insertAppointment(context, docObject);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
});
}
insertAppointment(context, DoctorList docObject) {
AppoitmentAllHistoryResultList appo;
widget.service
.insertAppointment(docObject.doctorID, docObject.clinicID,
docObject.projectID, widget.selectedTime, widget.selectedDate, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
print(res['AppointmentNo']);
getPatientShare(context, res['AppointmentNo'], docObject.clinicID,
docObject.projectID, docObject);
} else {
appo = new AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
appo.projectID = res['SameClinicApptList'][0]['ProjectID'];
appo.endTime = res['SameClinicApptList'][0]['EndTime'];
appo.startTime = res['SameClinicApptList'][0]['StartTime'];
appo.doctorID = res['SameClinicApptList'][0]['DoctorID'];
appo.isLiveCareAppointment = false;
appo.originalClinicID = 0;
appo.originalProjectID = 0;
appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate'];
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: res['ErrorEndUserMessage'],
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {cancelAppointment(docObject, appo, context)},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
}).catchError((err) {
print(err);
});
}
getPatientShare(context, String appointmentNo, int clinicID, int projectID,
DoctorList docObject) {
widget.service
.getPatientShare(appointmentNo, clinicID, projectID, context)
.then((res) {
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) {
print(err);
});
}
String getTime(DateTime dateTime) {
final DateFormat formatter = DateFormat('HH:mm');
setState(() {
widget.appoTimeFormatted = formatter.format(dateTime);
print(widget.appoTimeFormatted);
});
return widget.appoTimeFormatted;
}
String getDate() {
var dateObj = new DateTime(
int.parse(widget.selectedDate.split("-")[0]),
int.parse(widget.selectedDate.split("-")[1]),
int.parse(widget.selectedDate.split("-")[2]),
0,
0,
0,
0);
setState(() {
widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString();
});
return widget.appoDateFormatted;
}
String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = "";
docSpecial.forEach((v) {
docSpeciality = docSpeciality + v + "\n";
});
return docSpeciality;
}
getPatientData() async {
AppSharedPreferences sharedPref = AppSharedPreferences();
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await sharedPref.getObject(USER_PROFILE));
setState(() {
print(data);
widget.authUser = data;
});
}
}
Future navigateToBookSuccess(context, DoctorList docObject,
PatientShareResponse patientShareResponse) async {
print(widget.appoDateFormatted);
// print(widget.appoTimeFormatted);
Navigator.push(
context, MaterialPageRoute(builder: (context) => BookSuccess()));
context,
MaterialPageRoute(
builder: (context) => BookSuccess(
docObject: docObject,
patientShareResponse: patientShareResponse,
appoDateFormatted: widget.appoDateFormatted,
appoTimeFormatted: widget.selectedTime)));
}
}

@ -1,21 +1,52 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.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/pages/ToDoList/payment_method_select.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:flutter/material.dart';
import 'QRCode.dart';
class BookSuccess extends StatefulWidget {
PatientShareResponse patientShareResponse;
DoctorList docObject;
MyInAppBrowser browser;
String appoDateFormatted;
String appoTimeFormatted;
BookSuccess(
{@required this.patientShareResponse,
@required this.docObject,
@required this.appoDateFormatted,
@required this.appoTimeFormatted});
@override
_BookSucceState createState() => _BookSucceState();
_BookSuccessState createState() => _BookSuccessState();
}
class _BookSucceState extends State<BookSuccess> {
class _BookSuccessState extends State<BookSuccess> {
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
// appBar: AppBar(
// title: Text("Book Success"),
// bottomOpacity: 0.0,
// elevation: 0.0,
// backgroundColor: new Color(0xFF20bc44),
// ),
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -57,7 +88,8 @@ class _BookSucceState extends State<BookSuccess> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Text("Olaya Hospital", style: _getTextStyling()),
Text(widget.docObject.projectName,
style: _getTextStyling()),
Container(
margin: EdgeInsets.only(top: 5.0),
child:
@ -65,18 +97,23 @@ class _BookSucceState extends State<BookSuccess> {
),
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
child: Text("INTERNAL MEDICINE CLINIC",
child: Text(widget.docObject.clinicName,
style: _getTextStyling()),
),
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
child: Text(
"Thursday, 31 December 2020, 13:15:00",
widget.appoDateFormatted +
", " +
widget.appoTimeFormatted,
style: _getTextStyling()),
),
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
child: Text("Dr. EYAD ISMAIL ABU-JAYAB",
child: Text(
widget.docObject.doctorTitle +
" " +
widget.docObject.name,
style: _getTextStyling()),
),
],
@ -96,13 +133,23 @@ class _BookSucceState extends State<BookSuccess> {
BorderSide(width: 0.5, color: Colors.white)),
children: [
TableRow(children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientShare)),
TableCell(
child: _getNormalText(TranslationBase.of(context).patientShareWithTax)),
child: _getNormalText(
TranslationBase.of(context).patientShare)),
TableCell(
child: _getNormalText(TranslationBase.of(context)
.patientShareWithTax)),
]),
TableRow(children: [
TableCell(child: _getHeadingText("SR 35.7")),
TableCell(child: _getHeadingText("SR 41.06")),
TableCell(
child: _getHeadingText("SR " +
widget.patientShareResponse.patientShare
.toString())),
TableCell(
child: _getHeadingText("SR " +
widget
.patientShareResponse.patientShareWithTax
.toString())),
]),
],
),
@ -110,117 +157,542 @@ class _BookSucceState extends State<BookSuccess> {
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 30.0, bottom: 40.0),
alignment: Alignment.center,
child: Text(TranslationBase.of(context).confirmAppo,
style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)),
getNextActionWidget(),
],
),
),
);
}
Widget getNextActionWidget() {
switch (widget.patientShareResponse.nextAction) {
case 0:
return Container();
break;
case 10:
return _getConfirmAppo();
break;
case 15:
return _getPaymentPendingAppo();
break;
case 20:
return _getPayNowAppo();
break;
case 30:
return _getQRAppo();
break;
}
}
String getNextAction() {
switch (widget.patientShareResponse.nextAction) {
case 0:
return 'No Action';
break;
case 10:
return 'Confirm';
break;
case 15:
return 'Payment Pending';
break;
case 20:
return 'Pay Now';
break;
case 30:
return 'QR Code';
break;
}
}
Widget _getConfirmAppo() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 30.0, bottom: 40.0),
alignment: Alignment.center,
child: Text(TranslationBase.of(context).confirmAppo,
style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
_getBulletPoint("1"),
Container(
child: Text(
"Please confirm the appointment to avoid the cancellation",
overflow: TextOverflow.fade,
style: TextStyle(fontSize: 13.0)),
),
],
),
Flex(
direction: Axis.horizontal,
),
),
],
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(top: 20.0, left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
_getBulletPoint("1"),
Container(
child: Text(
"Please confirm the appointment to avoid the cancellation",
overflow: TextOverflow.fade,
style: TextStyle(fontSize: 13.0)),
),
],
),
),
_getBulletPoint("2"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
"The online payment process will be available 24 hours before the appointment.",
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 13.0)),
),
],
),
Flex(
direction: Axis.horizontal,
),
),
],
),
Container(
margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0),
child: Image.asset("assets/images/new-design/payment-method.png"),
),
Container(
alignment: Alignment.bottomCenter,
height: MediaQuery.of(context).size.height * 0.32,
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: () {},
child: Text(TranslationBase.of(context).confirm.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
navigateToHome(context);
},
child: Text(
TranslationBase.of(context).confirmLater.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
],
),
),
],
);
}
Widget _getPaymentPendingAppo() {
return Container();
}
Widget _getPayNowAppo() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 20.0, bottom: 0.0),
alignment: Alignment.center,
child: Text(TranslationBase.of(context).payNowBookSuccess,
style: TextStyle(
fontSize: 20.0,
letterSpacing: 0.8,
fontWeight: FontWeight.bold)),
),
Container(
alignment: Alignment.center,
child: Image.asset("assets/images/new-design/no-wait-queue.png",
width: 120.0, height: 120.0),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(top: 20.0, left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
_getBulletPoint("2"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
"The online payment process will be available 24 hours before the appointment.",
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 13.0)),
),
],
),
),
_getBulletPoint("1"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
TranslationBase.of(context).payNowBookSuccesstext1,
overflow: TextOverflow.fade,
style: TextStyle(fontSize: 13.0)),
),
],
),
),
),
],
),
Container(
margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0),
child: Image.asset("assets/images/new-design/payment-method.png"),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(top: 0.0, left: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
_getBulletPoint("2"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
TranslationBase.of(context).payNowBookSuccesstext2,
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 13.0)),
),
],
),
Container(
margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0),
child: Image.asset(
"assets/images/new-design/payment-method.png"),
),
),
],
),
Container(
alignment: Alignment.bottomCenter,
height: MediaQuery.of(context).size.height * 0.2,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
Container(
alignment: Alignment.bottomCenter,
height: MediaQuery.of(context).size.height * 0.32,
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: () {
},
child:
Text(TranslationBase.of(context).confirm.toUpperCase(), style: TextStyle(fontSize: 18.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: () {
startPaymentProcess();
},
child: Text(TranslationBase.of(context).payNow.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
navigateToHome(context);
},
child: Text(
TranslationBase.of(context).payLater.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
],
),
),
],
);
}
startPaymentProcess() {
navigateToPaymentMethod(context, widget.patientShareResponse);
}
Future navigateToPaymentMethod(
context, PatientShareResponse patientShareResponse) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
setState(() {
authUser = data;
});
}
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.patientShareResponse.projectID;
appo.clinicID = widget.patientShareResponse.clinicID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo;
Navigator.push(
context, MaterialPageRoute(builder: (context) => PaymentMethod()))
.then((value) {
print(value);
if (value != null) {
openPayment(
value,
authUser,
double.parse(patientShareResponse.patientShareWithTax.toString()),
patientShareResponse,
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());
}).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) {});
// }
addAdvancedNumberRequest(String advanceNumber, String paymentReference,
String appointmentID) {
DoctorsListService service = new DoctorsListService();
service
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, context)
.then((res) {
print(res);
getAppoQR(context);
}).catchError((err) {
print(err);
});
}
Widget _getQRAppo() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 30.0, bottom: 40.0),
alignment: Alignment.center,
child: Text(TranslationBase.of(context).noNeedToWaitInLine,
style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)),
),
Container(
alignment: Alignment.center,
child: Image.asset("assets/images/new-design/device_icon.png",
width: 120.0, height: 120.0),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: Container(
padding: EdgeInsets.only(left: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: <Widget>[
_getBulletPoint("1"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
TranslationBase.of(context).useQRAppoAttend,
overflow: TextOverflow.fade,
style: TextStyle(fontSize: 13.0)),
),
],
),
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
navigateToHome(context);
},
child:
Text(TranslationBase.of(context).confirmLater.toUpperCase(), style: TextStyle(fontSize: 18.0)),
),
),
Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: <Widget>[
_getBulletPoint("2"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
TranslationBase.of(context).passQRAppoAttend,
overflow: TextOverflow.fade,
style: TextStyle(fontSize: 13.0)),
),
],
),
],
),
),
Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: <Widget>[
_getBulletPoint("3"),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
TranslationBase.of(context).sitWaitingQR,
overflow: TextOverflow.fade,
style: TextStyle(fontSize: 13.0)),
),
],
),
),
],
),
],
),
),
],
),
),
Container(
alignment: Alignment.bottomCenter,
height: MediaQuery.of(context).size.height * 0.18,
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);
},
child: Text(TranslationBase.of(context).viewQR.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
],
),
),
],
);
}
@ -257,8 +729,29 @@ class _BookSucceState extends State<BookSuccess> {
}
Future navigateToHome(context) async {
Navigator.popUntil(
context, ModalRoute.withName('/'));
Navigator.of(context).pushNamed(HOME);
}
getAppoQR(context) {
DoctorsListService service = new DoctorsListService();
service
.generateAppointmentQR(widget.patientShareResponse, context)
.then((res) {
print(res);
navigateToQR(context, res['AppointmentQR']);
}).catchError((err) {
print(err);
});
}
Future navigateToQR(context, String appoQR) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => QRCode(
patientShareResponse: widget.patientShareResponse,
appoQR: appoQR,
)));
}
_getNormalText(text) {

@ -8,7 +8,8 @@ class BookingOptions extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
// appBar: AppBar(title: Text(TranslationBase.of(context).bookAppo)) ,
isShowAppBar: false,
appBarTitle: TranslationBase.of(context).bookAppo,
body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Column(

@ -1,4 +1,8 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.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';
import 'package:rating_bar/rating_bar.dart';
@ -7,6 +11,11 @@ import 'components/DocAvailableAppointments.dart';
import 'components/DocInfo.dart';
class DoctorProfile extends StatefulWidget {
DoctorList doctor;
DoctorProfileList docProfileList;
DoctorProfile({@required this.doctor, @required this.docProfileList});
@override
_DoctorProfileState createState() => _DoctorProfileState();
}
@ -24,21 +33,9 @@ class _DoctorProfileState extends State<DoctorProfile>
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(TranslationBase.of(context).bookAppo),
actions: <Widget>[
IconButton(
icon: Icon(
Icons.today,
color: Colors.white,
),
onPressed: () {
print('Login');
},
)
],
),
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true,
bottomSheet: showFooterButton
? Container(
width: MediaQuery.of(context).size.width,
@ -55,11 +52,9 @@ class _DoctorProfileState extends State<DoctorProfile>
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
navigateToBookConfirm(context);
},
child:
Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)),
onPressed: goToBookConfirm,
child: Text(TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 18.0)),
),
),
)
@ -80,17 +75,16 @@ class _DoctorProfileState extends State<DoctorProfile>
alignment: Alignment.center,
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(
"https://hmgwebservices.com/Images/MobileImages/OALAY/2477.png",
fit: BoxFit.fill,
height: 120.0,
width: 120.0),
child: Image.network(widget.doctor.doctorImageURL,
fit: BoxFit.fill, height: 120.0, width: 120.0),
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text("Dr. EYAD ISMAIL ABU-JAYAD",
child: Text(
widget.doctor.doctorTitle + " " + widget.doctor.name,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20.0,
color: Colors.grey[900],
@ -99,9 +93,9 @@ class _DoctorProfileState extends State<DoctorProfile>
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text("INTERNAL MEDICINE CLINIC",
child: Text(widget.doctor.clinicName,
style: TextStyle(
fontSize: 12.0,
fontSize: 13.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
),
@ -109,7 +103,8 @@ class _DoctorProfileState extends State<DoctorProfile>
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: RatingBar.readOnly(
initialRating: 4.0,
initialRating:
widget.doctor.actualDoctorRate.toDouble(),
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
@ -122,7 +117,10 @@ class _DoctorProfileState extends State<DoctorProfile>
Container(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: Text("(2322 Reviews)",
child: Text(
"(" +
widget.doctor.noOfPatientsRate.toString() +
" Reviews)",
style: TextStyle(
fontSize: 14.0,
color: Colors.blue[800],
@ -160,10 +158,13 @@ class _DoctorProfileState extends State<DoctorProfile>
),
),
Container(
height: MediaQuery.of(context).size.height * 0.68,
height: MediaQuery.of(context).size.height,
child: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [DoctorInformation(), DocAvailableAppointments()],
children: [
DoctorInformation(docProfileList: widget.docProfileList),
DocAvailableAppointments(doctor: widget.doctor)
],
controller: _tabController,
),
),
@ -174,8 +175,20 @@ class _DoctorProfileState extends State<DoctorProfile>
);
}
void goToBookConfirm() {
if (DocAvailableAppointments.areSlotsAvailable)
navigateToBookConfirm(context);
else
AppToast.showErrorToast(message: "Please select Time Slot to continue");
}
Future navigateToBookConfirm(context) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => BookConfirm()));
context,
MaterialPageRoute(
builder: (context) => BookConfirm(
doctor: widget.doctor,
selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime)));
}
}

@ -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;
}
}

@ -30,7 +30,8 @@ class _SearchState extends State<Search> with SingleTickerProviderStateMixin {
],
controller: _tabController,
),
title: Text(TranslationBase.of(context).bookAppo),
title: Text(TranslationBase.of(context).bookAppo,
style: TextStyle(color: Colors.white)),
),
body: TabBarView(
physics: NeverScrollableScrollPhysics(),

@ -1,24 +1,45 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'widgets/DoctorView.dart';
class SearchResults extends StatelessWidget {
class SearchResults extends StatefulWidget {
List<DoctorList> doctorsList = [];
SearchResults({@required this.doctorsList});
@override
_SearchResultsState createState() => _SearchResultsState();
}
class _SearchResultsState extends State<SearchResults> {
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(TranslationBase.of(context).bookAppo),
),
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true,
body: Container(
margin: EdgeInsets.only(bottom: 10.0),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
DoctorView(),
DoctorView(),
DoctorView(),
DoctorView(),
],
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.doctorsList.length,
itemBuilder: (context, index) {
return DoctorView(
doctor: widget.doctorsList[index],
);
},
),
),
),

@ -1,12 +1,24 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:table_calendar/table_calendar.dart';
import '../../../uitl/date_uitl.dart';
class DocAvailableAppointments extends StatefulWidget {
DoctorList doctor;
static bool areSlotsAvailable = false;
static DateTime selectedAppoDateTime;
static String selectedDate;
static String selectedTime;
DocAvailableAppointments({@required this.doctor});
@override
_DocAvailableAppointmentsState createState() =>
_DocAvailableAppointmentsState();
@ -19,9 +31,17 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
CalendarController _calendarController;
var selectedDate = "";
var jsonFreeSlots;
dynamic selectedDateJSON;
dynamic jsonFreeSlots;
List<TimeSlot> docFreeSlots = [];
List<TimeSlot> dayEvents = [];
List docFreeSlots = [];
int selectedButtonIndex = 0;
dynamic freeSlotsResponse;
ScrollController _scrollController;
@override
void initState() {
@ -29,22 +49,19 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
super.initState();
final _selectedDay = DateTime.now();
this.selectedDate = DateUtil.getMonthDayYearDateFormatted(DateTime.now());
_scrollController = new ScrollController();
_events = {
_selectedDay: ['Event A0']
};
_getJSONSlots().then((value) => {
setState(() => {_events.clear(), _events = value})
});
WidgetsBinding.instance
.addPostFrameCallback((_) => getDoctorFreeSlots(context, widget.doctor));
// _selectedEvents = _events[_selectedDay] ?? [];
_calendarController = CalendarController();
_animationController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 400),
duration: const Duration(milliseconds: 50),
);
_animationController.forward();
@ -58,10 +75,12 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
}
void _onDaySelected(DateTime day, List events) {
print('CALLBACK: _onDaySelected');
final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() {
// _selectedEvents = events;
this.selectedDate = DateUtil.getMonthDayYearDateFormatted(day);
this.selectedDate = DateUtil.getMonthDayYearDateFormatted(day);
openTimeSlotsPickerForDate(day, docFreeSlots);
DocAvailableAppointments.selectedDate = formatter.format(day);
print(DocAvailableAppointments.selectedDate);
});
}
@ -80,9 +99,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
return SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20.0)
),
color: Colors.white, borderRadius: BorderRadius.circular(10.0)),
margin: EdgeInsets.all(20.0),
padding: EdgeInsets.only(bottom: 10.0, top: 10.0),
child: Column(
@ -90,6 +107,33 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
children: <Widget>[
Text(selectedDate,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)),
Container(
height: 50,
margin: EdgeInsets.all(20.0),
child: ListView.builder(
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: dayEvents.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(right: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(
color: Colors.blue[400], //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5, //width of the border
),
),
minWidth: MediaQuery.of(context).size.width * 0.2,
child: index == selectedButtonIndex
? getSelectedButton(index)
: getNormalButton(index)),
);
},
),
),
_buildTableCalendarWithBuilders(),
],
),
@ -97,28 +141,11 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
);
}
Future<Map<DateTime, List>> _getJSONSlots() async {
Map<DateTime, List> _eventsParsed;
List<FreeSlot> slotsList = [];
String data = await DefaultAssetBundle.of(context)
.loadString("assets/json/freeSlots.json");
jsonFreeSlots = json.decode(data.toString());
for (var i = 0; i < 4000; i++) {
slotsList.add(FreeSlot(
DateUtil.convertStringToDate(jsonFreeSlots['FreeTimeSlots'][i]),
['slot']));
}
_eventsParsed =
Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
return _eventsParsed;
}
Widget _buildTableCalendarWithBuilders() {
return TableCalendar(
locale: 'en_US',
calendarController: _calendarController,
events: _events,
// holidays: _holidays,
initialCalendarFormat: CalendarFormat.month,
startDay: DateTime.now(),
formatAnimation: FormatAnimation.slide,
@ -160,14 +187,24 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
},
todayDayBuilder: (context, date, _) {
return Container(
margin: const EdgeInsets.all(4.0),
padding: const EdgeInsets.only(top: 5.0, left: 6.0),
color: Colors.amber[400],
width: 0,
height: 0,
child: Text(
'${date.day}',
style: TextStyle().copyWith(fontSize: 16.0),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _calendarController.isSelected(date)
? Colors.green[400]
: _calendarController.isToday(date)
? Colors.brown[300]
: Colors.blue[400],
),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
),
),
),
);
},
@ -196,9 +233,117 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
);
}
openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) {
dayEvents.clear();
DateTime dateStartObj = new DateTime(
dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
freeSlots.forEach((v) {
if (v.start == dateStartObj) dayEvents.add(v);
});
setState(() {
if (dayEvents.length != 0)
DocAvailableAppointments.areSlotsAvailable = true;
else
DocAvailableAppointments.areSlotsAvailable = false;
selectedButtonIndex = 0;
DocAvailableAppointments.selectedTime =
dayEvents[selectedButtonIndex].isoTime;
// _scrollController.animateTo(0.0, duration: new Duration(seconds: 1), curve: Curves.ease);
});
}
Future<Map<DateTime, List>> _getJSONSlots() async {
Map<DateTime, List> _eventsParsed;
List<FreeSlot> slotsList = [];
DateTime date;
final DateFormat formatter = DateFormat('HH:mm');
final DateFormat dateFormatter = DateFormat('yyyy-MM-dd');
for (var i = 0; i < freeSlotsResponse.length; i++) {
date = DateUtil.convertStringToDate(freeSlotsResponse[i]);
slotsList.add(FreeSlot(date, ['slot']));
docFreeSlots.add(TimeSlot(
isoTime: formatter.format(date),
start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0),
end: date));
}
_eventsParsed =
Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() {
DocAvailableAppointments.selectedDate = dateFormatter
.format(DateUtil.convertStringToDate(freeSlotsResponse[0]));
selectedDate = DateUtil.getMonthDayYearDateFormatted(
DateUtil.convertStringToDate(freeSlotsResponse[0]));
selectedDateJSON = freeSlotsResponse[0];
});
openTimeSlotsPickerForDate(
DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController
.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON));
return _eventsParsed;
}
Widget getNormalButton(int index) {
return RaisedButton(
color: Colors.white,
textColor: new Color(0xFF60686b),
onPressed: () {
setState(() {
selectedButtonIndex = index;
DocAvailableAppointments.selectedTime = dayEvents[index].isoTime;
print(DocAvailableAppointments.selectedTime);
});
},
child: Text(dayEvents[index].isoTime,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
);
}
Widget getSelectedButton(int index) {
return RaisedButton(
color: Colors.blue[400],
textColor: Colors.white,
onPressed: () {
setState(() {
selectedButtonIndex = index;
DocAvailableAppointments.selectedTime = dayEvents[index].isoTime;
print(DocAvailableAppointments.selectedTime);
});
},
child: Text(dayEvents[index].isoTime,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
);
}
getDoctorFreeSlots(context, DoctorList docObject) {
DoctorsListService service = new DoctorsListService();
service
.getDoctorFreeSlots(
docObject.doctorID, docObject.clinicID, docObject.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) {
freeSlotsResponse = res['FreeTimeSlots'];
print("res['FreeTimeSlots']");
print(res['FreeTimeSlots'].length);
_getJSONSlots().then((value) => {
setState(() => {_events.clear(), _events = value})
});
} else {}
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
});
}
Widget _buildEventsMarker(DateTime date, List events) {
return Container(
// duration: const Duration(milliseconds: 10),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _calendarController.isSelected(date)

@ -1,7 +1,13 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
class DoctorInformation extends StatelessWidget {
DoctorProfileList docProfileList;
DoctorInformation({@required this.docProfileList});
@override
Widget build(BuildContext context) {
return Container(
@ -41,8 +47,8 @@ class DoctorInformation extends StatelessWidget {
TableCell(child: _getHeadingText(TranslationBase.of(context).nationality)),
]),
TableRow(children: [
TableCell(child: _getNormalText("Male")),
TableCell(child: _getNormalTextWithIcon("Palestinian")),
TableCell(child: _getNormalText(docProfileList.genderDescription)),
TableCell(child: _getNormalTextWithIcon(docProfileList.nationalityName, docProfileList.nationalityFlagURL)),
]),
],
),
@ -56,7 +62,7 @@ class DoctorInformation extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_getHeadingText(TranslationBase.of(context).clinic),
_getNormalText("INTERNAL MEDICINE CLINIC")
_getNormalText(docProfileList.clinicDescription)
],
),
)
@ -88,12 +94,10 @@ class DoctorInformation extends StatelessWidget {
),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0),
margin: EdgeInsets.fromLTRB(20.0, 0.0, 10.0, 5.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_getHeadingText(TranslationBase.of(context).clinic),
_getNormalText("INTERNAL MEDICINE CLINIC")
_getNormalText(docProfileList.doctorProfileInfo)
],
),
)
@ -127,14 +131,14 @@ class DoctorInformation extends StatelessWidget {
);
}
_getNormalTextWithIcon(text) {
_getNormalTextWithIcon(String text, icon) {
return Container(
margin: EdgeInsets.only(top: 5.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Text(text,
Text(text.trim(),
style: TextStyle(
fontSize: 13,
fontFamily: 'Open-Sans',
@ -143,7 +147,7 @@ class DoctorInformation extends StatelessWidget {
Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Image.network(
"https://hmgwebservices.com/Images/flag/PSE.png",
icon,
width: 18.0,
height: 18.0),
),

@ -1,9 +1,13 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import '../SearchResults.dart';
class SearchByClinic extends StatefulWidget {
@override
_SearchByClinicState createState() => _SearchByClinicState();
@ -16,8 +20,8 @@ class _SearchByClinicState extends State<SearchByClinic> {
@override
void initState() {
// TODO: implement initState
getClinicsList();
WidgetsBinding.instance
.addPostFrameCallback((_) => getClinicsList());
super.initState();
}
@ -70,7 +74,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
setState(() {
dropdownValue = newValue;
print(dropdownValue);
getDoctorsList();
getDoctorsList(context);
});
},
),
@ -82,7 +86,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
getClinicsList() {
ClinicListService service = new ClinicListService();
service.getClinicsList().then((res) {
service.getClinicsList(context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
res['ListClinicCentralized'].forEach((v) {
@ -95,19 +99,32 @@ class _SearchByClinicState extends State<SearchByClinic> {
});
}
getDoctorsList() {
getDoctorsList(BuildContext context) {
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
service.getDoctorsList(int.parse(dropdownValue), 0).then((res) {
print(res['DoctorList']);
// if (res['MessageStatus'] == 1) {
// setState(() {
// res['ListClinicCentralized'].forEach((v) {
// clinicsList.add(new ListClinicCentralized.fromJson(v));
// });
// });
// } else {}
service.getDoctorsList(int.parse(dropdownValue), 0, context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
} else {}
});
navigateToSearchResults(context, doctorsList);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
});
}
Future navigateToSearchResults(context, docList) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SearchResults(doctorsList: docList)));
}
}

@ -1,4 +1,6 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.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:flutter/material.dart';
@ -67,25 +69,29 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: _isButtonDisabled ? null : _searchDoctor,
onPressed: _isButtonDisabled ? null : _searchDoctor(context),
child: Text(TranslationBase.of(context).search,
style: TextStyle(fontSize: 18.0)),
),
);
}
getDoctorsList() {
getDoctorsList(BuildContext context) {
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
service.getDoctorsListByName(doctorNameController.text).then((res) {
print(res['DoctorList']);
service.getDoctorsListByName(doctorNameController.text, context).then((res) {
if (res['MessageStatus'] == 1) {
// setState(() {
// res['ListClinicCentralized'].forEach((v) {
// clinicsList.add(new ListClinicCentralized.fromJson(v));
// });
// });
navigateToSearchResults(context);
} else {}
setState(() {
if(res['DoctorList'].length != 0) {
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
} else {}
});
navigateToSearchResults(context, doctorsList);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
});
@ -105,12 +111,14 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
print(_isButtonDisabled);
}
void _searchDoctor() {
getDoctorsList();
_searchDoctor(BuildContext context) {
getDoctorsList(context);
}
Future navigateToSearchResults(context) async {
Future navigateToSearchResults(context, List<DoctorList> docList) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => SearchResults()));
context,
MaterialPageRoute(
builder: (context) => SearchResults(doctorsList: docList)));
}
}

@ -1,14 +1,22 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
import '../DoctorProfile.dart';
class DoctorView extends StatelessWidget {
DoctorList doctor;
DoctorView({@required this.doctor});
@override
Widget build(BuildContext context) {
return GestureDetector(
return InkWell(
onTap: () {
navigateToDoctorProfile(context);
getDoctorsProfile(context, doctor);
},
child: Card(
margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0),
@ -25,11 +33,8 @@ class DoctorView extends StatelessWidget {
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(
"https://hmgwebservices.com/Images/MobileImages/OALAY/2477.png",
fit: BoxFit.fill,
height: 60.0,
width: 60.0),
child: Image.network(this.doctor.doctorImageURL,
fit: BoxFit.fill, height: 60.0, width: 60.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.6,
@ -37,14 +42,22 @@ class DoctorView extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Dr. EYAD ISMAIL ABU-JAYAD",
Text(this.doctor.doctorTitle + " " + this.doctor.name,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text("INTERNAL MEDICINE CLINIC",
child: Text(this.doctor.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(this.doctor.projectName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -52,7 +65,8 @@ class DoctorView extends StatelessWidget {
),
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text("General Practioner",
child: Text(
getDoctorSpeciality(this.doctor.speciality).trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -63,7 +77,8 @@ class DoctorView extends StatelessWidget {
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: 4.0,
initialRating:
this.doctor.actualDoctorRate.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
@ -73,10 +88,8 @@ class DoctorView extends StatelessWidget {
emptyIcon: Icons.star,
),
Container(
child: Image.network(
"https://hmgwebservices.com/Images/flag/PSE.png",
width: 25.0,
height: 25.0),
child: Image.network(this.doctor.nationalityFlagURL,
width: 25.0, height: 25.0),
),
],
),
@ -90,9 +103,41 @@ class DoctorView extends StatelessWidget {
);
}
Future navigateToDoctorProfile(context) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => DoctorProfile()));
String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = "";
docSpecial.forEach((v) {
docSpeciality = docSpeciality + v + "\n";
});
return docSpeciality;
}
getDoctorsProfile(context, DoctorList docObject) {
List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsProfile(
docObject.doctorID, docObject.clinicID, docObject.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) {
res['DoctorProfileList'].forEach((v) {
docProfileList.add(new DoctorProfileList.fromJson(v));
});
} else {}
navigateToDoctorProfile(context, docObject, docProfileList[0]);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
});
}
Future navigateToDoctorProfile(context, docObject, docProfile) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
DoctorProfile(doctor: docObject, docProfileList: docProfile)));
}
}

@ -1,18 +1,30 @@
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart';
import 'package:flutter/material.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';
import 'package:rating_bar/rating_bar.dart';
import 'Components/AppointmentActions.dart';
import 'widgets/AppointmentActions.dart';
class AppointmentDetails extends StatefulWidget {
AppoitmentAllHistoryResultList appo;
static bool isLoading = false;
static bool showFooterButton = false;
AppointmentDetails({@required this.appo});
@override
_AppointmentDetailsState createState() => _AppointmentDetailsState();
}
class _AppointmentDetailsState extends State<AppointmentDetails>
with SingleTickerProviderStateMixin {
TabController _tabController;
bool showFooterButton = false;
static TabController _tabController;
@override
void initState() {
@ -20,12 +32,41 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
super.initState();
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_tabController.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Eyad Ismail Abu-Jayab"),
),
return AppScaffold(
appBarTitle: widget.appo.doctorNameObj,
isShowAppBar: true,
bottomSheet: AppointmentDetails.showFooterButton
? Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.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: goToBookConfirm,
child: Text(TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 18.0)),
),
),
)
: null,
body: Container(
color: new Color(0xFFf6f6f6),
child: SingleChildScrollView(
@ -42,17 +83,18 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
alignment: Alignment.center,
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(
"https://hmgwebservices.com/Images/MobileImages/OALAY/2477.png",
fit: BoxFit.fill,
height: 120.0,
width: 120.0),
child: Image.network(widget.appo.doctorImageURL,
fit: BoxFit.fill, height: 120.0, width: 120.0),
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text("Dr. EYAD ISMAIL ABU-JAYAD",
child: Text(
widget.appo.doctorTitle +
" " +
widget.appo.doctorNameObj,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20.0,
color: Colors.grey[900],
@ -61,7 +103,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text("INTERNAL MEDICINE CLINIC",
child: Text(widget.appo.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[900],
@ -71,7 +113,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: RatingBar.readOnly(
initialRating: 3.5,
initialRating: widget.appo.actualDoctorRate.toDouble(),
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
@ -84,7 +126,10 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
Container(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: Text("(2322 Reviews)",
child: Text(
"(" +
widget.appo.noOfPatientsRate.toString() +
" Reviews)",
style: TextStyle(
fontSize: 14.0,
color: Colors.blue[800],
@ -102,9 +147,9 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
onTap: (index) {
setState(() {
index == 1
? showFooterButton = true
: showFooterButton = false;
print(showFooterButton);
? AppointmentDetails.showFooterButton = true
: AppointmentDetails.showFooterButton = false;
print(AppointmentDetails.showFooterButton);
});
},
tabs: [
@ -122,10 +167,13 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
),
),
Container(
height: MediaQuery.of(context).size.height * 0.8,
height: MediaQuery.of(context).size.height * 0.87,
child: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [AppointmentActions(), DocAvailableAppointments()],
children: [
AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton),
DocAvailableAppointments(doctor: getDoctorObject())
],
controller: _tabController,
),
),
@ -135,4 +183,45 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
),
);
}
void enableFooterButton() {
setState(() {
AppointmentDetails.showFooterButton = true;
});
}
void goToBookConfirm() {
if (DocAvailableAppointments.areSlotsAvailable)
navigateToBookConfirm(context);
else
AppToast.showErrorToast(message: "Please select Time Slot to continue");
}
Future navigateToBookConfirm(context) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BookConfirm(
doctor: getDoctorObject(),
selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime)));
}
DoctorList getDoctorObject() {
DoctorList docObj = new DoctorList();
docObj.doctorID = widget.appo.doctorID;
docObj.clinicID = widget.appo.clinicID;
docObj.projectID = widget.appo.projectID;
docObj.doctorTitle = widget.appo.doctorTitle;
docObj.name = widget.appo.doctorNameObj;
docObj.clinicName = widget.appo.clinicName;
docObj.speciality = widget.appo.doctorSpeciality;
docObj.actualDoctorRate = widget.appo.actualDoctorRate;
docObj.projectName = widget.appo.projectName;
docObj.originalClinicID = widget.appo.originalClinicID;
docObj.doctorImageURL = widget.appo.doctorImageURL;
return docObj;
}
}

@ -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;
});
}
}

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
class AppointmentType {
static var BOOKED = 0;
static const BOOKED_STR = 'booked';
@ -6,23 +8,23 @@ class AppointmentType {
static var ARRIVED = 43;
static const ARRIVED_STR = 'arrived';
static bool isConfirmed(appo) {
static bool isConfirmed(AppoitmentAllHistoryResultList appo) {
return AppointmentType.isValid(appo) &&
appo.PatientStatusType == AppointmentType.CONFIRMED;
appo.patientStatusType == AppointmentType.CONFIRMED;
}
static bool isBooked(appo) {
static bool isBooked(AppoitmentAllHistoryResultList appo) {
return AppointmentType.isValid(appo) &&
appo.PatientStatusType == AppointmentType.BOOKED;
appo.patientStatusType == AppointmentType.BOOKED;
}
static bool isArrived(appo) {
static bool isArrived(AppoitmentAllHistoryResultList appo) {
return AppointmentType.isValid(appo) &&
appo.PatientStatusType == AppointmentType.ARRIVED;
appo.patientStatusType == AppointmentType.ARRIVED;
}
static isValid(appo) {
return appo != null && appo.PatientStatusType != null;
return appo != null && appo.patientStatusType != null;
}
static int getType(typeName) {

@ -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();
}
}
}

@ -1,19 +1,39 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
class TodoListCard extends StatefulWidget {
AppoitmentAllHistoryResultList appo;
var languageID;
final VoidCallback onListUpdated;
TodoListCard({@required this.appo, this.onListUpdated});
@override
_TodoListCardState createState() => _TodoListCardState();
}
class _TodoListCardState extends State<TodoListCard> {
AppSharedPreferences sharedPref = AppSharedPreferences();
@override
void initState() {
// widget.onListUpdated();
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
@ -31,7 +51,7 @@ class _TodoListCardState extends State<TodoListCard> {
width: 20.0, height: 20.0),
Container(
margin: EdgeInsets.only(left: 10.0, right: 30.0),
child: Text("Monday, 31 August 2020 09:30",
child: Text(getDate(widget.appo.appointmentDate),
style: TextStyle(fontSize: 12.0)),
),
Image.asset(
@ -40,7 +60,7 @@ class _TodoListCardState extends State<TodoListCard> {
height: 20.0),
Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: Text("Olaya Hospital",
child: Text(widget.appo.projectName,
style: TextStyle(fontSize: 12.0)),
),
],
@ -61,8 +81,7 @@ class _TodoListCardState extends State<TodoListCard> {
margin: EdgeInsets.only(top: 5.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(
"https://hmgwebservices.com/Images/MobileImages/OALAY/2477.png",
child: Image.network(widget.appo.doctorImageURL,
fit: BoxFit.fill),
),
),
@ -75,7 +94,10 @@ class _TodoListCardState extends State<TodoListCard> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Dr. EYAD ISMAIL ABU-JAYAD",
Text(
widget.appo.doctorTitle +
" " +
widget.appo.doctorNameObj,
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
@ -83,7 +105,7 @@ class _TodoListCardState extends State<TodoListCard> {
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text("General Practioner",
child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality).trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -112,17 +134,17 @@ class _TodoListCardState extends State<TodoListCard> {
Expanded(
flex: 1,
child: Container(
// height: MediaQuery.of(context).size.height * 0.12,
margin: EdgeInsets.only(top: 20.0),
child: Column(
children: <Widget>[
Image.asset(
"assets/images/new-design/confirm_button.png",
getNextActionImage(widget.appo.nextAction),
width: 50.0,
height: 50.0),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text("Confirm",
child: Text(
getNextActionText(widget.appo.nextAction),
textAlign: TextAlign.center,
style: TextStyle(fontSize: 12.0)),
)
@ -142,7 +164,7 @@ class _TodoListCardState extends State<TodoListCard> {
flex: 2,
child: Container(
child: Text(
"Please confirm the appointment to avoid cancellation",
getNextActionDescription(widget.appo.nextAction),
style: TextStyle(
fontSize: 12.0, color: Colors.grey[700])),
),
@ -154,7 +176,7 @@ class _TodoListCardState extends State<TodoListCard> {
navigateToAppointmentDetails(context);
},
child: Container(
child: Text("More Details",
child: Text(TranslationBase.of(context).upcomingDetails,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12.0,
@ -172,9 +194,153 @@ class _TodoListCardState extends State<TodoListCard> {
);
}
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 "";
}
}
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) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => AppointmentDetails()));
}
}

@ -490,7 +490,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
this
.authService
.checkActivationCode(request, value: value)
.checkActivationCode(request, value)
.then((result) => {
if (result is Map)
{

@ -186,7 +186,7 @@ class _Login extends State<Login> {
// request.isRegister = false;
this
.authService
.checkActivationCode(request, value: code)
.checkActivationCode(request, code)
.then((result) => {
result = CheckActivationCode.fromJson(result),
this.sharedPref.setObject(USER_PROFILE, result.list),

@ -1,14 +1,10 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/routes.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/buttons/button.dart';
@ -17,13 +13,9 @@ import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hijri/hijri_calendar.dart';
import 'package:intl/intl.dart';
class RegisterInfo extends StatefulWidget {
@override
@ -33,14 +25,9 @@ class RegisterInfo extends StatefulWidget {
class _RegisterInfo extends State<RegisterInfo> {
final authService = new AuthProvider();
final sharedPref = new AppSharedPreferences();
var emailAddress = new TextEditingController();
RegisterInfoResponse registerInfo;
bool isLoading;
int page = 1;
String selectedLanguage = 'English';
var registerRequest;
var selectSourceType = 'KSA';
@override
void initState() {
getRegisterInfo();
@ -54,291 +41,100 @@ class _RegisterInfo extends State<RegisterInfo> {
isShowAppBar: true,
body: SingleChildScrollView(
child: Container(
// padding: EdgeInsets.only(top: 10, left: 10, right: 10, bottom: 30),
height: SizeConfig.realScreenHeight,
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth,
child: RoundedContainer(
child: Padding(
padding:
EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 0),
child: Stack(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
child: Column(children: <Widget>[
Expanded(
flex: 1,
child: AppText(
TranslationBase.of(context).patientInfo,
fontSize: SizeConfig.textMultiplier * 3,
textAlign: TextAlign.left,
)),
registerInfo != null && page == 1
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Padding(
padding: EdgeInsets.only(bottom: 0),
child: AppText(
TranslationBase.of(context).patientInfo,
fontWeight: FontWeight.bold,
// fontSize: SizeConfig.textMultiplier * 2,
textAlign: TextAlign.left,
AppText('National ID'),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.idNumber,
prefixIcon: Icon(Icons.chrome_reader_mode,
color: Colors.red),
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
readOnly: true,
)),
AppText('Name'),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.firstNameEn +
' ' +
registerInfo.lastNameEn,
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
readOnly: true,
)),
AppText('Gender'),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.maritalStatusCode == 'U'
? 'Unknown'
: registerInfo.maritalStatusCode == 'M'
? 'Male'
: 'Female',
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
readOnly: true,
)),
AppText('Nationality'),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.nationalityCode,
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
readOnly: true,
)),
AppText('Date of Birth'),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.dateOfBirth,
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
readOnly: true,
)),
registerInfo != null && page == 1
? Padding(
padding: EdgeInsets.only(top: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.idNumber,
prefixIcon: Icon(
Icons.chrome_reader_mode,
color: Colors.red),
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 10,
right: 10),
readOnly: true,
)),
AppText(
TranslationBase.of(context).firstName),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.firstNameEn,
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 10,
right: 10),
readOnly: true,
)),
AppText(
TranslationBase.of(context).middleName),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.secondNameEn,
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 10,
right: 10),
readOnly: true,
)),
AppText(TranslationBase.of(context).lastName),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.lastNameEn,
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 10,
right: 10),
readOnly: true,
)),
AppText(TranslationBase.of(context).gender),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo
.maritalStatusCode ==
'U'
? 'Unknown'
: registerInfo.maritalStatusCode ==
'M'
? AppText(
TranslationBase.of(context)
.male)
: AppText(
TranslationBase.of(context)
.female),
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 10,
right: 10),
readOnly: true,
)),
AppText(
TranslationBase.of(context).nationality),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.nationalityCode,
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 10,
right: 10),
readOnly: true,
)),
AppText(TranslationBase.of(context).dob),
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.dateOfBirth,
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 10,
right: 10),
readOnly: true,
)),
],
))
: registerInfo != null && page == 2
? isLoading == true
? AppCircularProgressIndicator()
: Padding(
padding: EdgeInsets.only(top: 20),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
AppText(TranslationBase.of(context)
.prefferedLanguage),
Container(
margin: EdgeInsets.only(top: 0),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey,
width: 1),
borderRadius:
BorderRadius.circular(
5.0)),
padding: EdgeInsets.all(5),
child:
DropdownButtonHideUnderline(
child: DropdownButton(
focusColor:
Colors.white,
dropdownColor:
Colors.white,
isExpanded: true,
value:
selectedLanguage,
iconSize: 40,
elevation: 16,
onChanged: (String
newValue) =>
{},
items: <String>[
TranslationBase.of(
context)
.english,
TranslationBase.of(
context)
.arabic,
].map<
DropdownMenuItem<
String>>((String
value) {
return DropdownMenuItem<
String>(
value: value,
child:
Text(value),
);
}).toList()))),
AppText(TranslationBase.of(context)
.registrLocation),
Container(
margin:
EdgeInsets.only(bottom: 10),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey,
width: 1),
borderRadius:
BorderRadius.circular(
5.0)),
padding: EdgeInsets.all(5),
child:
DropdownButtonHideUnderline(
child: DropdownButton(
focusColor:
Colors.white,
dropdownColor:
Colors.white,
isExpanded: true,
value:
selectSourceType,
iconSize: 40,
elevation: 16,
onChanged: (String
newValue) =>
{},
items: <String>[
TranslationBase.of(
context)
.ksa,
TranslationBase.of(
context)
.dubai,
].map<
DropdownMenuItem<
String>>((String
value) {
return DropdownMenuItem<
String>(
value: value,
child:
Text(value),
);
}).toList()))),
AppText(TranslationBase.of(context)
.enterEmail),
Container(
margin:
EdgeInsets.only(bottom: 10),
child: TextFields(
hintText:
TranslationBase.of(context)
.enterEmail,
controller: emailAddress,
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 10,
right: 10),
))
],
))
: SizedBox(),
// AppText('National ID'),
page == 1
? Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).next,
() => {nextPage()},
textColor: Colors.white,
))
],
)
],
)
: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Row(
crossAxisAlignment:
CrossAxisAlignment.end,
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).register,
() => {registerNow()},
textColor: Colors.white,
))
])
])
],
))),
)
: registerInfo != null && page == 2
? Column(
children: <Widget>[],
)
: SizedBox(),
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).next,
() => {nextPage()},
textColor: Colors.white,
))
],
),
],
))
]),
)));
}
@ -348,89 +144,11 @@ class _RegisterInfo extends State<RegisterInfo> {
});
}
registerNow() {
var patientRequest = Patientobject();
var request = RegisterUserRequest();
showLoader(true);
patientRequest.dateofBirth = DateUtil.convertISODateToJsonDate(
registerInfo.dateOfBirth.replaceAll('/', '-'));
patientRequest.emailAddress = emailAddress.text;
patientRequest.patientIdentificationNo = registerInfo.idNumber;
patientRequest.patientIdentificationType = 2;
patientRequest.sourceType = selectSourceType == 'KSA' ? '1' : '2';
patientRequest.nationalityID = registerInfo.nationalityCode;
patientRequest.dateofBirthN = HijriCalendar.fromDate(DateFormat('mm-dd-yyy')
.parse(registerInfo.dateOfBirth.replaceAll('/', '-')))
.toString();
patientRequest.firstName = registerInfo.firstNameEn;
patientRequest.middleName = registerInfo.secondNameEn;
patientRequest.lastName = registerInfo.lastNameEn;
patientRequest.gender = registerInfo.gender == 'F' ? 2 : 1;
patientRequest.mobileNumber = registerRequest['PatientMobileNumber'];
patientRequest.marital = registerInfo.maritalStatusCode == 'M' ? '1' : '0';
// patientRequest.projectID = null;
patientRequest.strDateofBirth = DateFormat('mm-dd-yyy')
.parse(registerInfo.dateOfBirth.replaceAll('/', '-'))
.toString(); //DateFormat("MM-dd-yyyy")
//.parse(registerInfo.dateOfBirth.replaceAll('/', '-'));
patientRequest.tempValue = true;
request.logInTokenID = registerRequest['LogInTokenID'];
request.patientMobileNumber = registerRequest['PatientMobileNumber'];
request.patientIdentificationID = registerInfo.idNumber;
request.patientOutSA = registerRequest['PatientOutSA'];
request.patientobject = patientRequest;
request.patientobject.preferredLanguage =
selectedLanguage == 'Arabic' ? '1' : '2';
authService.registerUser(request).then((value) => {registerd(value)});
}
registerd(result) {
showLoader(false);
if (result is Map) {
result = CheckActivationCode.fromJson(result);
// this.userData =
// result.list; //AuthenticatedUser.fromJson(result['List'][0]),
this.sharedPref.setObject(USER_PROFILE, result.list);
// this.loginTokenID = result.logInTokenID;
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID);
this.checkIfUserAgreedBefore(result);
// Navigator.of(context).pop(),
} else {
// Navigator.of(context).pop(),
AppToast.showErrorToast(message: result);
}
}
checkIfUserAgreedBefore(result) {
if (result.isNeedUserAgreement) {
//move to agreement page.
} else {
insertIMEI();
}
}
insertIMEI() {
authService
.insertDeviceImei()
.then((value) => {Navigator.of(context).pushNamed(HOME)});
}
registerNow() {}
getRegisterInfo() async {
registerInfo =
RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA));
registerRequest = await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN);
setState(() {
registerInfo = registerInfo;
});
print(await sharedPref.getObject(NHIC_DATA));
}
showLoader(bool isTrue) {
setState(() {
isLoading = isTrue;
});
print(await sharedPref.getObject(NHIC_DATA));
}
}

@ -1,5 +1,6 @@
import 'dart:math';
import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
@ -184,7 +185,29 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
),
)
],
)
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context, FadePage(page: MyAppointments()));
},
child: MedicalProfileItem(
title: 'My Appointments',
imagePath: 'my_appointment_icon.png',
subTitle: 'List',
),
),
),
Expanded(
flex: 1,
child: Container(),
),
],
),
],
),
),

@ -1,15 +1,36 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.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/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
class DoctorsListService extends BaseService{
class DoctorsListService extends BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
Future<Map> getDoctorsList(int clinicID, int projectID) async {
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
Future<Map> getDoctorsList(
int clinicID, int projectID, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
@ -22,13 +43,13 @@ class DoctorsListService extends BaseService{
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null,
"ClinicID": 21,
"ProjectID": 0,
"ClinicID": clinicID,
"ProjectID": projectID,
"ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": true,
"PatientID": 0,
"gender": 0,
"age": 0,
"PatientID": authUser.patientID,
"gender": authUser.gender,
"age": authUser.age,
"IsGetNearAppointment": false,
"Latitude": 0,
"Longitude": 0,
@ -40,14 +61,23 @@ class DoctorsListService extends BaseService{
await baseAppClient.post(GET_DOCTORS_LIST_URL,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorsListByName(String docName) async {
Future<Map> getDoctorsListByName(String docName, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
@ -65,9 +95,9 @@ class DoctorsListService extends BaseService{
"ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": false,
"DoctorName": docName,
"PatientID": 0,
"gender": 0,
"age": 0,
"PatientID": authUser.patientID,
"gender": authUser.gender,
"age": authUser.age,
"IsGetNearAppointment": false,
"Latitude": 0,
"Longitude": 0,
@ -77,12 +107,691 @@ class DoctorsListService extends BaseService{
dynamic localRes;
await baseAppClient.post(GET_DOCTORS_LIST_URL,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorsProfile(
int docID, int clinicID, int projectID, context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null,
"doctorID": docID,
"ClinicID": clinicID,
"PatientID": 0,
"License": true,
"IsRegistered": true,
"ProjectID": projectID,
"isDentalAllowedBackend": false
};
dynamic localRes;
await baseAppClient.post(GET_DOCTOR_PROFILE,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorFreeSlots(
int docID, int clinicID, int projectID, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"DoctorID": docID,
"IsBookingForLiveCare": 0,
"ClinicID": clinicID,
"ProjectID": projectID,
"OriginalClinicID": clinicID,
"days": 0,
"isReschadual": false,
"VersionID": req.VersionID,
"Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958",
"PatientOutSA": 0,
"SessionID": null,
"isDentalAllowedBackend": false,
"DeviceTypeID": 1
};
dynamic localRes;
await baseAppClient.post(GET_DOCTOR_FREE_SLOTS,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> insertAppointment(int docID, int clinicID, int projectID,
String selectedTime, String selectedDate, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"IsForLiveCare": false,
"ProjectID": projectID,
"ClinicID": clinicID,
"DoctorID": docID,
"StartTime": selectedTime,
"SelectedTime": selectedTime,
"EndTime": selectedTime,
"InitialSlotDuration": 0,
"StrAppointmentDate": selectedDate,
"IsVirtual": false,
"DeviceType": Platform.isIOS ? 'iOS' : 'Android',
"BookedBy": 102,
"VisitType": 1,
"VisitFor": 1,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientShare(
String appoID, int clinicID, int projectID, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"ProjectID": projectID,
"ClinicID": clinicID,
"AppointmentNo": appoID,
"IsActiveAppointment": true,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_SHARE,
onSuccess: (response, statusCode) async {
localRes = response['OnlineCheckInAppointments'][0];
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientAppointmentHistory(
bool isActiveAppointment, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"IsActiveAppointment": isActiveAppointment,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": 0,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientAppointmentCurfewHistory(
bool isActiveAppointment) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"IsActiveAppointment": isActiveAppointment,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": 0,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": 1231755,
"TokenID": "@dm!n",
"PatientTypeID": 1,
"PatientType": 1
};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_APPOINTMENT_CURFEW_HISTORY,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> confirmAppointment(
int appoNo, int clinicID, int projectID, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentNumber": appoNo,
"ClinicID": clinicID,
"ProjectID": projectID,
"ConfirmationBy": 102,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": 0,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(CONFIRM_APPOINTMENT,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> cancelAppointment(
AppoitmentAllHistoryResultList appo, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentID": appo.appointmentNo,
"ClinicID": appo.clinicID,
"ProjectID": appo.projectID,
"EndTime": appo.endTime,
"StartTime": appo.startTime,
"DoctorID": appo.doctorID,
"IsForLiveCare": appo.isLiveCareAppointment,
"OriginalClinicID": appo.originalClinicID,
"OriginalProjectID": appo.originalProjectID,
"StrAppointmentDate": DateUtil.getDateFormatted(appo.appointmentDate),
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(CANCEL_APPOINTMENT,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> generateAppointmentQR(
PatientShareResponse patientShareResponse, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentNo": patientShareResponse.appointmentNo,
"ClinicID": patientShareResponse.clinicID,
"ProjectID": patientShareResponse.projectID,
"IsFollowup": patientShareResponse.isFollowup,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(GENERATE_QR_APPOINTMENT,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> sendAppointmentQREmail(
String to,
String appoDate,
String appoNo,
String docName,
String projName,
String QR,
String speciality,
BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentNo": appoNo,
"AppointmentDate": appoDate,
"DoctorName": docName,
"ProjectName": projName,
"QR": QR,
"Speciality": speciality,
"To": to,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(EMAIL_QR_APPOINTMENT,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> checkPaymentStatus(
String transactionID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"ClientRequestID": transactionID,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(CHECK_PAYMENT_STATUS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> addAdvancedNumberRequest(
String advanceNumber,
String paymentReference,
String appointmentID,
BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"AdvanceNumber": advanceNumber,
"PaymentReferenceNumber": paymentReference,
"AppointmentID": appointmentID,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(ADD_ADVANCE_NUMBER_REQUEST,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> isAllowedToAskDoctor(int docID, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"IsForAskYourDoctor": true,
"DoctorID": docID,
"Top": 25,
"beforeDays": 15,
"exludType": 4,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(IS_ALLOW_ASK_DOCTOR,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientRadOrders(String appoNo, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentNo": appoNo,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_ORDERS,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> createAdvancePayment(
AppoitmentAllHistoryResultList appo,
double payedAmount,
String paymentReference,
String paymentMethodName,
BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"ProjectID": appo.projectID.toString(),
"OnlineCheckInAppointment": {
"AppointmentNo": appo.appointmentNo.toString(),
"PaymentMethodName": paymentMethodName,
"PaymentAmount": payedAmount == 0 ? "0" : payedAmount.toString(),
"PaymentDate": payedAmount == 0
? ""
: "/Date(" +
DateTime.now().millisecondsSinceEpoch.toString() +
")/",
"PaymentReferenceNumber": payedAmount == 0 ? "" : paymentReference,
"ProjectID": appo.projectID.toString(),
"PatientID": authUser.patientID,
"ClinicID": appo.clinicID,
"UserID": authUser.patientID,
"Status": authUser.patientType
},
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(CREATE_ADVANCE_PAYMENT,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
}

@ -218,7 +218,7 @@ class AuthProvider with ChangeNotifier {
}
}
Future<dynamic> checkActivationCode(request, {value}) async {
Future<dynamic> checkActivationCode(request, [value]) async {
var neRequest = CheckActivationCodeReq.fromJson(request);
neRequest.activationCode = value ?? "0000";
neRequest.isSilentLogin = value != null ? false : true;

@ -4,12 +4,14 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class ClinicListService extends BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences();
AppGlobal appGlobal = new AppGlobal();
Future<Map> getClinicsList() async {
Future<Map> getClinicsList(context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
@ -30,7 +32,9 @@ class ClinicListService extends BaseService {
await baseAppClient.post(GET_CLINICS_LIST_URL,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);

@ -39,6 +39,17 @@ class DateUtil {
return "Old Date";
}
static String getDateFormatted(String date) {
DateTime dateObj = DateUtil.convertStringToDate(date);
return DateUtil.getWeekDay(dateObj.weekday) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString();
}
/// get month by
/// [month] convert month number in to month name
static getMonth(int month) {

@ -103,33 +103,59 @@ class TranslationBase {
String get appoActions => localizedValues['appoActions'][locale.languageCode];
String get appointment => localizedValues['appointment'][locale.languageCode];
String get hospital => localizedValues['hospital'][locale.languageCode];
String get date => localizedValues['date'][locale.languageCode];
String get time => localizedValues['time'][locale.languageCode];
String get login => localizedValues['login'][locale.languageCode];
String get loginregister =>
localizedValues['loginregister'][locale.languageCode];
String get welcome => localizedValues['welcome'][locale.languageCode];
String get welcomeText =>
localizedValues['welcome_text'][locale.languageCode];
String get welcomeText2 =>
localizedValues['welcome_text2'][locale.languageCode];
String get yes => localizedValues['yes'][locale.languageCode];
String get no => localizedValues['no'][locale.languageCode];
String get logintypeRadio =>
localizedValues['logintyperadio'][locale.languageCode];
String get registerNow => localizedValues['registernow'][locale.languageCode];
String get nationalID => localizedValues['nationalID'][locale.languageCode];
String get fileNo => localizedValues['fileNo'][locale.languageCode];
String get forgotPassword =>
localizedValues['forgotFileNo'][locale.languageCode];
String get enterNationalId =>
localizedValues['enter-national-id'][locale.languageCode];
String get profileInfo =>
localizedValues['profile-info'][locale.languageCode];
String get submit => localizedValues['submit'][locale.languageCode];
String get forgotDesc => localizedValues['forgot-desc'][locale.languageCode];
String get dob => localizedValues['dob'][locale.languageCode];
String get hijriDate => localizedValues['hijri-date'][locale.languageCode];
String get gregorianDate =>
localizedValues['gregorian-date'][locale.languageCode];
String get verifyLoginWith =>
localizedValues['verify-login-with'][locale.languageCode];
String get register => localizedValues['register-user'][locale.languageCode];
@ -148,8 +174,73 @@ class TranslationBase {
localizedValues['verify-fingerprint'][locale.languageCode];
String get searchMedicine =>
localizedValues['searchMedicine'][locale.languageCode];
String get searchMedicineHere =>
localizedValues['searchMedicineHere'][locale.languageCode];
String get pendingPayment =>
localizedValues['pendingPayment'][locale.languageCode];
String get payNow => localizedValues['payNow'][locale.languageCode];
String get viewQR => localizedValues['viewQR'][locale.languageCode];
String get instruction => localizedValues['instruction'][locale.languageCode];
String get livecare => localizedValues['livecare'][locale.languageCode];
String get upcomingNoAction =>
localizedValues['upcoming-noAction'][locale.languageCode];
String get upcomingConfirm =>
localizedValues['upcoming-confirm'][locale.languageCode];
String get upcomingPaymentPending =>
localizedValues['upcoming-payment-pending'][locale.languageCode];
String get upcomingPaymentNow =>
localizedValues['upcoming-payment-now'][locale.languageCode];
String get upcomingQR => localizedValues['upcoming-QR'][locale.languageCode];
String get upcomingVirtual =>
localizedValues['upcoming-virtual'][locale.languageCode];
String get upcomingLivecare =>
localizedValues['upcoming-livecare'][locale.languageCode];
String get upcomingDetails =>
localizedValues['upcoming-details'][locale.languageCode];
String get reschedule =>
localizedValues['reschedule'][locale.languageCode];
String get raise =>
localizedValues['raise'][locale.languageCode];
String get complaint =>
localizedValues['complaint'][locale.languageCode];
String get add =>
localizedValues['add'][locale.languageCode];
String get reminder =>
localizedValues['reminder'][locale.languageCode];
String get location =>
localizedValues['location'][locale.languageCode];
String get online =>
localizedValues['online'][locale.languageCode];
String get payment =>
localizedValues['payment'][locale.languageCode];
String get cancel_nocaps =>
localizedValues['cancel-nocaps'][locale.languageCode];
String get cancelAppoMsg =>
localizedValues['cancelAppoMsg'][locale.languageCode];
String get pharmaciesList =>
localizedValues['pharmaciesList'][locale.languageCode];
String get description => localizedValues['description'][locale.languageCode];
@ -168,6 +259,15 @@ class TranslationBase {
localizedValues['notification'][locale.languageCode];
String get appsetting => localizedValues['app-settings'][locale.languageCode];
String get rateApp => localizedValues['rate-app'][locale.languageCode];
String get setReminder => localizedValues['set-reminder'][locale.languageCode];
String get before => localizedValues['before'][locale.languageCode];
String get minute => localizedValues['minute'][locale.languageCode];
String get hour => localizedValues['hour'][locale.languageCode];
String get reminderSuccess => localizedValues['reminderSuccess'][locale.languageCode];
String get patientShareToDo => localizedValues['patientShareToDo'][locale.languageCode];
String get patientTaxToDo => localizedValues['patientTaxToDo'][locale.languageCode];
String get patientShareTotalToDo => localizedValues['patientShareTotalToDo'][locale.languageCode];
String get paymentMethod => localizedValues['paymentMethod'][locale.languageCode];
String get moreVerification =>
localizedValues['more-verify'][locale.languageCode];
String get welcomeBack =>
@ -177,6 +277,22 @@ class TranslationBase {
String get useAnotherAccount =>
localizedValues['another-acc'][locale.languageCode];
String get next => localizedValues['next'][locale.languageCode];
String get noNeedToWaitInLine => localizedValues['noNeedToWaitInLine'][locale.languageCode];
String get useQRAppoAttend => localizedValues['useQRAppoAttend'][locale.languageCode];
String get passQRAppoAttend => localizedValues['passQRAppoAttend'][locale.languageCode];
String get sitWaitingQR => localizedValues['sitWaitingQR'][locale.languageCode];
String get attendRegisterCode => localizedValues['attendRegisterCode'][locale.languageCode];
String get scanQRHospital => localizedValues['scanQRHospital'][locale.languageCode];
String get sendEmail => localizedValues['sendEmail'][locale.languageCode];
String get close => localizedValues['close'][locale.languageCode];
String get booked => localizedValues['booked'][locale.languageCode];
String get confirmed => localizedValues['confirmed'][locale.languageCode];
String get arrived => localizedValues['arrived'][locale.languageCode];
String get payNowBookSuccess => localizedValues['payNowBookSuccess'][locale.languageCode];
String get payNowBookSuccesstext1 => localizedValues['payNowBookSuccesstext1'][locale.languageCode];
String get payNowBookSuccesstext2 => localizedValues['payNowBookSuccesstext2'][locale.languageCode];
String get payLater => localizedValues['payLater'][locale.languageCode];
String get askDocNotAllowed => localizedValues['askDocNotAllowed'][locale.languageCode];
String get firstName => localizedValues['first-name'][locale.languageCode];
String get middleName => localizedValues['middle-name'][locale.languageCode];
String get lastName => localizedValues['last-name'][locale.languageCode];

@ -1,5 +1,8 @@
import 'package:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:progress_dialog/progress_dialog.dart';
import 'app_shared_preferences.dart';
import 'app_toast.dart';
@ -7,6 +10,8 @@ import 'app_toast.dart';
AppSharedPreferences sharedPref = new AppSharedPreferences();
class Utils {
static ProgressDialog pr;
///show custom Error Toast
/// [message] to show for user
static showErrorToast([String message]) {
@ -85,6 +90,14 @@ class Utils {
}
}
static String getAppointmentTransID(int projectID, int clinicID, int appoNo) {
return projectID.toString() +
'-' +
clinicID.toString() +
'-' +
appoNo.toString();
}
bool validateIDBox(String value, type) {
Pattern pattern = loginIDPattern(type); //r'^\d+(?:\.\d+)?$';
@ -96,4 +109,34 @@ class Utils {
var length = loginType == 1 ? 10 : 7;
return "([0-9]{" + length.toString() + "})";
}
static showProgressDialog(context, [String message = "Loading..."]) async {
pr = ProgressDialog(context,
type: ProgressDialogType.Normal, isDismissible: false, showLogs: false);
pr.style(
message: message,
borderRadius: 10.0,
backgroundColor: Colors.white,
elevation: 10.0,
insetAnimCurve: Curves.easeInOut,
progress: 0.0,
maxProgress: 100.0,
progressTextStyle: TextStyle(
color: Colors.black, fontSize: 13.0, fontWeight: FontWeight.w400),
messageTextStyle: TextStyle(
color: Colors.black, fontSize: 19.0, fontWeight: FontWeight.w600));
if (!pr.isShowing()) {
await pr.show();
} else {
await pr.hide();
await pr.show();
}
}
static hideProgressDialog() async {
if (pr.isShowing()) {
await pr.hide();
}
}
}

@ -97,7 +97,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
changeIndex: _changeIndex,
index: _index,
currentIndex: 3,
name: TranslationBase.of(context).services,
name: TranslationBase.of(context).todoList,
)
],
),

@ -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>';
}
}

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

@ -1,22 +1,20 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import '../progress_indicator/app_loader_widget.dart';
import 'arrow_back.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../progress_indicator/app_loader_widget.dart';
import 'arrow_back.dart';
import 'network_base_view.dart';
class AppScaffold extends StatelessWidget {
final String appBarTitle;
final Widget body;
final Widget bottomSheet;
final bool isLoading;
final bool isShowAppBar;
final Widget bottomSheet;
final bool hasAppBarParam;
final BaseViewModel baseViewModel;
AppScaffold(
@ -24,7 +22,9 @@ class AppScaffold extends StatelessWidget {
this.appBarTitle = '',
this.isLoading = false,
this.isShowAppBar = false,
this.baseViewModel,this.bottomSheet});
this.hasAppBarParam,
this.bottomSheet,
this.baseViewModel});
@override
Widget build(BuildContext context) {
@ -52,9 +52,6 @@ class AppScaffold extends StatelessWidget {
color: Colors.white,
onPressed: () {
// TODO add navigator to home page
Navigator.of(context).pushNamed(
HOME,
);
},
),
],

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -80,11 +80,18 @@ dependencies:
# Location Helper
map_launcher: ^0.8.1
#hijri
hijri: ^2.0.3
#Calendar Events
manage_calendar_events: ^1.0.2
#InAppBrowser
flutter_inappwebview: ^4.0.0+4
#ProgressDialog
progress_dialog: ^1.2.4
#hijri
hijri: ^2.0.3

Loading…
Cancel
Save