mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-24 23:02:26 +00:00
34 lines
748 B
Dart
34 lines
748 B
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
class LoadEventsParam extends Equatable {
|
|
final DateTime startDate;
|
|
final DateTime endDate;
|
|
final String id;
|
|
|
|
const LoadEventsParam({
|
|
required this.startDate,
|
|
required this.endDate,
|
|
required this.id,
|
|
});
|
|
|
|
@override
|
|
List<Object?> get props => [startDate, endDate, id];
|
|
|
|
LoadEventsParam copyWith({
|
|
DateTime? startDate,
|
|
DateTime? endDate,
|
|
String? id,
|
|
}) {
|
|
return LoadEventsParam(
|
|
startDate: startDate ?? this.startDate,
|
|
endDate: endDate ?? this.endDate,
|
|
id: id ?? this.id,
|
|
);
|
|
}
|
|
}
|
|
|
|
extension KeyGenerator on LoadEventsParam {
|
|
String generateKey() {
|
|
return '$id-${startDate.year}-${startDate.month.toString().padLeft(2, '0')}';
|
|
}
|
|
} |