2022-04-24 04:08:45 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
2022-08-03 07:04:34 +02:00
|
|
|
import 'package:immich_mobile/modules/album/ui/selection_thumbnail_image.dart';
|
2022-11-08 19:00:24 +02:00
|
|
|
import 'package:immich_mobile/shared/models/asset.dart';
|
2022-04-24 04:08:45 +02:00
|
|
|
|
|
|
|
class AssetGridByMonth extends HookConsumerWidget {
|
2022-11-08 19:00:24 +02:00
|
|
|
final List<Asset> assetGroup;
|
2022-06-25 22:12:47 +02:00
|
|
|
const AssetGridByMonth({Key? key, required this.assetGroup})
|
|
|
|
: super(key: key);
|
2022-04-24 04:08:45 +02:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
|
return SliverGrid(
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
crossAxisCount: 4,
|
|
|
|
crossAxisSpacing: 5.0,
|
|
|
|
mainAxisSpacing: 5,
|
|
|
|
),
|
|
|
|
delegate: SliverChildBuilderDelegate(
|
|
|
|
(BuildContext context, int index) {
|
|
|
|
return SelectionThumbnailImage(asset: assetGroup[index]);
|
|
|
|
},
|
|
|
|
childCount: assetGroup.length,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|