Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Domain] Added a model to represent the character birthday.
Added a few date util methods
- Loading branch information
Showing
7 changed files
with
50 additions
and
1 deletion.
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,7 @@ | ||
extension DateTimeExtensions on DateTime { | ||
bool isAfterInclusive(DateTime other) => compareTo(other) >= 0; | ||
|
||
bool isBeforeInclusive(DateTime other) => compareTo(other) <= 0; | ||
|
||
bool isBetweenInclusive(DateTime first, DateTime last) => isAfterInclusive(first) && isBeforeInclusive(last); | ||
} |
15 changes: 15 additions & 0 deletions
15
lib/domain/models/birthdays_per_month/character_birthday_model.dart
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,15 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'character_birthday_model.freezed.dart'; | ||
|
||
@freezed | ||
class CharacterBirthdayModel with _$CharacterBirthdayModel { | ||
const factory CharacterBirthdayModel({ | ||
required String key, | ||
required String name, | ||
required String image, | ||
required DateTime birthday, | ||
required String birthdayString, | ||
required int daysUntilBirthday, | ||
}) = _CharacterBirthdayModel; | ||
} |
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