Line data Source code
1 : // ignore_for_file: constant_identifier_names
2 :
3 : import 'package:localization/localization.dart';
4 :
5 : class NotificationModel {
6 : final NotificationCategory category;
7 : final String text;
8 : final DateTime time;
9 :
10 0 : NotificationModel(
11 : {required this.category, required this.text, required this.time});
12 : }
13 :
14 : enum NotificationCategory { DAILY_PRACTICE, MILESTONE, TIPS, ENCOURAGING }
15 :
16 : extension ToString on NotificationCategory {
17 0 : String getCategoryName() => switch (this) {
18 0 : NotificationCategory.DAILY_PRACTICE => "notifications.daily_practice".i18n(),
19 0 : NotificationCategory.MILESTONE => "notifications.milestone".i18n(),
20 0 : NotificationCategory.TIPS => "notifications.tips".i18n(),
21 0 : NotificationCategory.ENCOURAGING => "notifications.encouraging".i18n(),
22 0 : _ => "notifications.other".i18n(),
23 : };
24 : }
|