7/23/2
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user