WIP
This commit is contained in:
parent
d6e8e8f777
commit
f115f767fe
|
@ -12,9 +12,11 @@ import 'package:hub/pages/pets_page/pets_page_widget.dart';
|
|||
import 'package:hub/pages/provisional_schedule_page/provisional_schedule_widget.dart';
|
||||
import 'package:hub/pages/reception_page/reception_page_widget.dart';
|
||||
import 'package:hub/pages/reservation_page/reservation_page_widget.dart';
|
||||
|
||||
import 'package:hub/shared/utils/storage_util.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../shared/utils/dialog_util.dart';
|
||||
import '/backend/schema/structs/index.dart';
|
||||
import '/flutter_flow/flutter_flow_util.dart';
|
||||
import '/index.dart';
|
||||
|
@ -84,11 +86,18 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
|||
FFRoute(
|
||||
name: '_initialize',
|
||||
path: '/',
|
||||
builder: (context, _) => isLogged && haveDevUUID && haveUserUUID
|
||||
builder: (context, _) {
|
||||
try {
|
||||
return isLogged && haveDevUUID && haveUserUUID
|
||||
? haveLocal == true
|
||||
? const HomePageWidget()
|
||||
: const ReceptionPageWidget()
|
||||
: const WelcomePageWidget()
|
||||
: const WelcomePageWidget();
|
||||
} catch (e) {
|
||||
DialogUtil.error(context, e.toString());
|
||||
return const WelcomePageWidget();
|
||||
}
|
||||
},
|
||||
),
|
||||
FFRoute(
|
||||
name: 'forgotPassword',
|
||||
|
|
|
@ -32,9 +32,9 @@ void main() async {
|
|||
|
||||
Future<void> initializeApp() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await _initializeStorageHelpers();
|
||||
await _initializeTracking();
|
||||
await _initializeStorageHelpers();
|
||||
|
||||
await _initializeFirebase();
|
||||
await _initializeNotificationService();
|
||||
_initializeUrlStrategy();
|
||||
|
@ -43,7 +43,6 @@ Future<void> initializeApp() async {
|
|||
}
|
||||
Future<void> _initializeStorageHelpers() async {
|
||||
await StorageUtil().ensureInitialization();
|
||||
// StorageUtil().isLogged = false;
|
||||
}
|
||||
Future<void> _initializeTracking() async {
|
||||
await AppTrackingTransparency.requestTrackingAuthorization();
|
||||
|
|
|
@ -224,8 +224,8 @@ class StorageUtil {
|
|||
bool get haveLocal => _haveLocal;
|
||||
set haveLocal(bool value) {
|
||||
_haveLocal = value;
|
||||
_secureStorage.set(
|
||||
'ff_have_local', value ?? false, (v) => _haveLocal = value);
|
||||
_secureStorage.set('ff_have_local', value ?? false, (v) => _haveLocal = value);
|
||||
|
||||
}
|
||||
|
||||
String? _fingerprintPass;
|
||||
|
|
Loading…
Reference in New Issue