initDeepLinks method
Initialize deep link handling.
Implementation
void initDeepLinks({void Function(String path)? onLink}) {
_deepLinkSubscription?.cancel();
_deepLinkSubscription = DeepLinkHandler.appLinks.uriLinkStream.listen(
(uri) {
final path = DeepLinkHandler._uriToPath(uri);
if (onLink != null) {
onLink(path);
} else {
try {
useRouter().push(path);
} catch (e) {
debugPrint('DeepLinkMixin: Error navigating to $path: $e');
}
}
},
);
}