Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Application] Added a refresh event to load the game codes
- Loading branch information
Showing
8 changed files
with
62 additions
and
7 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
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,5 @@ | ||
import 'package:genshindb/domain/models/models.dart'; | ||
|
||
abstract class GameCodeService { | ||
Future<List<GameCodeModel>> getAllGameCodes(); | ||
} |
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,25 @@ | ||
import 'package:intl/intl.dart'; | ||
|
||
class DateUtils { | ||
static const String defaultFormat = 'dd/MM/yyyy hh:mm:ss a'; | ||
static const String twentyFourHoursFormat = 'dd/MM/yyyy HH:mm:ss'; | ||
static const String dayMonthYearFormat = 'dd/MM/yyyy'; | ||
|
||
static String formatDate( | ||
DateTime date, { | ||
String locale, | ||
String format = defaultFormat, | ||
}) { | ||
if (date == null) { | ||
return 'N/A'; | ||
} | ||
final formatter = DateFormat(format, locale); | ||
final formatted = formatter.format(date); | ||
return formatted; | ||
} | ||
|
||
static String formatDateMilitaryTime(DateTime date, {bool useTwentyFourHoursFormat = false}) { | ||
final format = useTwentyFourHoursFormat ? twentyFourHoursFormat : defaultFormat; | ||
return formatDate(date, format: format); | ||
} | ||
} |