b
This commit is contained in:
22
lib/features/tasks/models/task_reminder_config.dart
Normal file
22
lib/features/tasks/models/task_reminder_config.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class TaskReminderConfig extends Equatable {
|
||||
final int minutesBefore;
|
||||
final String channel; // 'push' o 'email'
|
||||
|
||||
const TaskReminderConfig({
|
||||
required this.minutesBefore,
|
||||
required this.channel,
|
||||
});
|
||||
|
||||
String get friendlyTime {
|
||||
if (minutesBefore < 60) return '$minutesBefore minuti prima';
|
||||
if (minutesBefore == 60) return '1 ora prima';
|
||||
if (minutesBefore < 1440) return '${minutesBefore ~/ 60} ore prima';
|
||||
if (minutesBefore == 1440) return '1 giorno prima';
|
||||
return '${minutesBefore ~/ 1440} giorni prima';
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [minutesBefore, channel];
|
||||
}
|
||||
Reference in New Issue
Block a user