-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from Wolfteam/feature/game_codes_improvements
feature/game_codes_improvements
- Loading branch information
Showing
36 changed files
with
686 additions
and
738 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
export 'entities/calculator/calculator_character_skill.dart'; | ||
export 'entities/calculator/calculator_item.dart'; | ||
export 'entities/calculator/calculator_session.dart'; | ||
export 'entities/game_code/used_game_code.dart'; | ||
export 'entities/game_code/game_code.dart'; | ||
export 'entities/game_code/game_code_reward.dart'; | ||
export 'entities/inventory/inventory_item.dart'; | ||
export 'entities/inventory/inventory_used_item.dart'; | ||
export 'entities/tierlist/tierlist_item.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,26 @@ | ||
import 'package:hive/hive.dart'; | ||
|
||
part 'game_code.g.dart'; | ||
|
||
@HiveType(typeId: 6) | ||
class GameCode extends HiveObject { | ||
@HiveField(0) | ||
final String code; | ||
|
||
@HiveField(1) | ||
DateTime usedOn; | ||
|
||
@HiveField(2) | ||
DateTime discoveredOn; | ||
|
||
@HiveField(3) | ||
DateTime expiredOn; | ||
|
||
@HiveField(4) | ||
bool isExpired; | ||
|
||
@HiveField(5) | ||
int region; | ||
|
||
GameCode(this.code, this.usedOn, this.discoveredOn, this.expiredOn, this.isExpired, this.region); | ||
} |
17 changes: 17 additions & 0 deletions
17
lib/domain/models/entities/game_code/game_code_reward.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,17 @@ | ||
import 'package:hive/hive.dart'; | ||
|
||
part 'game_code_reward.g.dart'; | ||
|
||
@HiveType(typeId: 8) | ||
class GameCodeReward extends HiveObject { | ||
@HiveField(0) | ||
final int gameCodeKey; | ||
|
||
@HiveField(1) | ||
final String itemKey; | ||
|
||
@HiveField(2) | ||
final int quantity; | ||
|
||
GameCodeReward(this.gameCodeKey, this.itemKey, this.quantity); | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,16 +1,25 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:genshindb/domain/enums/enums.dart'; | ||
import 'package:genshindb/domain/models/models.dart'; | ||
|
||
class GameCodeModel { | ||
final String code; | ||
final AppServerResetTimeType region; | ||
|
||
final DateTime discoveredOn; | ||
final DateTime expiredOn; | ||
final bool isExpired; | ||
|
||
final bool isUsed; | ||
final List<ItemAscensionMaterialModel> rewards; | ||
|
||
GameCodeModel({ | ||
@required this.code, | ||
@required this.isExpired, | ||
@required this.isUsed, | ||
@required this.rewards, | ||
@required this.isExpired, | ||
@required this.discoveredOn, | ||
this.expiredOn, | ||
this.region, | ||
}); | ||
} |
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); | ||
} | ||
} |
Oops, something went wrong.