fix: exibir modal de seleção ao reabrir o app sem local vinculado
This commit is contained in:
parent
eec6df0951
commit
bc0ef37a60
|
@ -12,10 +12,7 @@ import 'package:hub/shared/components/molecules/menu/index.dart';
|
|||
|
||||
|
||||
class HomePageWidget extends StatefulWidget {
|
||||
const HomePageWidget({
|
||||
super.key,
|
||||
this.update,
|
||||
});
|
||||
const HomePageWidget(this.update, {super.key});
|
||||
final Future<bool> Function(BuildContext context)? update;
|
||||
|
||||
@override
|
||||
|
|
|
@ -31,6 +31,7 @@ import 'package:hub/pages/sign_up_page/sign_up_page_widget.dart';
|
|||
import 'package:hub/pages/vehicles_on_the_property/vehicles_on_the_property.dart';
|
||||
import 'package:hub/pages/visits_on_the_property/visits_on_the_property_screen.dart';
|
||||
import 'package:hub/pages/welcome_page/welcome_page_widget.dart';
|
||||
import 'package:hub/shared/components/molecules/locals/data/repositories/locals_repository_impl.dart';
|
||||
import 'package:hub/shared/helpers/storage/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage/storage_helper.dart';
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
|
@ -91,7 +92,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
|||
final bool haveDevUUID = (await StorageHelper().get(KeychainStorageKey.devUUID.value))?.isNotEmpty ?? false;
|
||||
|
||||
if (isLogged && haveDevUUID && haveUserUUID) {
|
||||
return haveLocal ? const HomePageWidget() : const ReceptionPageWidget();
|
||||
return haveLocal ? HomePageWidget(LocalsRepositoryImpl().update) : const ReceptionPageWidget();
|
||||
} else {
|
||||
return const WelcomePageWidget();
|
||||
}
|
||||
|
@ -124,7 +125,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) {
|
|||
}),
|
||||
FFRoute(name: 'homePage', path: '/homePage', builder: (context, params) {
|
||||
final Future<bool> Function(BuildContext context)? update = params.getParam('update', ParamType.Function);
|
||||
return HomePageWidget(key: UniqueKey(), update: update);
|
||||
return HomePageWidget(key: UniqueKey(), update);
|
||||
|
||||
}),
|
||||
FFRoute(name: 'petsOnThePropertyPage', path: '/petsOnThePropertyPage', builder: (context, params) => Scaffold(body: const PetsHistoryScreen(isApp: true))),
|
||||
|
|
Loading…
Reference in New Issue