wip: add try-catch
This commit is contained in:
parent
40e2e75a09
commit
4bdce5e2ba
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:developer';
|
||||||
import 'package:app_links/app_links.dart';
|
import 'package:app_links/app_links.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||||
|
@ -33,6 +34,7 @@ class DeepLinkService {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _handleDeepLink(Uri uri) async {
|
Future<void> _handleDeepLink(Uri uri) async {
|
||||||
|
try {
|
||||||
print('Handling deep link: $uri');
|
print('Handling deep link: $uri');
|
||||||
if (StorageHelper().isRecovered) return;
|
if (StorageHelper().isRecovered) return;
|
||||||
|
|
||||||
|
@ -44,9 +46,14 @@ class DeepLinkService {
|
||||||
if (email.isNotEmpty && token.isNotEmpty) {
|
if (email.isNotEmpty && token.isNotEmpty) {
|
||||||
await _showForgotPasswordScreen(email, token);
|
await _showForgotPasswordScreen(email, token);
|
||||||
}
|
}
|
||||||
|
} catch (e, s) {
|
||||||
|
print('Error handling deep link: $e');
|
||||||
|
log('Error handling', error: e, stackTrace: s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _showForgotPasswordScreen(String email, String token) async {
|
Future<void> _showForgotPasswordScreen(String email, String token) async {
|
||||||
|
try {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
final theme = FlutterFlowTheme.of(StorageHelper().context!);
|
final theme = FlutterFlowTheme.of(StorageHelper().context!);
|
||||||
final screen = ForgotPasswordScreen(email: email, token: token);
|
final screen = ForgotPasswordScreen(email: email, token: token);
|
||||||
|
@ -66,6 +73,10 @@ class DeepLinkService {
|
||||||
print('showModalBottomSheet completed');
|
print('showModalBottomSheet completed');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
} catch (e, s) {
|
||||||
|
print('Error showing forgot password screen: $e');
|
||||||
|
log('Error handling', error: e, stackTrace: s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
|
Loading…
Reference in New Issue