|
|
|
|
@ -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';
|
|
|
|
|
@ -14,8 +16,6 @@ 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 +59,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 +92,29 @@ 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");
|
|
|
|
|
// locator<NavigationService>().navigatorKey.currentState?.pushNamed(uri.fragment);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
PlatformBridge.init(context);
|
|
|
|
|
|