-
-
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 some models for the monsters
- Loading branch information
Showing
11 changed files
with
107 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
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,3 @@ | ||
enum MonsterFilterType { | ||
name, | ||
} |
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,11 @@ | ||
enum MonsterType { | ||
all, | ||
abyssOrder, | ||
elementalLifeForm, | ||
human, | ||
magicalBeast, | ||
boss, | ||
hilichurl, | ||
fatui, | ||
automaton, | ||
} |
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:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:genshindb/domain/assets.dart'; | ||
import 'package:genshindb/domain/enums/enums.dart'; | ||
|
||
part 'monster_file_model.freezed.dart'; | ||
part 'monster_file_model.g.dart'; | ||
|
||
@freezed | ||
abstract class MonsterFileModel implements _$MonsterFileModel { | ||
@late | ||
String get fullImagePath => Assets.getMonsterImgPath(image); | ||
|
||
factory MonsterFileModel({ | ||
@required String key, | ||
@required String image, | ||
@required MonsterType type, | ||
@required bool isComingSoon, | ||
@required List<String> drops, | ||
}) = _MonsterFileModel; | ||
|
||
MonsterFileModel._(); | ||
|
||
factory MonsterFileModel.fromJson(Map<String, dynamic> json) => _$MonsterFileModelFromJson(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:genshindb/domain/models/models.dart'; | ||
|
||
part 'monsters_file.freezed.dart'; | ||
part 'monsters_file.g.dart'; | ||
|
||
@freezed | ||
abstract class MonstersFile implements _$MonstersFile { | ||
factory MonstersFile({ | ||
@required List<MonsterFileModel> monsters, | ||
}) = _MonstersFile; | ||
|
||
MonstersFile._(); | ||
|
||
factory MonstersFile.fromJson(Map<String, dynamic> json) => _$MonstersFileFromJson(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
16 changes: 16 additions & 0 deletions
16
lib/domain/models/db/translations/translation_monster_file.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,16 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'translation_monster_file.freezed.dart'; | ||
part 'translation_monster_file.g.dart'; | ||
|
||
@freezed | ||
abstract class TranslationMonsterFile implements _$TranslationMonsterFile { | ||
factory TranslationMonsterFile({ | ||
@required String key, | ||
@required String name, | ||
}) = _TranslationMonsterFile; | ||
|
||
const TranslationMonsterFile._(); | ||
|
||
factory TranslationMonsterFile.fromJson(Map<String, dynamic> json) => _$TranslationMonsterFileFromJson(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:genshindb/domain/enums/enums.dart'; | ||
|
||
class MonsterCardModel { | ||
final String key; | ||
final String image; | ||
final String name; | ||
final MonsterType type; | ||
final bool isComingSoon; | ||
|
||
MonsterCardModel({ | ||
@required this.key, | ||
@required this.image, | ||
@required this.name, | ||
@required this.type, | ||
@required this.isComingSoon, | ||
}); | ||
} |
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