mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Enable swiping between assets (#381)
Enable swiping between assets (#381) Co-authored-by: Alex <alex.tran1502@gmail.com> Co-authored-by: Malte Kiefer <59220985+MalteKiefer@users.noreply.github.com> Co-authored-by: Matthias Rupp <matthias.rupp@posteo.de>
This commit is contained in:
parent
e8d1f89a47
commit
8c184dc4d4
17 changed files with 436 additions and 240 deletions
|
|
@ -3,10 +3,18 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|||
import 'package:immich_mobile/modules/home/ui/thumbnail_image.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ImageGrid extends ConsumerWidget {
|
||||
final List<AssetResponseDto> assetGroup;
|
||||
final List<AssetResponseDto> sortedAssetGroup;
|
||||
|
||||
const ImageGrid({Key? key, required this.assetGroup}) : super(key: key);
|
||||
ImageGrid({
|
||||
Key? key,
|
||||
required this.assetGroup,
|
||||
required this.sortedAssetGroup,
|
||||
}) : super(key: key);
|
||||
|
||||
List<AssetResponseDto> imageSortedList = [];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
|
|
@ -19,12 +27,14 @@ class ImageGrid extends ConsumerWidget {
|
|||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
var assetType = assetGroup[index].type;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {},
|
||||
child: Stack(
|
||||
children: [
|
||||
ThumbnailImage(asset: assetGroup[index]),
|
||||
ThumbnailImage(
|
||||
asset: assetGroup[index],
|
||||
assetList: sortedAssetGroup,
|
||||
),
|
||||
if (assetType != AssetTypeEnum.IMAGE)
|
||||
Positioned(
|
||||
top: 5,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue