High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
Refactor homepage widget
Alex8d5626620bcf
diff --git a/mobile/lib/modules/home/ui/immich_sliver_appbar.dart b/mobile/lib/modules/home/ui/immich_sliver_appbar.dartindex 4094257316..ebc9d6d718 100644--- a/mobile/lib/modules/home/ui/immich_sliver_appbar.dart+++ b/mobile/lib/modules/home/ui/immich_sliver_appbar.dart@@ -29,7 +29,6 @@ class ImmichSliverAppBar extends ConsumerWidget {floating: true,pinned: false,snap: false,- // backgroundColor: Colors.grey[200],shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5))),leading: Builder(builder: (BuildContext context) {diff --git a/mobile/lib/modules/home/views/home_page.dart b/mobile/lib/modules/home/views/home_page.dartindex 9152c06a7c..fd2e2baf81 100644--- a/mobile/lib/modules/home/views/home_page.dart+++ b/mobile/lib/modules/home/views/home_page.dart@@ -13,7 +13,6 @@ import 'package:immich_mobile/modules/home/ui/profile_drawer.dart';import 'package:immich_mobile/shared/providers/asset.provider.dart';import 'package:immich_mobile/shared/providers/server_info.provider.dart';import 'package:immich_mobile/shared/providers/websocket.provider.dart';-import 'package:sliver_tools/sliver_tools.dart';class HomePage extends HookConsumerWidget {const HomePage({Key? key}) : super(key: key);@@ -37,6 +36,19 @@ class HomePage extends HookConsumerWidget {ref.read(assetProvider.notifier).getAllAsset();}+ _buildSelectedItemCountIndicator() {+ return isMultiSelectEnable+ ? DisableMultiSelectButton(+ onPressed: ref.watch(homePageStateProvider.notifier).disableMultiSelect,+ selectedItemCount: homePageState.selectedItems.length,+ )+ : Container();+ }++ _buildBottomAppBar() {+ return isMultiSelectEnable ? const ControlBottomAppBar() : Container();+ }+Widget _buildBody() {if (assetGroupByDateTime.isNotEmpty) {int? lastMonth;@@ -70,6 +82,19 @@ class HomePage extends HookConsumerWidget {});}+ _buildSliverAppBar() {+ return isMultiSelectEnable+ ? const SliverToBoxAdapter(+ child: SizedBox(+ height: 70,+ child: null,+ ),+ )+ : ImmichSliverAppBar(+ onPopBack: reloadAllAsset,+ );+ }+return SafeArea(bottom: !isMultiSelectEnable,top: !isMultiSelectEnable,@@ -81,38 +106,17 @@ class HomePage extends HookConsumerWidget {heightScrollThumb: 48.0,child: CustomScrollView(controller: _scrollController,- slivers: [- SliverAnimatedSwitcher(- child: isMultiSelectEnable- ? const SliverToBoxAdapter(- child: SizedBox(- height: 70,- child: null,- ),- )- : ImmichSliverAppBar(- onPopBack: reloadAllAsset,- ),- duration: const Duration(milliseconds: 350),- ),- ..._imageGridGroup- ],+ slivers: [_buildSliverAppBar(), ..._imageGridGroup],),),- isMultiSelectEnable- ? DisableMultiSelectButton(- onPressed: ref.watch(homePageStateProvider.notifier).disableMultiSelect,- selectedItemCount: homePageState.selectedItems.length,- )- : Container(),- isMultiSelectEnable ? const ControlBottomAppBar() : Container(),+ _buildSelectedItemCountIndicator(),+ _buildBottomAppBar(),],),);}return Scaffold(- // key: _scaffoldKey,drawer: const ProfileDrawer(),body: _buildBody(),);diff --git a/mobile/lib/modules/sharing/ui/album_viewer_appbar.dart b/mobile/lib/modules/sharing/ui/album_viewer_appbar.dartindex a88e3ce168..e3ec43ba19 100644--- a/mobile/lib/modules/sharing/ui/album_viewer_appbar.dart+++ b/mobile/lib/modules/sharing/ui/album_viewer_appbar.dart@@ -138,11 +138,13 @@ class AlbumViewerAppbar extends HookConsumerWidget with PreferredSizeWidget {isScrollControlled: false,context: context,builder: (context) {- return Column(- mainAxisSize: MainAxisSize.min,- children: [- _buildBottomSheetActionButton(),- ],+ return SafeArea(+ child: Column(+ mainAxisSize: MainAxisSize.min,+ children: [+ _buildBottomSheetActionButton(),+ ],+ ),);},);