pull/361/head
haroon amjad 5 days ago
parent 0dea7414d9
commit 814b0ccd58

@ -1057,9 +1057,42 @@ class Utils {
return isHavePrivilege;
}
static void openWebView({required String url}) {
Uri uri = Uri.parse(url);
launchUrl(uri, mode: LaunchMode.inAppBrowserView);
static Future<void> openWebView({required String url}) async {
try {
Uri uri = Uri.parse(url);
// Validate URL scheme for in-app browser
if (!uri.hasScheme || (!uri.scheme.startsWith('http'))) {
throw 'Invalid URL scheme. In-app browser only supports HTTP/HTTPS URLs';
}
// Check if URL can be launched
if (await canLaunchUrl(uri)) {
final launched = await launchUrl(
uri,
mode: LaunchMode.externalApplication,
);
if (!launched) {
// Fallback to external browser
await launchUrl(uri, mode: LaunchMode.externalApplication);
}
} else {
// Fallback to external browser
await launchUrl(uri, mode: LaunchMode.externalApplication);
}
} catch (e) {
debugPrint('❌ Failed to open URL: $url - Error: $e');
// Try external browser as last resort
try {
final uri = Uri.parse(url);
await launchUrl(uri, mode: LaunchMode.externalApplication);
} catch (e2) {
debugPrint('❌ Failed to open URL in external browser: $e2');
// Optionally show user-friendly error message
}
}
}
static Color getCardBorderColor(int currentQueueStatus) {

@ -771,7 +771,11 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} else if (apiResponse.messageStatus == 1) {
patientMyDoctorsList = apiResponse.data!;
isPatientMyDoctorsLoading = false;
isMyDoctorsDataToBeLoaded = false;
if (!isTop8) {
isMyDoctorsDataToBeLoaded = false;
}
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);

@ -1063,7 +1063,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
],
).onPress(() {
// myAppointmentsViewModel.getPatientMyDoctors();
myAppointmentsViewModel.setIsMyDoctorsDataToBeLoaded(true);
// myAppointmentsViewModel.setIsMyDoctorsDataToBeLoaded(true);
Navigator.of(context).push(
CustomPageRoute(
page: MyDoctorsPage(),

@ -31,14 +31,14 @@ class LiveCarePermissionService {
Permission.camera,
Permission.microphone,
Permission.notification,
if (Platform.isAndroid) Permission.systemAlertWindow,
// if (Platform.isAndroid) Permission.systemAlertWindow,
]
: <Permission>[
// Permission.camera,
// Permission.microphone,
Permission.notification,
if (Platform.isAndroid) Permission.systemAlertWindow,
];
// if (Platform.isAndroid) Permission.systemAlertWindow,
];
try {
final statuses = await permissions.request();

@ -16,6 +16,7 @@ import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/presentation/home/app_update_page.dart';
import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart';
import 'package:hmg_patient_app_new/presentation/onboarding/onboarding_screen.dart';
import 'package:hmg_patient_app_new/presentation/onboarding/splash_animation_screen.dart';
@ -71,10 +72,10 @@ class _SplashScreenState extends State<SplashPage> {
} else {
if (await Utils.getBoolFromPrefs(CacheConst.firstLaunch)) {
// Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: OnboardingScreen())));
Navigator.of(context).pushReplacement(FadePage(page: OnboardingScreen()));
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: OnboardingScreen()));
} else {
// Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation())));
Navigator.of(context).pushReplacement(FadePage(page: LandingNavigation()));
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: LandingNavigation()));
}
}
});

@ -2,8 +2,8 @@ name: hmg_patient_app_new
description: "New HMG Patient App"
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 0.0.44+45
#version: 0.0.14+1
#version: 0.0.45+46
version: 0.0.14+3
environment:
sdk: ">=3.6.0 <4.0.0"
@ -63,7 +63,8 @@ dependencies:
geolocator: ^14.0.2
dropdown_search: ^6.0.2
google_maps_flutter: ^2.13.1
flutter_zoom_videosdk: 2.1.10
# flutter_zoom_videosdk: 2.1.10
flutter_zoom_videosdk: ^2.5.10
dart_jsonwebtoken: ^3.2.0
dartz: ^0.10.1
equatable: ^2.0.7

Loading…
Cancel
Save