mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-30 15:06:06 +00:00
Races+SubRaces
This commit is contained in:
parent
2e0dc12243
commit
e845cf7c7f
3 changed files with 105 additions and 14 deletions
|
|
@ -92,3 +92,29 @@ Future<Item> loadChildrenItems(Item item, List<Filter> filters) async {
|
|||
return item;
|
||||
}
|
||||
|
||||
Future<List<RaceItem>> loadRaces() async {
|
||||
final db = await database;
|
||||
var response = await db.query(
|
||||
"Items",
|
||||
where: "ItemType = 'RaceItem'",
|
||||
orderBy: "NormalizedName"
|
||||
);
|
||||
if (response.isNotEmpty) {
|
||||
return itemsFromMapList(response);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Future<List<SubRaceItem>> loadSubRaces(RaceItem race) async {
|
||||
final db = await database;
|
||||
var response = await db.query(
|
||||
"Items",
|
||||
where: "ItemType = 'SubRaceItem' AND ParentLink = ?",
|
||||
whereArgs: [race.id],
|
||||
orderBy: "NormalizedName"
|
||||
);
|
||||
if (response.isNotEmpty) {
|
||||
return itemsFromMapList(response);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue