1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00:00

feat(mobile): Add pull to refresh to sharing page (#9274)

* Add pull to refresh to sharing page

* Fix format
This commit is contained in:
Dhrumil Shah 2024-05-07 23:52:56 -04:00 committed by GitHub
parent 4e7966c8e8
commit e4b777ecef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -220,51 +220,56 @@ class SharingPage extends HookConsumerWidget {
); );
} }
return Scaffold( return RefreshIndicator(
appBar: ImmichAppBar( onRefresh: () async {
action: sharePartnerButton(), ref.read(sharedAlbumProvider.notifier).getAllSharedAlbums();
), },
body: CustomScrollView( child: Scaffold(
slivers: [ appBar: ImmichAppBar(
SliverToBoxAdapter(child: buildTopBottons()), action: sharePartnerButton(),
if (partner.isNotEmpty) ),
body: CustomScrollView(
slivers: [
SliverToBoxAdapter(child: buildTopBottons()),
if (partner.isNotEmpty)
SliverPadding(
padding: const EdgeInsets.all(12),
sliver: SliverToBoxAdapter(
child: Text(
"partner_page_title",
style: context.textTheme.bodyLarge?.copyWith(
fontWeight: FontWeight.w500,
),
).tr(),
),
),
if (partner.isNotEmpty) PartnerList(partner: partner),
SliverPadding( SliverPadding(
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
sliver: SliverToBoxAdapter( sliver: SliverToBoxAdapter(
child: Text( child: Text(
"partner_page_title", "sharing_page_album",
style: context.textTheme.bodyLarge?.copyWith( style: context.textTheme.bodyLarge?.copyWith(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
).tr(), ).tr(),
), ),
), ),
if (partner.isNotEmpty) PartnerList(partner: partner), SliverLayoutBuilder(
SliverPadding( builder: (context, constraints) {
padding: const EdgeInsets.all(12), if (sharedAlbums.isEmpty) {
sliver: SliverToBoxAdapter( return buildEmptyListIndication();
child: Text( }
"sharing_page_album",
style: context.textTheme.bodyLarge?.copyWith(
fontWeight: FontWeight.w500,
),
).tr(),
),
),
SliverLayoutBuilder(
builder: (context, constraints) {
if (sharedAlbums.isEmpty) {
return buildEmptyListIndication();
}
if (constraints.crossAxisExtent < 600) { if (constraints.crossAxisExtent < 600) {
return buildAlbumList(); return buildAlbumList();
} else { } else {
return buildAlbumGrid(); return buildAlbumGrid();
} }
}, },
), ),
], ],
),
), ),
); );
} }