diff --git a/lib/features/home/presentation/pages/home_page.dart b/lib/features/home/presentation/pages/home_page.dart index 066d994f..350ae9a2 100644 --- a/lib/features/home/presentation/pages/home_page.dart +++ b/lib/features/home/presentation/pages/home_page.dart @@ -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 Function(BuildContext context)? update; @override diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index a62e5d2a..25209384 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -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 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))),