WIP: debug tests
This commit is contained in:
parent
dbac63d2ea
commit
c2d54b6b3f
|
@ -10,6 +10,7 @@
|
|||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_channel_id"
|
||||
android:value="@string/default_notification_channel_id" />
|
||||
<meta-data android:name="flutter_deeplinking_enabled" android:value="false" />
|
||||
<application
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:label="FRE ACCESS HUB"
|
||||
|
|
|
@ -22,6 +22,7 @@ import 'package:hub/shared/helpers/base_storage.dart';
|
|||
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||
import 'package:hub/shared/services/localization/localization_service.dart';
|
||||
import 'package:hub/shared/utils/device_util.dart';
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:responsive_framework/responsive_framework.dart';
|
||||
|
||||
import 'backend/notifications/firebase_messaging_service.dart';
|
||||
|
@ -181,16 +182,22 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
|||
};
|
||||
|
||||
Future<void> initDeepLinks() async {
|
||||
_appLinks = AppLinks();
|
||||
_linkSubscription = _appLinks.uriLinkStream.listen((uri) {
|
||||
final bool isRecovered = StorageHelper().isRecovered;
|
||||
if (!isRecovered) openAppLink(uri);
|
||||
});
|
||||
try {
|
||||
_appLinks = AppLinks();
|
||||
_linkSubscription = _appLinks.uriLinkStream.listen((uri) async {
|
||||
final bool isRecovered = StorageHelper().isRecovered;
|
||||
await DialogUtil.error(context, 'isRecovered: $isRecovered');
|
||||
if (!isRecovered) await openAppLink(uri);
|
||||
});
|
||||
} catch (e) {
|
||||
await DialogUtil.error(context, 'Erro ao tentar abrir o link');
|
||||
}
|
||||
}
|
||||
|
||||
void openAppLink(Uri uri) {
|
||||
Future<void> openAppLink(Uri uri) async {
|
||||
final bool isRecovered = StorageHelper().isRecovered;
|
||||
log('isRecovered: $isRecovered');
|
||||
await DialogUtil.warning(context, 'isRecovered: $isRecovered');
|
||||
if (isRecovered) return;
|
||||
StorageHelper().isRecovered = true;
|
||||
final String email = uri.queryParameters['email'] ?? '';
|
||||
|
@ -201,7 +208,8 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
|||
final FlutterFlowTheme theme = FlutterFlowTheme.of(context);
|
||||
final Widget screen = ForgotPasswordScreen(email: email, token: token);
|
||||
builder(context) => screen;
|
||||
showModalBottomSheet(
|
||||
await DialogUtil.warning(context, 'Builder: $builder');
|
||||
await showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) => Padding(padding: MediaQuery.viewInsetsOf(context), child: builder(context)),
|
||||
isScrollControlled: true,
|
||||
|
@ -211,7 +219,10 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
|||
useSafeArea: true,
|
||||
enableDrag: true,
|
||||
// isDismissible: true,
|
||||
).whenComplete(() => StorageHelper().isRecovered = false);
|
||||
).whenComplete(() async {
|
||||
StorageHelper().isRecovered = false;
|
||||
await DialogUtil.success(context, 'isRecovered: ${StorageHelper().isRecovered}');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,7 +277,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
|||
const Duration(milliseconds: 1000), () => setState(() => _appStateNotifier.stopShowingSplashImage()));
|
||||
|
||||
_setupFirebaseMessaging();
|
||||
WidgetsBinding.instance.addPersistentFrameCallback((_) => initDeepLinks());
|
||||
WidgetsBinding.instance.addPersistentFrameCallback((_) async => await initDeepLinks());
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -281,7 +292,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
|||
if (state == AppLifecycleState.detached) {
|
||||
await LocalizationService.processLocals(context);
|
||||
FirebaseMessagingService().updateDeviceToken();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -10,10 +10,11 @@ class StorageHelper {
|
|||
StorageHelper._internal();
|
||||
|
||||
late BuildContext? _context;
|
||||
late bool _isRecovered = false;
|
||||
|
||||
BuildContext? get context => _context;
|
||||
set context(BuildContext? context) => _context = context;
|
||||
|
||||
late bool _isRecovered = false;
|
||||
bool get isRecovered => _isRecovered;
|
||||
set isRecovered(bool isRecovered) => _isRecovered = isRecovered;
|
||||
|
||||
|
|
Loading…
Reference in New Issue