1
0
Fork 0
mirror of https://gitlab.com/nkming2/nc-photos.git synced 2025-03-12 02:08:53 +01:00
nc-photos/lib/widget/photo_list_helper.dart

21 lines
500 B
Dart
Raw Normal View History

2021-10-04 15:53:03 +02:00
import 'package:nc_photos/entity/file.dart';
class PhotoListDateGroupHelper {
PhotoListDateGroupHelper({
required this.isMonthOnly,
});
DateTime? onFile(File file) {
final newDate = file.bestDateTime.toLocal();
if (newDate.year != _currentDate?.year ||
newDate.month != _currentDate?.month ||
(!isMonthOnly && newDate.day != _currentDate?.day)) {
_currentDate = newDate;
return newDate;
}
}
final bool isMonthOnly;
DateTime? _currentDate;
}