Fix bug with missing year and add date to drag handle (#761)

This commit is contained in:
Matthias Rupp 2022-09-29 17:19:55 +02:00 committed by GitHub
parent 96b9e37461
commit 87ca031335
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 13 deletions

View file

@ -22,16 +22,14 @@ class RenderAssetGridElement {
final RenderAssetGridElementType type;
final RenderAssetGridRow? assetRow;
final String? title;
final int? month;
final int? year;
final DateTime date;
final List<AssetResponseDto>? relatedAssetList;
RenderAssetGridElement(
this.type, {
this.assetRow,
this.title,
this.month,
this.year,
required this.date,
this.relatedAssetList,
});
}
@ -51,7 +49,7 @@ final renderListProvider = StateProvider((ref) {
if (lastDate == null || lastDate!.month != date.month) {
elements.add(
RenderAssetGridElement(RenderAssetGridElementType.monthTitle,
title: groupName, month: date.month, year: date.year),
title: groupName, date: date),
);
}
@ -60,8 +58,7 @@ final renderListProvider = StateProvider((ref) {
RenderAssetGridElement(
RenderAssetGridElementType.dayTitle,
title: groupName,
month: date.month,
year: date.year,
date: date,
relatedAssetList: assets,
),
);
@ -73,8 +70,7 @@ final renderListProvider = StateProvider((ref) {
final rowElement = RenderAssetGridElement(
RenderAssetGridElementType.assetRow,
month: date.month,
year: date.year,
date: date,
assetRow: RenderAssetGridRow(
assets.sublist(cursor, cursor + rowElements),
),