This commit is contained in:
Hamza-Ayed
2024-07-23 15:58:11 +03:00
parent 485928d8c1
commit 74abae1b38
5 changed files with 457 additions and 227 deletions

View File

@@ -5,7 +5,7 @@ import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:SEFER/views/auth/login_page.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:uni_links/uni_links.dart';
// import 'package:uni_links/uni_links.dart';
import '../../constant/box_name.dart';
import '../../main.dart';
@@ -32,27 +32,27 @@ class SplashScreenController extends GetxController
}
StreamSubscription? _sub;
Future<void> initUniLinks() async {
// Handle initial URI if the app was launched from a link
try {
final initialUri = await getInitialUri();
if (initialUri != null) {
handleLink(initialUri);
}
} on PlatformException {
// Handle exception by warning the user their action did not succeed
print("Failed to get initial uri");
}
// Future<void> initUniLinks() async {
// // Handle initial URI if the app was launched from a link
// try {
// final initialUri = await getInitialUri();
// if (initialUri != null) {
// handleLink(initialUri);
// }
// } on PlatformException {
// // Handle exception by warning the user their action did not succeed
// print("Failed to get initial uri");
// }
// Listen to new links while the app is running
_sub = uriLinkStream.listen((Uri? uri) {
if (uri != null) {
handleLink(uri);
}
}, onError: (Object err) {
print('Error occurred: $err');
});
}
// // Listen to new links while the app is running
// _sub = uriLinkStream.listen((Uri? uri) {
// if (uri != null) {
// handleLink(uri);
// }
// }, onError: (Object err) {
// print('Error occurred: $err');
// });
// }
void handleLink(Uri uri) {
if (uri.host == 'sefer.live' && uri.path == '/tripmonitor') {
@@ -76,7 +76,7 @@ class SplashScreenController extends GetxController
void onInit() async {
super.onInit();
checkForUpdate();
initUniLinks();
// initUniLinks();
animationController = AnimationController(
vsync: this,
duration: const Duration(seconds: 4),