chore(mobile): minor UI tweak (#3021)

* chore(mobile): minor UI tweak

* fix test

* refactor
This commit is contained in:
Alex 2023-06-28 22:33:57 -05:00 committed by GitHub
parent e5908f2508
commit 8e6c90e294
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 116 additions and 91 deletions

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
class GroupDividerTitle extends ConsumerWidget {
@ -20,6 +21,7 @@ class GroupDividerTitle extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
void handleTitleIconClick() {
HapticFeedback.heavyImpact();
if (selected) {
onDeselect();
} else {
@ -30,7 +32,7 @@ class GroupDividerTitle extends ConsumerWidget {
return Padding(
padding: const EdgeInsets.only(
top: 12.0,
bottom: 4.0,
bottom: 16.0,
left: 12.0,
right: 12.0,
),

View file

@ -19,6 +19,45 @@ typedef ImmichAssetGridSelectionListener = void Function(
Set<Asset>,
);
class ImmichAssetGridView extends StatefulWidget {
final RenderList renderList;
final int assetsPerRow;
final double margin;
final bool showStorageIndicator;
final ImmichAssetGridSelectionListener? listener;
final bool selectionActive;
final Future<void> Function()? onRefresh;
final Set<Asset>? preselectedAssets;
final bool canDeselect;
final bool dynamicLayout;
final bool showMultiSelectIndicator;
final void Function(ItemPosition start, ItemPosition end)?
visibleItemsListener;
final Widget? topWidget;
const ImmichAssetGridView({
super.key,
required this.renderList,
required this.assetsPerRow,
required this.showStorageIndicator,
this.listener,
this.margin = 5.0,
this.selectionActive = false,
this.onRefresh,
this.preselectedAssets,
this.canDeselect = true,
this.dynamicLayout = true,
this.showMultiSelectIndicator = true,
this.visibleItemsListener,
this.topWidget,
});
@override
State<StatefulWidget> createState() {
return ImmichAssetGridViewState();
}
}
class ImmichAssetGridViewState extends State<ImmichAssetGridView> {
final ItemScrollController _itemScrollController = ItemScrollController();
final ItemPositionsListener _itemPositionsListener =
@ -383,42 +422,3 @@ class ImmichAssetGridViewState extends State<ImmichAssetGridView> {
);
}
}
class ImmichAssetGridView extends StatefulWidget {
final RenderList renderList;
final int assetsPerRow;
final double margin;
final bool showStorageIndicator;
final ImmichAssetGridSelectionListener? listener;
final bool selectionActive;
final Future<void> Function()? onRefresh;
final Set<Asset>? preselectedAssets;
final bool canDeselect;
final bool dynamicLayout;
final bool showMultiSelectIndicator;
final void Function(ItemPosition start, ItemPosition end)?
visibleItemsListener;
final Widget? topWidget;
const ImmichAssetGridView({
super.key,
required this.renderList,
required this.assetsPerRow,
required this.showStorageIndicator,
this.listener,
this.margin = 5.0,
this.selectionActive = false,
this.onRefresh,
this.preselectedAssets,
this.canDeselect = true,
this.dynamicLayout = true,
this.showMultiSelectIndicator = true,
this.visibleItemsListener,
this.topWidget,
});
@override
State<StatefulWidget> createState() {
return ImmichAssetGridViewState();
}
}

View file

@ -71,8 +71,8 @@ class HomePageAppBar extends ConsumerWidget implements PreferredSizeWidget {
),
if (serverInfoState.isVersionMismatch)
Positioned(
bottom: 12,
right: 12,
bottom: 4,
right: 6,
child: GestureDetector(
onTap: () => Scaffold.of(context).openDrawer(),
child: Material(