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