Skip to content

Commit

Permalink
feat: Handle multiple deeplink call
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Mar 4, 2024
1 parent ded0eca commit 278a264
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions lib/splash/view/splash_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,24 @@ class _SplashViewState extends State<SplashView> {

bool isPolygonFunctionCalled = false;

String? _deeplink;

Future<void> processIncomingUri(Uri? uri, BuildContext context) async {
final l10n = context.l10n;
String beaconData = '';
bool isBeaconRequest = false;

Timer.periodic(const Duration(seconds: 3), (timer) {
timer.cancel();
_deeplink = null;
});

if (_deeplink != null && _deeplink == uri.toString()) {
return;
}

_deeplink = uri.toString();

if (uri.toString().startsWith('${Urls.appDeepLink}/dashboard')) {
await Navigator.pushAndRemoveUntil<void>(
context,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dependencies:
flutter_olm: ^1.4.1
flutter_openssl_crypto: ^0.3.0
flutter_svg: ^2.0.6
google_fonts: ^6.1.0
google_fonts: 6.1.0
#google_mlkit_face_detection: ^0.5.0
google_mlkit_barcode_scanning: ^0.10.0
image: ^4.0.17
Expand Down

0 comments on commit 278a264

Please sign in to comment.