Merge branch 'dev_v3.13.6_deep_link' into dev_v3.13.6

merge-update-with-lab-changes
haroon amjad 7 months ago
commit 5fc939bf1e

@ -144,6 +144,9 @@
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize"
tools:node="merge">
<meta-data
android:name="flutter_deeplinking_enabled"
android:value="true" />
<!--
Specifies an Android theme to apply to this Activity as soon as
@ -171,11 +174,26 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="hmg.com"
android:scheme="http" />
<data
android:host="www.hmg.com"
android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity> <!-- <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver" android:exported="true"> -->
<!-- <intent-filter> -->
<!-- <action android:name="android.intent.action.BOOT_COMPLETED"/> -->

@ -3,7 +3,7 @@ platform :ios, '14.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
# use_frameworks! :linkage => :static
use_frameworks! :linkage => :static
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,

@ -8,22 +8,21 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
17AB294D2D8707DE001C125B /* Penguin.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17AB29452D86D210001C125B /* Penguin.xcframework */; };
17AB294E2D8707DE001C125B /* Penguin.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 17AB29452D86D210001C125B /* Penguin.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17AB29502D8707DF001C125B /* PenguinINRenderer.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17AB29442D86D210001C125B /* PenguinINRenderer.xcframework */; };
17AB29512D8707DF001C125B /* PenguinINRenderer.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 17AB29442D86D210001C125B /* PenguinINRenderer.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17AB29522D8707E2001C125B /* PenNavUI.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17AB29432D86D210001C125B /* PenNavUI.xcframework */; };
17AB29532D8707E2001C125B /* PenNavUI.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 17AB29432D86D210001C125B /* PenNavUI.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
29631B9E2C96C7F600DF5916 /* PenguinNavigator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29631B9D2C96C7F600DF5916 /* PenguinNavigator.swift */; };
301C79AE27200D9F0016307B /* OpenTokRemoteVideoFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 301C79AD27200D9F0016307B /* OpenTokRemoteVideoFactory.swift */; };
301C79B027200DED0016307B /* OpenTokLocalVideoFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 301C79AF27200DED0016307B /* OpenTokLocalVideoFactory.swift */; };
306FE6C8271D790C002D6EFC /* OpenTokPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 306FE6C7271D790C002D6EFC /* OpenTokPlatformBridge.swift */; };
306FE6CB271D8B73002D6EFC /* OpenTok.swift in Sources */ = {isa = PBXBuildFile; fileRef = 306FE6CA271D8B73002D6EFC /* OpenTok.swift */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
55DE18989C1F69DC483B9FB6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C56AF9B31AA04A5292EEA39F /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
762D738E274E42650063CE73 /* ring_30Sec.caf in Resources */ = {isa = PBXBuildFile; fileRef = 762D738C274E42650063CE73 /* ring_30Sec.caf */; };
762D738F274E42650063CE73 /* ring_30Sec.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 762D738D274E42650063CE73 /* ring_30Sec.mp3 */; };
7651B82F2D3E9CA40066B33A /* PenguinINRenderer.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7651B82C2D3E9CA40066B33A /* PenguinINRenderer.xcframework */; };
7651B8302D3E9CA40066B33A /* PenguinINRenderer.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7651B82C2D3E9CA40066B33A /* PenguinINRenderer.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
7651B8312D3E9CA40066B33A /* Penguin.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7651B82D2D3E9CA40066B33A /* Penguin.xcframework */; };
7651B8322D3E9CA40066B33A /* Penguin.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7651B82D2D3E9CA40066B33A /* Penguin.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
7651B8332D3E9CA40066B33A /* PenNavUI.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7651B82E2D3E9CA40066B33A /* PenNavUI.xcframework */; };
7651B8342D3E9CA40066B33A /* PenNavUI.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7651B82E2D3E9CA40066B33A /* PenNavUI.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76815B26275F381C00E66E94 /* HealthKit.framework */; };
76962ECE28AE5C10004EAE09 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */; };
76D71B672C6B7F9C00DAFB84 /* HMGPenguinInPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76D71B662C6B7F9C00DAFB84 /* HMGPenguinInPlatformBridge.swift */; };
@ -52,18 +51,19 @@
E9C8C136256BACDA00EFFB62 /* HMG_Guest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */; };
E9E27168256E3A4000F49B69 /* LocalizedFromFlutter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */; };
E9F7623B25922BCE00FB5CCF /* FlutterConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */; };
F74B5001ECD140A97800DC22 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C56AF9B31AA04A5292EEA39F /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
7651B8352D3E9CA50066B33A /* Embed Frameworks */ = {
17AB294F2D8707DE001C125B /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 12;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
7651B8322D3E9CA40066B33A /* Penguin.xcframework in Embed Frameworks */,
7651B8302D3E9CA40066B33A /* PenguinINRenderer.xcframework in Embed Frameworks */,
7651B8342D3E9CA40066B33A /* PenNavUI.xcframework in Embed Frameworks */,
17AB29512D8707DF001C125B /* PenguinINRenderer.xcframework in Embed Frameworks */,
17AB294E2D8707DE001C125B /* Penguin.xcframework in Embed Frameworks */,
17AB29532D8707E2001C125B /* PenNavUI.xcframework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
@ -74,6 +74,9 @@
02C0468611167F0E858967A9 /* 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>"; };
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>"; };
17AB29432D86D210001C125B /* PenNavUI.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = PenNavUI.xcframework; path = Frameworks/PenNavUI.xcframework; sourceTree = "<group>"; };
17AB29442D86D210001C125B /* PenguinINRenderer.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = PenguinINRenderer.xcframework; path = Frameworks/PenguinINRenderer.xcframework; sourceTree = "<group>"; };
17AB29452D86D210001C125B /* Penguin.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Penguin.xcframework; path = Frameworks/Penguin.xcframework; sourceTree = "<group>"; };
29631B9D2C96C7F600DF5916 /* PenguinNavigator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PenguinNavigator.swift; sourceTree = "<group>"; };
301C79AD27200D9F0016307B /* OpenTokRemoteVideoFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTokRemoteVideoFactory.swift; sourceTree = "<group>"; };
301C79AF27200DED0016307B /* OpenTokLocalVideoFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTokLocalVideoFactory.swift; sourceTree = "<group>"; };
@ -84,12 +87,6 @@
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
762D738C274E42650063CE73 /* ring_30Sec.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ring_30Sec.caf; path = ../../assets/sounds/ring_30Sec.caf; sourceTree = "<group>"; };
762D738D274E42650063CE73 /* ring_30Sec.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = ring_30Sec.mp3; path = ../../assets/sounds/ring_30Sec.mp3; sourceTree = "<group>"; };
7643E4042BE0D0B400BD2F25 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Main_Custom.strings; sourceTree = "<group>"; };
7643E4052BE0D0B400BD2F25 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Main.strings; sourceTree = "<group>"; };
7643E4062BE0D0B400BD2F25 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
7651B82C2D3E9CA40066B33A /* PenguinINRenderer.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = PenguinINRenderer.xcframework; path = Frameworks/PenguinINRenderer.xcframework; sourceTree = "<group>"; };
7651B82D2D3E9CA40066B33A /* Penguin.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Penguin.xcframework; path = Frameworks/Penguin.xcframework; sourceTree = "<group>"; };
7651B82E2D3E9CA40066B33A /* PenNavUI.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = PenNavUI.xcframework; path = Frameworks/PenNavUI.xcframework; sourceTree = "<group>"; };
76815B26275F381C00E66E94 /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; };
76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
76D71B662C6B7F9C00DAFB84 /* HMGPenguinInPlatformBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HMGPenguinInPlatformBridge.swift; sourceTree = "<group>"; };
@ -134,13 +131,13 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7651B8312D3E9CA40066B33A /* Penguin.xcframework in Frameworks */,
76F2556127F1FFED0062C1CD /* PassKit.framework in Frameworks */,
76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */,
E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */,
7651B8332D3E9CA40066B33A /* PenNavUI.xcframework in Frameworks */,
7651B82F2D3E9CA40066B33A /* PenguinINRenderer.xcframework in Frameworks */,
55DE18989C1F69DC483B9FB6 /* Pods_Runner.framework in Frameworks */,
F74B5001ECD140A97800DC22 /* Pods_Runner.framework in Frameworks */,
17AB29522D8707E2001C125B /* PenNavUI.xcframework in Frameworks */,
17AB294D2D8707DE001C125B /* Penguin.xcframework in Frameworks */,
17AB29502D8707DF001C125B /* PenguinINRenderer.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -160,9 +157,9 @@
555EAAA626EFB641859EF0BE /* Frameworks */ = {
isa = PBXGroup;
children = (
7651B82D2D3E9CA40066B33A /* Penguin.xcframework */,
7651B82C2D3E9CA40066B33A /* PenguinINRenderer.xcframework */,
7651B82E2D3E9CA40066B33A /* PenNavUI.xcframework */,
17AB29452D86D210001C125B /* Penguin.xcframework */,
17AB29442D86D210001C125B /* PenguinINRenderer.xcframework */,
17AB29432D86D210001C125B /* PenNavUI.xcframework */,
76F2556027F1FFED0062C1CD /* PassKit.framework */,
76815B26275F381C00E66E94 /* HealthKit.framework */,
E9620804255C2ED100D3A35D /* NetworkExtension.framework */,
@ -298,7 +295,7 @@
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
7651B8352D3E9CA50066B33A /* Embed Frameworks */,
17AB294F2D8707DE001C125B /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
191312D8478950EB12CBDD28 /* [CP] Embed Pods Frameworks */,
4CC68CB45B720A365C7CF7DC /* [CP] Copy Pods Resources */,
@ -334,7 +331,6 @@
knownRegions = (
en,
Base,
ar,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
@ -496,7 +492,6 @@
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
7643E4052BE0D0B400BD2F25 /* ar */,
);
name = Main.storyboard;
sourceTree = "<group>";
@ -505,7 +500,6 @@
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
7643E4062BE0D0B400BD2F25 /* ar */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
@ -514,7 +508,6 @@
isa = PBXVariantGroup;
children = (
E91B53A2256AAD8200E96549 /* Base */,
7643E4042BE0D0B400BD2F25 /* ar */,
);
name = Main_Custom.storyboard;
sourceTree = "<group>";

@ -122,5 +122,7 @@
<true/>
<key>MBXAccessToken</key>
<string>pk.eyJ1IjoicndhaWQiLCJhIjoiY2x5cGo4aHNjMGNsbTJyc2djempobGQxaSJ9.RCaC6WrUt4A4YnZNfxnONQ</string>
<key>FlutterDeepLinkingEnabled</key>
<false/>
</dict>
</plist>

@ -4,6 +4,11 @@
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:www.hmg.com</string>
<string>webcredentials:example.com</string>
</array>
<key>com.apple.developer.healthkit</key>
<true/>
<key>com.apple.developer.healthkit.access</key>
@ -26,5 +31,9 @@
<array>
<string>$(TeamIdentifierPrefix)*</string>
</array>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:hmg.com</string>
</array>
</dict>
</plist>

@ -708,6 +708,7 @@ var applePayMerchantId = "merchant.com.hmgwebservices";
class AppGlobal {
static var context;
static var projectViewModelContext;
AppSharedPreferences sharedPref = AppSharedPreferences();

@ -1,5 +1,7 @@
import 'dart:async';
import 'dart:io';
import 'package:app_links/app_links.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/PharmacyPagesViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
@ -10,12 +12,11 @@ import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/DeepLinkHandler.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart';
@ -59,7 +60,7 @@ class MyHttpOverrides extends HttpOverrides {
class _MyApp extends State<MyApp> {
// late AppUpdateInfo _updateInfo;
StreamSubscription<Uri>? _linkSubscription;
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
//0537503378
@ -92,9 +93,30 @@ class _MyApp extends State<MyApp> {
// if (Platform.isAndroid) checkForUpdate();
ThemeNotifier(defaultTheme());
initDeepLinks();
super.initState();
}
void dispose() {
_linkSubscription?.cancel();
super.dispose();
}
Future<void> initDeepLinks() async {
// Handle links
_linkSubscription = AppLinks().uriLinkStream.listen((uri) {
debugPrint('onAppLink: $uri');
openAppLink(uri);
});
}
void openAppLink(Uri uri) {
print("the uri is $uri");
DeepLinkHandler.instance.handleDeepLinkAndNavigation(
locator<NavigationService>().navigatorKey.currentState, uri, context);
}
@override
Widget build(BuildContext context) {
PlatformBridge.init(context);
@ -151,7 +173,8 @@ class _MyApp extends State<MyApp> {
],
child: Consumer<ProjectViewModel>(
builder: (context, projectProvider, child) => MaterialApp(
builder: (_, mchild) {
builder: (context, mchild) {
AppGlobal.projectViewModelContext = context;
return MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaler: TextScaler.linear(1.0),

@ -41,10 +41,8 @@ import 'package:diplomaticquarterapp/uitl/penguin_method_channel.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/vital_signs/vital_sign.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/covid_consent_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/location_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@ -220,7 +218,7 @@ class ServicesView extends StatelessWidget {
].request().whenComplete(() {
PenguinMethodChannel().launch("penguin", projectViewModel.isArabic ? "ar" : "en", projectViewModel.authenticatedUserObject.user.patientID.toString());
});
} //
}
}
handleHomePageServices(HmgServices hmgServices, BuildContext context) {

@ -0,0 +1,100 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/penguin_method_channel.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import '../pages/BookAppointment/Search.dart';
import 'app-permissions.dart';
enum DeepLinkNavigation {
APPOINTMENT("/appointment", false),
LIVE_CARE("/livecare", true),
NAVIGATE("/navigate", false);
final String name;
final bool isLoginRequired;
const DeepLinkNavigation(this.name, this.isLoginRequired);
}
class DeepLinkHandler {
final projectID = "projectID";
final clinicId = "clinicId";
DeepLinkNavigation? navigationType;
Uri? uri;
DeepLinkHandler._();
static final DeepLinkHandler _instance = DeepLinkHandler._();
static DeepLinkHandler get instance => _instance;
void handleDeepLinkAndNavigation(
NavigatorState? currentState, Uri uri, BuildContext context) async {
var url = uri.toString().replaceFirst(
"https://hmg.com/Pages/PageNotFoundError.aspx?requestUrl=", "");
uri = Uri.parse(url);
this.uri = uri;
print(
"the uri contains ${uri.path.toLowerCase() == DeepLinkNavigation.NAVIGATE.name}");
print("the uri.path ${uri.path}");
if (uri.path.toLowerCase() == DeepLinkNavigation.NAVIGATE.name) {
await Future.delayed(Duration(seconds: 1));
navigationType = DeepLinkNavigation.NAVIGATE;
var queryParam = uri.queryParameters;
print("the query params are $queryParam");
initPenguinSDK(
queryParam[projectID] ?? "", queryParam[clinicId] ?? "", context);
removeDeepLinkData();
return;
}
if (uri.path.toLowerCase() == DeepLinkNavigation.APPOINTMENT.name) {
navigationType = DeepLinkNavigation.NAVIGATE;
currentState?.push(FadePage(page: Search()));
removeDeepLinkData();
return;
}
if (uri.path.toLowerCase() == DeepLinkNavigation.LIVE_CARE.name) {
var viewModel = Provider.of(context);
if (viewModel.isLogin) {
currentState?.push(FadePage(page: Search()));
removeDeepLinkData();
return;
} else {}
}
}
void removeDeepLinkData() {
navigationType = null;
uri = null;
}
initPenguinSDK(
String projectId, String clinicID, BuildContext context) async {
AppSharedPreferences sharedPref = AppSharedPreferences();
NavigationClinicDetails data = NavigationClinicDetails();
data.clinicId = clinicID;
data.projectId = projectId;
final bool permited = await AppPermission.askPenguinPermissions();
if (!permited) {
Map<Permission, PermissionStatus> statuses = await [
Permission.location,
Permission.bluetooth,
Permission.bluetoothConnect,
Permission.bluetoothScan,
Permission.activityRecognition,
].request().whenComplete(() async {
final currentLanguage =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
PenguinMethodChannel()
.launch("penguin", currentLanguage, "null", details: data);
});
}
}
}

@ -17,6 +17,7 @@ class LargeAvatar extends StatelessWidget {
LargeAvatar({Key? key, this.name, this.url, this.disableProfileView = false, this.radius = 70.0, this.width = 70, this.height = 60, this.onTap, this.isAppointmentAvatar = false}) : super(key: key);
final String? name;
final Color red = Colors.red;
final String? url;
final bool disableProfileView;
final bool isAppointmentAvatar;

@ -1,7 +1,7 @@
name: diplomaticquarterapp
description: A new Flutter application.
version: 4.6.009+1
version: 4.6.085+4050085
environment:
sdk: ">=3.0.0 <3.13.0"
@ -189,7 +189,9 @@ dependencies:
firebase_crashlytics: ^3.0.0
cloudflare_turnstile: ^2.0.1
app_links: ^6.4.0
device_info_plus: ^10.1.2
# app_links: ^6.4.0
# vital_sign_camera:
# path: ./packages/vital_sign_camera

Loading…
Cancel
Save