wip: add try-catch

This commit is contained in:
J. A. Messias 2024-11-18 17:22:27 -03:00
parent 40e2e75a09
commit 4bdce5e2ba
1 changed files with 37 additions and 26 deletions

View File

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