-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
AhsanSarwar45
committed
Sep 10, 2024
1 parent
120ee4c
commit b305b81
Showing
20 changed files
with
516 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:clock_app/alarm/types/alarm.dart'; | ||
import 'package:clock_app/alarm/types/alarm_event.dart'; | ||
import 'package:clock_app/common/types/list_filter.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
|
||
final List<ListSortOption<AlarmEvent>> alarmEventSortOptions = [ | ||
ListSortOption((context) => "Earlies start date", sortStartDateAscending), | ||
ListSortOption((context) => "Latest start date", sortStartDateDescending), | ||
ListSortOption((context) => "Earlies event date", sortEventDateAscending), | ||
ListSortOption((context) => "Latest event date", sortEventDateDescending), | ||
]; | ||
|
||
int sortStartDateAscending(AlarmEvent a, AlarmEvent b) { | ||
return a.startDate.compareTo(b.startDate); | ||
} | ||
|
||
int sortStartDateDescending(AlarmEvent a, AlarmEvent b) { | ||
return b.startDate.compareTo(a.startDate); | ||
} | ||
|
||
int sortEventDateAscending(AlarmEvent a, AlarmEvent b) { | ||
return a.eventTime.compareTo(b.eventTime); | ||
} | ||
|
||
int sortEventDateDescending(AlarmEvent a, AlarmEvent b) { | ||
return b.eventTime.compareTo(a.eventTime); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:clock_app/alarm/types/alarm_event.dart'; | ||
import 'package:clock_app/common/types/list_filter.dart'; | ||
import 'package:clock_app/common/utils/date_time.dart'; | ||
import 'package:clock_app/debug/types/log.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
import 'package:logger/logger.dart'; | ||
|
||
final List<ListFilterItem<Log>> logListFilters = [ | ||
ListFilterSelect((context) => AppLocalizations.of(context)!.dateFilterGroup, [ | ||
ListFilter((context) => AppLocalizations.of(context)!.todayFilter, | ||
(log) => log.dateTime.isToday()), | ||
ListFilter((context) => AppLocalizations.of(context)!.tomorrowFilter, | ||
(log) => log.dateTime.isTomorrow()), | ||
]), | ||
ListFilterMultiSelect( | ||
(context) => AppLocalizations.of(context)!.logTypeFilterGroup, [ | ||
ListFilter((context) => "Debug", (log) => log.level == Level.debug), | ||
ListFilter((context) => "Trace", (log) => log.level == Level.trace), | ||
ListFilter((context) => "Info", (log) => log.level == Level.info), | ||
ListFilter((context) => "Warning", (log) => log.level == Level.warning), | ||
ListFilter((context) => "Error", (log) => log.level == Level.error), | ||
ListFilter((context) => "Fatal", (log) => log.level == Level.fatal), | ||
]), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:clock_app/common/types/list_filter.dart'; | ||
import 'package:clock_app/debug/types/log.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
|
||
final List<ListSortOption<Log>> logSortOptions = [ | ||
ListSortOption((context) => "Earlies first", sortDateAscending), | ||
ListSortOption((context) => "Latest first", sortDateDescending), | ||
]; | ||
|
||
int sortDateAscending(Log a, Log b) { | ||
return a.id.compareTo(b.id); | ||
} | ||
|
||
int sortDateDescending(Log a, Log b) { | ||
return b.id.compareTo(a.id); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.