-
-
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.
[Domain] Added a model to backup game codes
- Loading branch information
Showing
4 changed files
with
32 additions
and
0 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 |
---|---|---|
|
@@ -4,5 +4,6 @@ enum AppBackupDataType { | |
calculatorAscMaterials, | ||
tierList, | ||
customBuilds, | ||
gameCodes, | ||
notifications, | ||
} |
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,29 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'backup_game_code_model.freezed.dart'; | ||
part 'backup_game_code_model.g.dart'; | ||
|
||
@freezed | ||
class BackupGameCodeModel with _$BackupGameCodeModel { | ||
const factory BackupGameCodeModel({ | ||
required String code, | ||
DateTime? usedOn, | ||
DateTime? discoveredOn, | ||
DateTime? expiredOn, | ||
required bool isExpired, | ||
int? region, | ||
@Default(<BackupGameCodeRewardModel>[]) List<BackupGameCodeRewardModel> rewards, | ||
}) = _BackupGameCodeModel; | ||
|
||
factory BackupGameCodeModel.fromJson(Map<String, dynamic> json) => _$BackupGameCodeModelFromJson(json); | ||
} | ||
|
||
@freezed | ||
class BackupGameCodeRewardModel with _$BackupGameCodeRewardModel { | ||
const factory BackupGameCodeRewardModel({ | ||
required String itemKey, | ||
required int quantity, | ||
}) = _BackupGameCodeRewardModel; | ||
|
||
factory BackupGameCodeRewardModel.fromJson(Map<String, dynamic> json) => _$BackupGameCodeRewardModelFromJson(json); | ||
} |
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