mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-29 22:45:44 +00:00 
			
		
		
		
	Localisations
This commit is contained in:
		
							parent
							
								
									512adf99d8
								
							
						
					
					
						commit
						bc8bb68a28
					
				
					 15 changed files with 1002 additions and 73 deletions
				
			
		|  | @ -1,6 +1,7 @@ | ||||||
| import 'dart:io'; | import 'dart:io'; | ||||||
| 
 | 
 | ||||||
| import 'package:aidedejeu_flutter/models/items.dart'; | import 'package:aidedejeu_flutter/models/items.dart'; | ||||||
|  | import 'package:flutter/cupertino.dart'; | ||||||
| import 'package:flutter/services.dart'; | import 'package:flutter/services.dart'; | ||||||
| import 'package:path/path.dart'; | import 'package:path/path.dart'; | ||||||
| import 'package:sqflite/sqflite.dart'; | import 'package:sqflite/sqflite.dart'; | ||||||
|  | @ -40,7 +41,7 @@ Future<Database> getDatabaseInstance() async { | ||||||
|   return await openDatabase(path, readOnly: true); |   return await openDatabase(path, readOnly: true); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Future<Item> getItemWithId(String id) async { | Future<Item> getItemWithId(BuildContext context, String id) async { | ||||||
|   print("getItemWithId " + id); |   print("getItemWithId " + id); | ||||||
|   final db = await database; |   final db = await database; | ||||||
|   var response = await db.query( |   var response = await db.query( | ||||||
|  | @ -51,10 +52,10 @@ Future<Item> getItemWithId(String id) async { | ||||||
|   if (response.isEmpty) { |   if (response.isEmpty) { | ||||||
|     print("Id not found"); |     print("Id not found"); | ||||||
|   } |   } | ||||||
|   return response.isNotEmpty ? itemFromMap(response.first) : null; |   return response.isNotEmpty ? itemFromMap(context, response.first) : null; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Future<Item> loadChildrenItems(Item item, List<Filter> filters) async { | Future<Item> loadChildrenItems(BuildContext context, Item item, List<Filter> filters) async { | ||||||
|   print("getChildrenItems " + (item?.itemType ?? "")); |   print("getChildrenItems " + (item?.itemType ?? "")); | ||||||
|   if (item.itemType.endsWith("Items")) { |   if (item.itemType.endsWith("Items")) { | ||||||
|     String itemType = |     String itemType = | ||||||
|  | @ -86,13 +87,13 @@ Future<Item> loadChildrenItems(Item item, List<Filter> filters) async { | ||||||
|       print("Children not found"); |       print("Children not found"); | ||||||
|     } |     } | ||||||
|     item.children = response.isNotEmpty |     item.children = response.isNotEmpty | ||||||
|         ? itemsFromMapList(response) |         ? itemsFromMapList(context, response) | ||||||
|         : null; |         : null; | ||||||
|   } |   } | ||||||
|   return item; |   return item; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Future<List<RaceItem>> loadRaces() async { | Future<List<RaceItem>> loadRaces(BuildContext context) async { | ||||||
|   final db = await database; |   final db = await database; | ||||||
|   var response = await db.query( |   var response = await db.query( | ||||||
|       "Items", |       "Items", | ||||||
|  | @ -100,12 +101,12 @@ Future<List<RaceItem>> loadRaces() async { | ||||||
|       orderBy: "NormalizedName" |       orderBy: "NormalizedName" | ||||||
|   ); |   ); | ||||||
|   if (response.isNotEmpty) { |   if (response.isNotEmpty) { | ||||||
|     return itemsFromMapList(response); |     return itemsFromMapList(context, response); | ||||||
|   } |   } | ||||||
|   return null; |   return null; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Future<List<SubRaceItem>> loadSubRaces(RaceItem race) async { | Future<List<SubRaceItem>> loadSubRaces(BuildContext context, RaceItem race) async { | ||||||
|   final db = await database; |   final db = await database; | ||||||
|   var response = await db.query( |   var response = await db.query( | ||||||
|       "Items", |       "Items", | ||||||
|  | @ -114,12 +115,12 @@ Future<List<SubRaceItem>> loadSubRaces(RaceItem race) async { | ||||||
|       orderBy: "NormalizedName" |       orderBy: "NormalizedName" | ||||||
|   ); |   ); | ||||||
|   if (response.isNotEmpty) { |   if (response.isNotEmpty) { | ||||||
|     return itemsFromMapList(response); |     return itemsFromMapList(context, response); | ||||||
|   } |   } | ||||||
|   return null; |   return null; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Future<List<T>> loadTypedItems<T extends Item>({String itemType, Item item = null}) async { | Future<List<T>> loadTypedItems<T extends Item>(BuildContext context, {String itemType, Item item = null}) async { | ||||||
|   final db = await database; |   final db = await database; | ||||||
|   var response = await db.query( |   var response = await db.query( | ||||||
|       "Items", |       "Items", | ||||||
|  | @ -128,16 +129,16 @@ Future<List<T>> loadTypedItems<T extends Item>({String itemType, Item item = nul | ||||||
|       orderBy: "NormalizedName" |       orderBy: "NormalizedName" | ||||||
|   ); |   ); | ||||||
|   if (response.isNotEmpty) { |   if (response.isNotEmpty) { | ||||||
|     return itemsFromMapList(response); |     return itemsFromMapList(context, response); | ||||||
|   } |   } | ||||||
|   return null; |   return null; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Future<List<BackgroundItem>> loadBackgrounds() async { | Future<List<BackgroundItem>> loadBackgrounds(BuildContext context) async { | ||||||
|   return loadTypedItems<BackgroundItem>(itemType: "BackgroundItem"); |   return loadTypedItems<BackgroundItem>(context, itemType: "BackgroundItem"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Future<List<SubBackgroundItem>> loadSubBackgrounds(Item item) async { | Future<List<SubBackgroundItem>> loadSubBackgrounds(BuildContext context, Item item) async { | ||||||
|   return loadTypedItems<SubBackgroundItem>(itemType: "SubBackgroundItem", item: item); |   return loadTypedItems<SubBackgroundItem>(context, itemType: "SubBackgroundItem", item: item); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| { | { | ||||||
|   "@@locale": "en", |   "@@locale": "en", | ||||||
|   "appTitle": "Hello World", |   "appTitle": "Axes & Dices", | ||||||
|   "@appTitle": { |   "@appTitle": { | ||||||
|     "description": "Title for the application", |     "description": "Title for the application", | ||||||
|     "type": "text", |     "type": "text", | ||||||
|  | @ -53,5 +53,161 @@ | ||||||
|     "description": "Title for the Class page", |     "description": "Title for the Class page", | ||||||
|     "type": "text", |     "type": "text", | ||||||
|     "placeholders": {} |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "abilitiesTitle": "Abilities", | ||||||
|  |   "@abilitiesTitle": { | ||||||
|  |     "description": "Title for the Abilities page", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "othersTitle": "Others", | ||||||
|  |   "@othersTitle": { | ||||||
|  |     "description": "Title for the Others page", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceAbilityScoreIncrease": "Ability Score Increase", | ||||||
|  |   "@raceAbilityScoreIncrease": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceAge": "Age", | ||||||
|  |   "@raceAge": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceAlignment": "Alignment", | ||||||
|  |   "@raceAlignment": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceSize": "Size", | ||||||
|  |   "@raceSize": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceSpeed": "Speed", | ||||||
|  |   "@raceSpeed": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceDarkvision": "Darkvision", | ||||||
|  |   "@raceDarkvision": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceLanguages": "Languages", | ||||||
|  |   "@raceLanguages": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersTypes": "Types", | ||||||
|  |   "@monstersTypes": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersChallenges": "Challenges", | ||||||
|  |   "@monstersChallenges": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersSizes": "Sizes", | ||||||
|  |   "@monstersSizes": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersSources": "Sources", | ||||||
|  |   "@monstersSources": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersTerrains": "Terrains", | ||||||
|  |   "@monstersTerrains": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsClasses": "Classes", | ||||||
|  |   "@spellsClasses": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsLevels": "Levels", | ||||||
|  |   "@spellsLevels": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsSchools": "Schools", | ||||||
|  |   "@spellsSchools": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsRituals": "Rituals", | ||||||
|  |   "@spellsRituals": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsCastingTimes": "Casting Times", | ||||||
|  |   "@spellsCastingTimes": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsRanges": "Ranges", | ||||||
|  |   "@spellsRanges": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsVerbalComponents": "Verbal Components", | ||||||
|  |   "@spellsVerbalComponents": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsSomaticComponents": "Somatic Components", | ||||||
|  |   "@spellsSomaticComponents": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsMaterialComponents": "Material Components", | ||||||
|  |   "@spellsMaterialComponents": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsConcentrations": "Concentrations", | ||||||
|  |   "@spellsConcentrations": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsDurations": "Durations", | ||||||
|  |   "@spellsDurations": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsSources": "Sources", | ||||||
|  |   "@spellsSources": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| { | { | ||||||
|   "@@locale": "fr", |   "@@locale": "fr", | ||||||
|   "appTitle": "Bonjour Monde", |   "appTitle": "Haches & Dés", | ||||||
|   "@appTitle": { |   "@appTitle": { | ||||||
|     "description": "Title for the application", |     "description": "Title for the application", | ||||||
|     "type": "text", |     "type": "text", | ||||||
|  | @ -53,5 +53,161 @@ | ||||||
|     "description": "Title for the Class page", |     "description": "Title for the Class page", | ||||||
|     "type": "text", |     "type": "text", | ||||||
|     "placeholders": {} |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "abilitiesTitle": "Caractéristiques", | ||||||
|  |   "@abilitiesTitle": { | ||||||
|  |     "description": "Title for the Abilities page", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "othersTitle": "Autres", | ||||||
|  |   "@othersTitle": { | ||||||
|  |     "description": "Title for the Others page", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceAbilityScoreIncrease": "Augmentation de caractéristiques", | ||||||
|  |   "@raceAbilityScoreIncrease": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceAge": "Âge", | ||||||
|  |   "@raceAge": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceAlignment": "Alignement", | ||||||
|  |   "@raceAlignment": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceSize": "Taille", | ||||||
|  |   "@raceSize": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceSpeed": "Vitesse", | ||||||
|  |   "@raceSpeed": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceDarkvision": "Vision dans le noir", | ||||||
|  |   "@raceDarkvision": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceLanguages": "Langues", | ||||||
|  |   "@raceLanguages": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersTypes": "Types", | ||||||
|  |   "@monstersTypes": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersChallenges": "Dangerosités", | ||||||
|  |   "@monstersChallenges": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersSizes": "Tailles", | ||||||
|  |   "@monstersSizes": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersSources": "Sources", | ||||||
|  |   "@monstersSources": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersTerrains": "Terrains", | ||||||
|  |   "@monstersTerrains": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsClasses": "Classes", | ||||||
|  |   "@spellsClasses": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsLevels": "Niveaux", | ||||||
|  |   "@spellsLevels": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsSchools": "Écoles", | ||||||
|  |   "@spellsSchools": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsRituals": "Rituels", | ||||||
|  |   "@spellsRituals": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsCastingTimes": "Temps d'incantation", | ||||||
|  |   "@spellsCastingTimes": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsRanges": "Portées", | ||||||
|  |   "@spellsRanges": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsVerbalComponents": "Composantes Verbales", | ||||||
|  |   "@spellsVerbalComponents": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsSomaticComponents": "Composantes Somatiques", | ||||||
|  |   "@spellsSomaticComponents": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsMaterialComponents": "Composantes Matérielles", | ||||||
|  |   "@spellsMaterialComponents": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsConcentrations": "Concentrations", | ||||||
|  |   "@spellsConcentrations": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsDurations": "Durées", | ||||||
|  |   "@spellsDurations": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsSources": "Sources", | ||||||
|  |   "@spellsSources": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| { | { | ||||||
|   "@@last_modified": "2020-03-03T11:00:06.908535", |   "@@last_modified": "2020-03-05T15:58:18.683548", | ||||||
|   "appTitle": "Hello World", |   "appTitle": "Axes & Dices", | ||||||
|   "@appTitle": { |   "@appTitle": { | ||||||
|     "description": "Title for the application", |     "description": "Title for the application", | ||||||
|     "type": "text", |     "type": "text", | ||||||
|  | @ -53,5 +53,161 @@ | ||||||
|     "description": "Title for the Class page", |     "description": "Title for the Class page", | ||||||
|     "type": "text", |     "type": "text", | ||||||
|     "placeholders": {} |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "abilitiesTitle": "Abilities", | ||||||
|  |   "@abilitiesTitle": { | ||||||
|  |     "description": "Title for the Abilities page", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "othersTitle": "Others", | ||||||
|  |   "@othersTitle": { | ||||||
|  |     "description": "Title for the Others page", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceAbilityScoreIncrease": "Ability Score Increase", | ||||||
|  |   "@raceAbilityScoreIncrease": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceAge": "Age", | ||||||
|  |   "@raceAge": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceAlignment": "Alignment", | ||||||
|  |   "@raceAlignment": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceSize": "Size", | ||||||
|  |   "@raceSize": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceSpeed": "Speed", | ||||||
|  |   "@raceSpeed": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceDarkvision": "Darkvision", | ||||||
|  |   "@raceDarkvision": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "raceLanguages": "Languages", | ||||||
|  |   "@raceLanguages": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersTypes": "Types", | ||||||
|  |   "@monstersTypes": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersChallenges": "Challenges", | ||||||
|  |   "@monstersChallenges": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersSizes": "Sizes", | ||||||
|  |   "@monstersSizes": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersSources": "Sources", | ||||||
|  |   "@monstersSources": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "monstersTerrains": "Terrains", | ||||||
|  |   "@monstersTerrains": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsClasses": "Classes", | ||||||
|  |   "@spellsClasses": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsLevels": "Levels", | ||||||
|  |   "@spellsLevels": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsSchools": "Schools", | ||||||
|  |   "@spellsSchools": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsRituals": "Rituals", | ||||||
|  |   "@spellsRituals": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsCastingTimes": "Casting Times", | ||||||
|  |   "@spellsCastingTimes": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsRanges": "Ranges", | ||||||
|  |   "@spellsRanges": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsVerbalComponents": "Verbal Components", | ||||||
|  |   "@spellsVerbalComponents": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsSomaticComponents": "Somatic Components", | ||||||
|  |   "@spellsSomaticComponents": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsMaterialComponents": "Material Components", | ||||||
|  |   "@spellsMaterialComponents": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsConcentrations": "Concentrations", | ||||||
|  |   "@spellsConcentrations": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsDurations": "Durations", | ||||||
|  |   "@spellsDurations": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|  |   }, | ||||||
|  |   "spellsSources": "Sources", | ||||||
|  |   "@spellsSources": { | ||||||
|  |     "description": "", | ||||||
|  |     "type": "text", | ||||||
|  |     "placeholders": {} | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | @ -21,14 +21,40 @@ class MessageLookup extends MessageLookupByLibrary { | ||||||
| 
 | 
 | ||||||
|   final messages = _notInlinedMessages(_notInlinedMessages); |   final messages = _notInlinedMessages(_notInlinedMessages); | ||||||
|   static _notInlinedMessages(_) => <String, Function> { |   static _notInlinedMessages(_) => <String, Function> { | ||||||
|  |     "abilitiesTitle" : MessageLookupByLibrary.simpleMessage("Abilities"), | ||||||
|     "aboutTitle" : MessageLookupByLibrary.simpleMessage("About..."), |     "aboutTitle" : MessageLookupByLibrary.simpleMessage("About..."), | ||||||
|     "appTitle" : MessageLookupByLibrary.simpleMessage("Hello World"), |     "appTitle" : MessageLookupByLibrary.simpleMessage("Axes & Dices"), | ||||||
|     "backgroundTitle" : MessageLookupByLibrary.simpleMessage("Background"), |     "backgroundTitle" : MessageLookupByLibrary.simpleMessage("Background"), | ||||||
|     "bookmarksTitle" : MessageLookupByLibrary.simpleMessage("Bookmarks"), |     "bookmarksTitle" : MessageLookupByLibrary.simpleMessage("Bookmarks"), | ||||||
|     "classTitle" : MessageLookupByLibrary.simpleMessage("Class"), |     "classTitle" : MessageLookupByLibrary.simpleMessage("Class"), | ||||||
|     "libraryTitle" : MessageLookupByLibrary.simpleMessage("Library"), |     "libraryTitle" : MessageLookupByLibrary.simpleMessage("Library"), | ||||||
|  |     "monstersChallenges" : MessageLookupByLibrary.simpleMessage("Challenges"), | ||||||
|  |     "monstersSizes" : MessageLookupByLibrary.simpleMessage("Sizes"), | ||||||
|  |     "monstersSources" : MessageLookupByLibrary.simpleMessage("Sources"), | ||||||
|  |     "monstersTerrains" : MessageLookupByLibrary.simpleMessage("Terrains"), | ||||||
|  |     "monstersTypes" : MessageLookupByLibrary.simpleMessage("Types"), | ||||||
|  |     "othersTitle" : MessageLookupByLibrary.simpleMessage("Others"), | ||||||
|     "pceditorTitle" : MessageLookupByLibrary.simpleMessage("Player Characters"), |     "pceditorTitle" : MessageLookupByLibrary.simpleMessage("Player Characters"), | ||||||
|  |     "raceAbilityScoreIncrease" : MessageLookupByLibrary.simpleMessage("Ability Score Increase"), | ||||||
|  |     "raceAge" : MessageLookupByLibrary.simpleMessage("Age"), | ||||||
|  |     "raceAlignment" : MessageLookupByLibrary.simpleMessage("Alignment"), | ||||||
|  |     "raceDarkvision" : MessageLookupByLibrary.simpleMessage("Darkvision"), | ||||||
|  |     "raceLanguages" : MessageLookupByLibrary.simpleMessage("Languages"), | ||||||
|  |     "raceSize" : MessageLookupByLibrary.simpleMessage("Size"), | ||||||
|  |     "raceSpeed" : MessageLookupByLibrary.simpleMessage("Speed"), | ||||||
|     "raceTitle" : MessageLookupByLibrary.simpleMessage("Race"), |     "raceTitle" : MessageLookupByLibrary.simpleMessage("Race"), | ||||||
|     "searchTitle" : MessageLookupByLibrary.simpleMessage("Search") |     "searchTitle" : MessageLookupByLibrary.simpleMessage("Search"), | ||||||
|  |     "spellsCastingTimes" : MessageLookupByLibrary.simpleMessage("Casting Times"), | ||||||
|  |     "spellsClasses" : MessageLookupByLibrary.simpleMessage("Classes"), | ||||||
|  |     "spellsConcentrations" : MessageLookupByLibrary.simpleMessage("Concentrations"), | ||||||
|  |     "spellsDurations" : MessageLookupByLibrary.simpleMessage("Durations"), | ||||||
|  |     "spellsLevels" : MessageLookupByLibrary.simpleMessage("Levels"), | ||||||
|  |     "spellsMaterialComponents" : MessageLookupByLibrary.simpleMessage("Material Components"), | ||||||
|  |     "spellsRanges" : MessageLookupByLibrary.simpleMessage("Ranges"), | ||||||
|  |     "spellsRituals" : MessageLookupByLibrary.simpleMessage("Rituals"), | ||||||
|  |     "spellsSchools" : MessageLookupByLibrary.simpleMessage("Schools"), | ||||||
|  |     "spellsSomaticComponents" : MessageLookupByLibrary.simpleMessage("Somatic Components"), | ||||||
|  |     "spellsSources" : MessageLookupByLibrary.simpleMessage("Sources"), | ||||||
|  |     "spellsVerbalComponents" : MessageLookupByLibrary.simpleMessage("Verbal Components") | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -21,14 +21,40 @@ class MessageLookup extends MessageLookupByLibrary { | ||||||
| 
 | 
 | ||||||
|   final messages = _notInlinedMessages(_notInlinedMessages); |   final messages = _notInlinedMessages(_notInlinedMessages); | ||||||
|   static _notInlinedMessages(_) => <String, Function> { |   static _notInlinedMessages(_) => <String, Function> { | ||||||
|  |     "abilitiesTitle" : MessageLookupByLibrary.simpleMessage("Caractéristiques"), | ||||||
|     "aboutTitle" : MessageLookupByLibrary.simpleMessage("A propos de..."), |     "aboutTitle" : MessageLookupByLibrary.simpleMessage("A propos de..."), | ||||||
|     "appTitle" : MessageLookupByLibrary.simpleMessage("Bonjour Monde"), |     "appTitle" : MessageLookupByLibrary.simpleMessage("Haches & Dés"), | ||||||
|     "backgroundTitle" : MessageLookupByLibrary.simpleMessage("Historique"), |     "backgroundTitle" : MessageLookupByLibrary.simpleMessage("Historique"), | ||||||
|     "bookmarksTitle" : MessageLookupByLibrary.simpleMessage("Favoris"), |     "bookmarksTitle" : MessageLookupByLibrary.simpleMessage("Favoris"), | ||||||
|     "classTitle" : MessageLookupByLibrary.simpleMessage("Classe"), |     "classTitle" : MessageLookupByLibrary.simpleMessage("Classe"), | ||||||
|     "libraryTitle" : MessageLookupByLibrary.simpleMessage("Bibliothèque"), |     "libraryTitle" : MessageLookupByLibrary.simpleMessage("Bibliothèque"), | ||||||
|  |     "monstersChallenges" : MessageLookupByLibrary.simpleMessage("Dangerosités"), | ||||||
|  |     "monstersSizes" : MessageLookupByLibrary.simpleMessage("Tailles"), | ||||||
|  |     "monstersSources" : MessageLookupByLibrary.simpleMessage("Sources"), | ||||||
|  |     "monstersTerrains" : MessageLookupByLibrary.simpleMessage("Terrains"), | ||||||
|  |     "monstersTypes" : MessageLookupByLibrary.simpleMessage("Types"), | ||||||
|  |     "othersTitle" : MessageLookupByLibrary.simpleMessage("Autres"), | ||||||
|     "pceditorTitle" : MessageLookupByLibrary.simpleMessage("Personnages"), |     "pceditorTitle" : MessageLookupByLibrary.simpleMessage("Personnages"), | ||||||
|  |     "raceAbilityScoreIncrease" : MessageLookupByLibrary.simpleMessage("Augmentation de caractéristiques"), | ||||||
|  |     "raceAge" : MessageLookupByLibrary.simpleMessage("Âge"), | ||||||
|  |     "raceAlignment" : MessageLookupByLibrary.simpleMessage("Alignement"), | ||||||
|  |     "raceDarkvision" : MessageLookupByLibrary.simpleMessage("Vision dans le noir"), | ||||||
|  |     "raceLanguages" : MessageLookupByLibrary.simpleMessage("Langues"), | ||||||
|  |     "raceSize" : MessageLookupByLibrary.simpleMessage("Taille"), | ||||||
|  |     "raceSpeed" : MessageLookupByLibrary.simpleMessage("Vitesse"), | ||||||
|     "raceTitle" : MessageLookupByLibrary.simpleMessage("Race"), |     "raceTitle" : MessageLookupByLibrary.simpleMessage("Race"), | ||||||
|     "searchTitle" : MessageLookupByLibrary.simpleMessage("Recherche") |     "searchTitle" : MessageLookupByLibrary.simpleMessage("Recherche"), | ||||||
|  |     "spellsCastingTimes" : MessageLookupByLibrary.simpleMessage("Temps d\'incantation"), | ||||||
|  |     "spellsClasses" : MessageLookupByLibrary.simpleMessage("Classes"), | ||||||
|  |     "spellsConcentrations" : MessageLookupByLibrary.simpleMessage("Concentrations"), | ||||||
|  |     "spellsDurations" : MessageLookupByLibrary.simpleMessage("Durées"), | ||||||
|  |     "spellsLevels" : MessageLookupByLibrary.simpleMessage("Niveaux"), | ||||||
|  |     "spellsMaterialComponents" : MessageLookupByLibrary.simpleMessage("Composantes Matérielles"), | ||||||
|  |     "spellsRanges" : MessageLookupByLibrary.simpleMessage("Portées"), | ||||||
|  |     "spellsRituals" : MessageLookupByLibrary.simpleMessage("Rituels"), | ||||||
|  |     "spellsSchools" : MessageLookupByLibrary.simpleMessage("Écoles"), | ||||||
|  |     "spellsSomaticComponents" : MessageLookupByLibrary.simpleMessage("Composantes Somatiques"), | ||||||
|  |     "spellsSources" : MessageLookupByLibrary.simpleMessage("Sources"), | ||||||
|  |     "spellsVerbalComponents" : MessageLookupByLibrary.simpleMessage("Composantes Verbales") | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -23,7 +23,7 @@ class AppLocalizations { | ||||||
| 
 | 
 | ||||||
|   String get appTitle { |   String get appTitle { | ||||||
|     return Intl.message( |     return Intl.message( | ||||||
|       'Hello World', |       'Axes & Dices', | ||||||
|       name: 'appTitle', |       name: 'appTitle', | ||||||
|       desc: 'Title for the application', |       desc: 'Title for the application', | ||||||
|       locale: localeName, |       locale: localeName, | ||||||
|  | @ -120,6 +120,219 @@ class AppLocalizations { | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   String get raceAbilityScoreIncrease { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Ability Score Increase', | ||||||
|  |       name: 'raceAbilityScoreIncrease', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get raceAge { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Age', | ||||||
|  |       name: 'raceAge', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get raceAlignment { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Alignment', | ||||||
|  |       name: 'raceAlignment', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get raceSize { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Size', | ||||||
|  |       name: 'raceSize', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get raceSpeed { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Speed', | ||||||
|  |       name: 'raceSpeed', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get raceDarkvision { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Darkvision', | ||||||
|  |       name: 'raceDarkvision', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get raceLanguages { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Languages', | ||||||
|  |       name: 'raceLanguages', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get monstersTypes { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Types', | ||||||
|  |       name: 'monstersTypes', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get monstersChallenges { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Challenges', | ||||||
|  |       name: 'monstersChallenges', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  |   String get monstersSizes { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Sizes', | ||||||
|  |       name: 'monstersSizes', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  |   String get monstersSources { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Sources', | ||||||
|  |       name: 'monstersSources', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  |   String get monstersTerrains { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Terrains', | ||||||
|  |       name: 'monstersTerrains', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |   String get spellsClasses { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Classes', | ||||||
|  |       name: 'spellsClasses', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get spellsLevels { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Levels', | ||||||
|  |       name: 'spellsLevels', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get spellsSchools { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Schools', | ||||||
|  |       name: 'spellsSchools', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get spellsRituals { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Rituals', | ||||||
|  |       name: 'spellsRituals', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get spellsCastingTimes { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Casting Times', | ||||||
|  |       name: 'spellsCastingTimes', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get spellsRanges { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Ranges', | ||||||
|  |       name: 'spellsRanges', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get spellsVerbalComponents { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Verbal Components', | ||||||
|  |       name: 'spellsVerbalComponents', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get spellsSomaticComponents { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Somatic Components', | ||||||
|  |       name: 'spellsSomaticComponents', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get spellsMaterialComponents { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Material Components', | ||||||
|  |       name: 'spellsMaterialComponents', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get spellsConcentrations { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Concentrations', | ||||||
|  |       name: 'spellsConcentrations', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get spellsDurations { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Durations', | ||||||
|  |       name: 'spellsDurations', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   String get spellsSources { | ||||||
|  |     return Intl.message( | ||||||
|  |       'Sources', | ||||||
|  |       name: 'spellsSources', | ||||||
|  |       desc: '', | ||||||
|  |       locale: localeName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,4 +1,6 @@ | ||||||
|  | import 'package:aidedejeu_flutter/localization.dart'; | ||||||
| import 'package:aidedejeu_flutter/models/filters.dart'; | import 'package:aidedejeu_flutter/models/filters.dart'; | ||||||
|  | import 'package:flutter/cupertino.dart'; | ||||||
| 
 | 
 | ||||||
| class Item { | class Item { | ||||||
|   String id; |   String id; | ||||||
|  | @ -84,6 +86,38 @@ class MonsterItem extends Item { | ||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | class SpellItem extends Item { | ||||||
|  |   String family; | ||||||
|  |   String level; | ||||||
|  |   String type; | ||||||
|  |   String ritual; | ||||||
|  |   String castingTime; | ||||||
|  |   String range; | ||||||
|  |   String components; | ||||||
|  |   String verbalComponent; | ||||||
|  |   String somaticComponent; | ||||||
|  |   String materialComponent; | ||||||
|  |   String concentration; | ||||||
|  |   String duration; | ||||||
|  |   String classes; | ||||||
|  | 
 | ||||||
|  |   SpellItem(Map<String, dynamic> map) : super(map) { | ||||||
|  |     this.family = map["Family"]; | ||||||
|  |     this.level = map["Level"]; | ||||||
|  |     this.type = map["Type"]; | ||||||
|  |     this.ritual = map["Ritual"]; | ||||||
|  |     this.castingTime = map["CastingTime"]; | ||||||
|  |     this.range = map["Range"]; | ||||||
|  |     this.components = map["Components"]; | ||||||
|  |     this.verbalComponent = map["VerbalComponent"]; | ||||||
|  |     this.somaticComponent = map["SomaticComponent"]; | ||||||
|  |     this.materialComponent = map["MaterialComponent"]; | ||||||
|  |     this.concentration = map["Concentration"]; | ||||||
|  |     this.duration = map["Duration"]; | ||||||
|  |     this.classes = map["Classes"]; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| class Items extends Item { | class Items extends Item { | ||||||
|   Items(Map<String, dynamic> map) : super(map) {} |   Items(Map<String, dynamic> map) : super(map) {} | ||||||
| } | } | ||||||
|  | @ -105,26 +139,25 @@ class MonsterItems extends FilteredItems { | ||||||
|   Filter sources; |   Filter sources; | ||||||
|   Filter terrains; |   Filter terrains; | ||||||
| 
 | 
 | ||||||
|   MonsterItems(Map<String, dynamic> map) : super(map) { |   MonsterItems(BuildContext context, Map<String, dynamic> map) : super(map) { | ||||||
|     this.types = Filter( |     this.types = Filter( | ||||||
|         name: "Type", |         name: AppLocalizations.of(context).monstersTypes, | ||||||
|         type: FilterType.Choices, |         type: FilterType.Choices, | ||||||
|         values: map["Types"].toString().split("|")); |         values: map["Types"].toString().split("|")); | ||||||
|     this.challenges = Filter( |     this.challenges = Filter( | ||||||
|         name: "Challenge", |         name: AppLocalizations.of(context).monstersChallenges, | ||||||
|         type: FilterType.Range, |         type: FilterType.Range, | ||||||
|         values: map["Challenges"].toString().split("|")); |         values: map["Challenges"].toString().split("|")); | ||||||
|     this.sizes = Filter( |     this.sizes = Filter( | ||||||
|         name: "Size", |         name: AppLocalizations.of(context).monstersSizes, | ||||||
|         type: FilterType.Range, |         type: FilterType.Range, | ||||||
|         values: map["Sizes"].toString().split("|")); |         values: map["Sizes"].toString().split("|")); | ||||||
|     ; |  | ||||||
|     this.sources = Filter( |     this.sources = Filter( | ||||||
|         name: "Source", |         name: AppLocalizations.of(context).monstersSources, | ||||||
|         type: FilterType.Choices, |         type: FilterType.Choices, | ||||||
|         values: map["Sources"].toString().split("|")); |         values: map["Sources"].toString().split("|")); | ||||||
|     this.terrains = Filter( |     this.terrains = Filter( | ||||||
|         name: "Terrain", |         name: AppLocalizations.of(context).monstersTerrains, | ||||||
|         type: FilterType.Choices, |         type: FilterType.Choices, | ||||||
|         values: map["Terrains"].toString().split("|")); |         values: map["Terrains"].toString().split("|")); | ||||||
|   } |   } | ||||||
|  | @ -138,6 +171,87 @@ class MonsterItems extends FilteredItems { | ||||||
|       }.toList(); |       }.toList(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | class SpellItems extends FilteredItems { | ||||||
|  |   Filter classes; | ||||||
|  |   Filter levels; | ||||||
|  |   Filter schools; | ||||||
|  |   Filter rituals; | ||||||
|  |   Filter castingTimes; | ||||||
|  |   Filter ranges; | ||||||
|  |   Filter verbalComponents; | ||||||
|  |   Filter somaticComponents; | ||||||
|  |   Filter materialComponents; | ||||||
|  |   Filter concentrations; | ||||||
|  |   Filter durations; | ||||||
|  |   Filter sources; | ||||||
|  | 
 | ||||||
|  |   SpellItems(BuildContext context, Map<String, dynamic> map) : super(map) { | ||||||
|  |     this.classes = Filter( | ||||||
|  |         name: AppLocalizations.of(context).spellsClasses, | ||||||
|  |         type: FilterType.Choices, | ||||||
|  |         values: map["Classes"].toString().split("|")); | ||||||
|  |     this.levels = Filter( | ||||||
|  |         name: AppLocalizations.of(context).spellsLevels, | ||||||
|  |         type: FilterType.Choices, | ||||||
|  |         values: map["Levels"].toString().split("|")); | ||||||
|  |     this.schools = Filter( | ||||||
|  |         name: AppLocalizations.of(context).spellsSchools, | ||||||
|  |         type: FilterType.Choices, | ||||||
|  |         values: map["Schools"].toString().split("|")); | ||||||
|  |     this.rituals = Filter( | ||||||
|  |         name: AppLocalizations.of(context).spellsRituals, | ||||||
|  |         type: FilterType.Choices, | ||||||
|  |         values: map["Rituals"].toString().split("|")); | ||||||
|  |     this.castingTimes = Filter( | ||||||
|  |         name: AppLocalizations.of(context).spellsCastingTimes, | ||||||
|  |         type: FilterType.Choices, | ||||||
|  |         values: map["CastingTimes"].toString().split("|")); | ||||||
|  |     this.ranges = Filter( | ||||||
|  |         name: AppLocalizations.of(context).spellsRanges, | ||||||
|  |         type: FilterType.Choices, | ||||||
|  |         values: map["Ranges"].toString().split("|")); | ||||||
|  |     this.verbalComponents = Filter( | ||||||
|  |         name: AppLocalizations.of(context).spellsVerbalComponents, | ||||||
|  |         type: FilterType.Choices, | ||||||
|  |         values: map["VerbalComponents"].toString().split("|")); | ||||||
|  |     this.somaticComponents = Filter( | ||||||
|  |         name: AppLocalizations.of(context).spellsSomaticComponents, | ||||||
|  |         type: FilterType.Choices, | ||||||
|  |         values: map["SomaticComponents"].toString().split("|")); | ||||||
|  |     this.materialComponents = Filter( | ||||||
|  |         name: AppLocalizations.of(context).spellsMaterialComponents, | ||||||
|  |         type: FilterType.Choices, | ||||||
|  |         values: map["MaterialComponents"].toString().split("|")); | ||||||
|  |     this.concentrations = Filter( | ||||||
|  |         name: AppLocalizations.of(context).spellsConcentrations, | ||||||
|  |         type: FilterType.Choices, | ||||||
|  |         values: map["Concentrations"].toString().split("|")); | ||||||
|  |     this.durations = Filter( | ||||||
|  |         name: AppLocalizations.of(context).spellsDurations, | ||||||
|  |         type: FilterType.Choices, | ||||||
|  |         values: map["Durations"].toString().split("|")); | ||||||
|  |     this.sources = Filter( | ||||||
|  |         name: AppLocalizations.of(context).spellsSources, | ||||||
|  |         type: FilterType.Choices, | ||||||
|  |         values: map["Sources"].toString().split("|")); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   List<Filter> toFilterList() => { | ||||||
|  |         classes, | ||||||
|  |         levels, | ||||||
|  |         schools, | ||||||
|  |         rituals, | ||||||
|  |         castingTimes, | ||||||
|  |         ranges, | ||||||
|  |         verbalComponents, | ||||||
|  |         somaticComponents, | ||||||
|  |         materialComponents, | ||||||
|  |         concentrations, | ||||||
|  |         durations, | ||||||
|  |         sources, | ||||||
|  |       }.toList(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| class RaceItem extends Item { | class RaceItem extends Item { | ||||||
|   String fullName; |   String fullName; | ||||||
|   bool hasSubRaces; |   bool hasSubRaces; | ||||||
|  | @ -205,9 +319,7 @@ class RaceItems extends FilteredItems { | ||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| class BackgroundItem extends Item { | class BackgroundItem extends Item { | ||||||
| 
 |  | ||||||
|   String skillProficiencies; |   String skillProficiencies; | ||||||
|   String masteredTools; |   String masteredTools; | ||||||
|   String masteredLanguages; |   String masteredLanguages; | ||||||
|  | @ -225,7 +337,7 @@ class SubBackgroundItem extends BackgroundItem { | ||||||
|   SubBackgroundItem(Map<String, dynamic> map) : super(map); |   SubBackgroundItem(Map<String, dynamic> map) : super(map); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Item itemFromMap(Map<String, dynamic> map) { | Item itemFromMap(BuildContext context, Map<String, dynamic> map) { | ||||||
|   switch (map["ItemType"]) { |   switch (map["ItemType"]) { | ||||||
|     case "RaceItem": |     case "RaceItem": | ||||||
|       return RaceItem(map); |       return RaceItem(map); | ||||||
|  | @ -240,13 +352,17 @@ Item itemFromMap(Map<String, dynamic> map) { | ||||||
|     case "MonsterItem": |     case "MonsterItem": | ||||||
|       return MonsterItem(map); |       return MonsterItem(map); | ||||||
|     case "MonsterItems": |     case "MonsterItems": | ||||||
|       return MonsterItems(map); |       return MonsterItems(context, map); | ||||||
|  |     case "SpellItem": | ||||||
|  |       return SpellItem(map); | ||||||
|  |     case "SpellItems": | ||||||
|  |       return SpellItems(context, map); | ||||||
|   } |   } | ||||||
|   return Item(map); |   return Item(map); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| List<T> itemsFromMapList<T extends Item>(List<Map<String, dynamic>> mapList) { | List<T> itemsFromMapList<T extends Item>(BuildContext context, List<Map<String, dynamic>> mapList) { | ||||||
|   return List.generate(mapList.length, (i) { |   return List.generate(mapList.length, (i) { | ||||||
|     return itemFromMap(mapList[i]); |     return itemFromMap(context, mapList[i]); | ||||||
|   }); |   }); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -1,6 +1,17 @@ | ||||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||||
| import 'package:flutter_markdown/flutter_markdown.dart'; | import 'package:flutter_markdown/flutter_markdown.dart'; | ||||||
| 
 | 
 | ||||||
|  | const Color colorHDRed = Color(0xFF9B1C47); | ||||||
|  | const Color colorHDBlue = Color(0xFF5B61FF); | ||||||
|  | const Color colorHDGrey = Color(0xFF563F5A); | ||||||
|  | const Color colorHDMidGrey = Color(0xFF6F5B73); | ||||||
|  | const Color colorHDLightGrey = Color(0xFF7C7B7B); | ||||||
|  | const Color colorHDLightBlack = Color(0xFF3A213C); | ||||||
|  | const Color colorHDBackMidGrey = Color(0xFFB5AAB9); | ||||||
|  | const Color colorHDBackLightGrey = Color(0xFFEDEDED); | ||||||
|  | const Color colorHDWhite = Color(0xFFFFFFFF); | ||||||
|  | const Color colorHDBlack = Color(0xFF000000); | ||||||
|  | 
 | ||||||
| ThemeData mainTheme() { | ThemeData mainTheme() { | ||||||
|   return ThemeData( |   return ThemeData( | ||||||
|     primarySwatch: Colors.deepOrange, |     primarySwatch: Colors.deepOrange, | ||||||
|  | @ -15,21 +26,53 @@ ThemeData mainTheme() { | ||||||
|               fontFamily: 'Cinzel')), |               fontFamily: 'Cinzel')), | ||||||
|     ), |     ), | ||||||
|     brightness: Brightness.light, |     brightness: Brightness.light, | ||||||
|     primaryColor: Colors.lightBlue[800], |     primaryColor: colorHDBlack, | ||||||
|     accentColor: Colors.cyan[600], |     accentColor: colorHDRed, | ||||||
|     fontFamily: 'LinuxLibertine', |     fontFamily: 'LinuxLibertine', | ||||||
|     textTheme: TextTheme( |     textTheme: TextTheme( | ||||||
|  |       // p | ||||||
|  |       body1: TextStyle( | ||||||
|  |         fontSize: 15.0, | ||||||
|  |         color: Colors.black, | ||||||
|  |         fontFamily: 'LinuxLibertine', | ||||||
|  |       ), | ||||||
|  |       // h1 | ||||||
|       headline: TextStyle( |       headline: TextStyle( | ||||||
|           fontSize: 28.0, fontWeight: FontWeight.bold, fontFamily: 'Cinzel'), |         fontSize: 30.0, | ||||||
|       title: TextStyle(fontSize: 22.0, fontStyle: FontStyle.normal), |         color: colorHDRed, | ||||||
|       body1: TextStyle(fontSize: 16.0), |         fontWeight: FontWeight.bold, | ||||||
|  |         fontFamily: 'Cinzel-Bold', | ||||||
|  |       ), | ||||||
|  |       // h2 | ||||||
|  |       title: TextStyle( | ||||||
|  |         fontSize: 25.0, | ||||||
|  |         color: Colors.black, | ||||||
|  |         fontWeight: FontWeight.bold, | ||||||
|  |         fontFamily: 'Cinzel-Regular', | ||||||
|  |       ), | ||||||
|  |       // h3 | ||||||
|  |       subhead: TextStyle( | ||||||
|  |         fontSize: 20.0, | ||||||
|  |         color: Colors.black, | ||||||
|  |         fontWeight: FontWeight.bold, | ||||||
|  |         fontFamily: 'Cinzel-Regular', | ||||||
|  |       ), | ||||||
|  |       // h4, h5, h6 | ||||||
|  |       body2: TextStyle( | ||||||
|  |         fontSize: 18.0, | ||||||
|  |         color: Colors.black, | ||||||
|  |         fontWeight: FontWeight.bold, | ||||||
|  |         fontFamily: 'Cinzel-Regular', | ||||||
|  |       ), | ||||||
|     ), |     ), | ||||||
|   ); |   ); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| MarkdownStyleSheet mainMarkdownStyleSheet(BuildContext context) { | MarkdownStyleSheet mainMarkdownStyleSheet(BuildContext context) { | ||||||
|   return MarkdownStyleSheet.fromTheme(Theme.of(context)).copyWith( |   return MarkdownStyleSheet.fromTheme(Theme.of(context)).copyWith( | ||||||
|  |     a: const TextStyle(color: colorHDBlue), | ||||||
|     tableColumnWidth: IntrinsicColumnWidth(), |     tableColumnWidth: IntrinsicColumnWidth(), | ||||||
|     tableCellsPadding: EdgeInsets.all(0.2), |     tableCellsPadding: EdgeInsets.all(1.0), | ||||||
|  |     tableHeadAlign: TextAlign.center, | ||||||
|   ); |   ); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -1,4 +1,5 @@ | ||||||
| import 'package:aidedejeu_flutter/models/items.dart'; | import 'package:aidedejeu_flutter/models/items.dart'; | ||||||
|  | import 'package:aidedejeu_flutter/theme.dart'; | ||||||
| import 'package:flutter/cupertino.dart'; | import 'package:flutter/cupertino.dart'; | ||||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||||
| 
 | 
 | ||||||
|  | @ -20,6 +21,8 @@ class _RangeFilterState extends State<RangeFilter> { | ||||||
|   @override |   @override | ||||||
|   Widget build(BuildContext context) { |   Widget build(BuildContext context) { | ||||||
|     return RangeSlider( |     return RangeSlider( | ||||||
|  |       activeColor: colorHDRed, | ||||||
|  |         inactiveColor: colorHDLightGrey, | ||||||
|         min: 0, |         min: 0, | ||||||
|         max: widget.values.length.toDouble() - 1, |         max: widget.values.length.toDouble() - 1, | ||||||
|         divisions: widget.values.length, |         divisions: widget.values.length, | ||||||
|  | @ -57,11 +60,18 @@ class _ChipListFilterState extends State<ChipListFilter> { | ||||||
|   @override |   @override | ||||||
|   Widget build(BuildContext context) { |   Widget build(BuildContext context) { | ||||||
|     return Wrap( |     return Wrap( | ||||||
|  |       spacing: 0.0, | ||||||
|  |         crossAxisAlignment: WrapCrossAlignment.start, | ||||||
|  |         alignment: WrapAlignment.spaceEvenly, | ||||||
|  |         direction: Axis.horizontal, | ||||||
|  |         runAlignment: WrapAlignment.start, | ||||||
|  |         verticalDirection: VerticalDirection.down, | ||||||
|  | 
 | ||||||
|         children: widget.choices |         children: widget.choices | ||||||
|             .map((choice) => Padding( |             .map((choice) => Padding( | ||||||
|                 padding: const EdgeInsets.all(4.0), |                 padding: const EdgeInsets.fromLTRB(2,0,2,0), | ||||||
|                 child: FilterChip( |                 child: FilterChip( | ||||||
|                   label: Text(choice), |                   label: Text(choice, style: TextStyle(fontSize: 10.0),), | ||||||
|                   backgroundColor: Colors.transparent, |                   backgroundColor: Colors.transparent, | ||||||
|                   shape: StadiumBorder(side: BorderSide()), |                   shape: StadiumBorder(side: BorderSide()), | ||||||
|                   selected: widget.selectedChoices.contains(choice), |                   selected: widget.selectedChoices.contains(choice), | ||||||
|  |  | ||||||
|  | @ -20,6 +20,7 @@ class HomePage extends StatelessWidget { | ||||||
|             FlatButton.icon( |             FlatButton.icon( | ||||||
|               label: Text( |               label: Text( | ||||||
|                 AppLocalizations.of(context).libraryTitle, |                 AppLocalizations.of(context).libraryTitle, | ||||||
|  |                   style: Theme.of(context).textTheme.headline, | ||||||
|               ), |               ), | ||||||
|               icon: SvgPicture.asset( |               icon: SvgPicture.asset( | ||||||
|                 "assets/spell-book.svg", |                 "assets/spell-book.svg", | ||||||
|  | @ -39,6 +40,7 @@ class HomePage extends StatelessWidget { | ||||||
|             FlatButton.icon( |             FlatButton.icon( | ||||||
|               label: Text( |               label: Text( | ||||||
|                 AppLocalizations.of(context).pceditorTitle, |                 AppLocalizations.of(context).pceditorTitle, | ||||||
|  |                 style: Theme.of(context).textTheme.headline, | ||||||
|               ), |               ), | ||||||
|               icon: SvgPicture.asset( |               icon: SvgPicture.asset( | ||||||
|                 "assets/swordman.svg", |                 "assets/swordman.svg", | ||||||
|  | @ -56,6 +58,7 @@ class HomePage extends StatelessWidget { | ||||||
|             FlatButton.icon( |             FlatButton.icon( | ||||||
|               label: Text( |               label: Text( | ||||||
|                 AppLocalizations.of(context).aboutTitle, |                 AppLocalizations.of(context).aboutTitle, | ||||||
|  |                   style: Theme.of(context).textTheme.headline, | ||||||
|               ), |               ), | ||||||
|               icon: SvgPicture.asset( |               icon: SvgPicture.asset( | ||||||
|                 "assets/wooden-sign.svg", |                 "assets/wooden-sign.svg", | ||||||
|  |  | ||||||
|  | @ -54,8 +54,8 @@ class _LibraryPageState extends State<LibraryPage> { | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   Future<Item> _loadItem() async { |   Future<Item> _loadItem() async { | ||||||
|     var item = await getItemWithId(this.widget.id); |     var item = await getItemWithId(context, this.widget.id); | ||||||
|     var items = await loadChildrenItems(item, filters); |     var items = await loadChildrenItems(context, item, filters); | ||||||
|     //setItem(item); |     //setItem(item); | ||||||
|     return item; |     return item; | ||||||
|   } |   } | ||||||
|  | @ -86,8 +86,22 @@ class _LibraryPageState extends State<LibraryPage> { | ||||||
| 
 | 
 | ||||||
|   Widget _buildChildTile(BuildContext context, Item item) { |   Widget _buildChildTile(BuildContext context, Item item) { | ||||||
|     return ListTile( |     return ListTile( | ||||||
|       title: Text(item.name), |       title: Text( | ||||||
|       subtitle: Text(item.aliasText ?? ""), |         item.name, | ||||||
|  |         style: TextStyle( | ||||||
|  |           fontSize: 25.0, | ||||||
|  |           color: colorHDBlue, | ||||||
|  |           fontWeight: FontWeight.bold, | ||||||
|  |           fontFamily: 'Cinzel-Regular', | ||||||
|  |         ), | ||||||
|  |       ), | ||||||
|  |       subtitle: Text(item.aliasText ?? "", | ||||||
|  |         style: TextStyle( | ||||||
|  |           fontSize: 18.0, | ||||||
|  |           color: colorHDLightGrey, | ||||||
|  |           fontWeight: FontWeight.bold, | ||||||
|  |           fontFamily: 'Cinzel-Regular', | ||||||
|  |         ),), | ||||||
|       onTap: () => Navigator.push( |       onTap: () => Navigator.push( | ||||||
|         context, |         context, | ||||||
|         MaterialPageRoute(builder: (context) => LibraryPage(id: item.id)), |         MaterialPageRoute(builder: (context) => LibraryPage(id: item.id)), | ||||||
|  | @ -126,7 +140,9 @@ class _LibraryPageState extends State<LibraryPage> { | ||||||
|         width: 30.0, |         width: 30.0, | ||||||
|         allowDrawingOutsideViewBox: true, |         allowDrawingOutsideViewBox: true, | ||||||
|       ), |       ), | ||||||
|       title: Text(title), |       title: Text(title, style: TextStyle(fontSize: 16.0, | ||||||
|  |         fontWeight: FontWeight.bold, | ||||||
|  |         fontFamily: 'Cinzel-Regular',),), | ||||||
|       activeIcon: SvgPicture.asset( |       activeIcon: SvgPicture.asset( | ||||||
|         assetName, |         assetName, | ||||||
|         height: 40.0, |         height: 40.0, | ||||||
|  | @ -161,7 +177,7 @@ class _LibraryPageState extends State<LibraryPage> { | ||||||
|         setState(() { |         setState(() { | ||||||
|           filter.selectedValues = choices; |           filter.selectedValues = choices; | ||||||
|         }); |         }); | ||||||
|         loadChildrenItems(item, filters).then((value) => { |         loadChildrenItems(context, item, filters).then((value) => { | ||||||
|               setState(() { |               setState(() { | ||||||
|                 this.item = item; |                 this.item = item; | ||||||
|                 this.filters = filters; |                 this.filters = filters; | ||||||
|  | @ -179,7 +195,7 @@ class _LibraryPageState extends State<LibraryPage> { | ||||||
|           setState(() { |           setState(() { | ||||||
|             filter.rangeValues = values; |             filter.rangeValues = values; | ||||||
|           }); |           }); | ||||||
|           loadChildrenItems(item, filters).then((value) => { |           loadChildrenItems(context, item, filters).then((value) => { | ||||||
|                 setState(() { |                 setState(() { | ||||||
|                   this.item = item; |                   this.item = item; | ||||||
|                   this.filters = filters; |                   this.filters = filters; | ||||||
|  | @ -192,13 +208,13 @@ class _LibraryPageState extends State<LibraryPage> { | ||||||
|     return Column(children: <Widget>[ |     return Column(children: <Widget>[ | ||||||
|       Divider( |       Divider( | ||||||
|         color: Colors.blueGrey, |         color: Colors.blueGrey, | ||||||
|         height: 10.0, |         height: 0.0, | ||||||
|       ), |       ), | ||||||
|       Align( |       Align( | ||||||
|         alignment: Alignment.centerLeft, |         alignment: Alignment.centerLeft, | ||||||
|         child: Padding( |         child: Padding( | ||||||
|           padding: const EdgeInsets.all(8.0), |           padding: const EdgeInsets.fromLTRB(8.0,1.0,8.0,1.0), | ||||||
|           child: Text(filter.name), |           child: Text(filter.name, style: TextStyle(fontFamily: "Cinzel"),), | ||||||
|         ), |         ), | ||||||
|       ), |       ), | ||||||
|       Container( |       Container( | ||||||
|  | @ -242,6 +258,7 @@ class _LibraryPageState extends State<LibraryPage> { | ||||||
|             this.indexPage = index; |             this.indexPage = index; | ||||||
|           }); |           }); | ||||||
|         }, |         }, | ||||||
|  |         selectedItemColor: colorHDRed, | ||||||
|         items: _buildBottomNavigationBarItems(), |         items: _buildBottomNavigationBarItems(), | ||||||
|       ), |       ), | ||||||
|       endDrawer: filters != null |       endDrawer: filters != null | ||||||
|  | @ -253,7 +270,7 @@ class _LibraryPageState extends State<LibraryPage> { | ||||||
|             ) |             ) | ||||||
|           : null, |           : null, | ||||||
|       appBar: AppBar( |       appBar: AppBar( | ||||||
|         title: Text(widget.id), |         title: Text(item?.name ?? widget.id), | ||||||
|         actions: filters != null |         actions: filters != null | ||||||
|             ? [ |             ? [ | ||||||
|                 Builder( |                 Builder( | ||||||
|  |  | ||||||
|  | @ -34,31 +34,31 @@ class _PCEditorPageState extends State<PCEditorPage> { | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   void _initRaces() async { |   void _initRaces() async { | ||||||
|     var races = await loadRaces(); |     var races = await loadRaces(context); | ||||||
|     setState(() { |     setState(() { | ||||||
|       _races = races.map((e) => e as RaceItem).toList(); |       _races = races.toList(); | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   void _initSubRaces(RaceItem race) async { |   void _initSubRaces(RaceItem race) async { | ||||||
|     var subRaces = await loadSubRaces(race); |     var subRaces = await loadSubRaces(context, race); | ||||||
|     setState(() { |     setState(() { | ||||||
|       _subRaces = subRaces.map((e) => e as SubRaceItem).toList(); |       _subRaces = subRaces; | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   void _initBackgrounds() async { |   void _initBackgrounds() async { | ||||||
|     var backgrounds = await loadBackgrounds(); |     var backgrounds = await loadBackgrounds(context); | ||||||
|     setState(() { |     setState(() { | ||||||
|       _backgrounds = backgrounds.map((e) => e as BackgroundItem).toList(); |       _backgrounds = backgrounds; | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   void _initSubBackgrounds(BackgroundItem background) async { |   void _initSubBackgrounds(BackgroundItem background) async { | ||||||
|     var subBackgrounds = await loadSubBackgrounds(background); |     var subBackgrounds = await loadSubBackgrounds(context, background); | ||||||
|     setState(() { |     setState(() { | ||||||
|       _subBackgrounds = |       _subBackgrounds = | ||||||
|           subBackgrounds.map((e) => e as SubBackgroundItem).toList(); |           subBackgrounds; | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -168,26 +168,26 @@ class _PCEditorPageState extends State<PCEditorPage> { | ||||||
|         ? Column( |         ? Column( | ||||||
|             crossAxisAlignment: CrossAxisAlignment.start, |             crossAxisAlignment: CrossAxisAlignment.start, | ||||||
|             children: [ |             children: [ | ||||||
|               _buildSubTitle("Augmentation de caractéristiques"), |               _buildSubTitle(AppLocalizations.of(context).raceAbilityScoreIncrease), | ||||||
|               _buildMarkdown(_race?.abilityScoreIncrease), |               _buildMarkdown(_race?.abilityScoreIncrease), | ||||||
|               _buildMarkdown(_subRace?.abilityScoreIncrease), |               _buildMarkdown(_subRace?.abilityScoreIncrease), | ||||||
|               Text(""), |               Text(""), | ||||||
|               _buildSubTitle("Âge"), |               _buildSubTitle(AppLocalizations.of(context).raceAge), | ||||||
|               _buildMarkdown(_race?.age), |               _buildMarkdown(_race?.age), | ||||||
|               Text(""), |               Text(""), | ||||||
|               _buildSubTitle("Alignement"), |               _buildSubTitle(AppLocalizations.of(context).raceAlignment), | ||||||
|               _buildMarkdown(_race?.alignment), |               _buildMarkdown(_race?.alignment), | ||||||
|               Text(""), |               Text(""), | ||||||
|               _buildSubTitle("Taille"), |               _buildSubTitle(AppLocalizations.of(context).raceSize), | ||||||
|               _buildMarkdown(_race?.size), |               _buildMarkdown(_race?.size), | ||||||
|               Text(""), |               Text(""), | ||||||
|               _buildSubTitle("Vitesse"), |               _buildSubTitle(AppLocalizations.of(context).raceSpeed), | ||||||
|               _buildMarkdown(_race?.speed), |               _buildMarkdown(_race?.speed), | ||||||
|  |               _race?.darkvision != null ? Text("") : SizedBox.shrink(), | ||||||
|  |               _race?.darkvision != null ? _buildSubTitle(AppLocalizations.of(context).raceDarkvision) : SizedBox.shrink(), | ||||||
|  |               _race?.darkvision != null ? _buildMarkdown(_race?.darkvision) : SizedBox.shrink(), | ||||||
|               Text(""), |               Text(""), | ||||||
|               _buildSubTitle("Vision dans le noir"), |               _buildSubTitle(AppLocalizations.of(context).raceLanguages), | ||||||
|               _buildMarkdown(_race?.darkvision), |  | ||||||
|               Text(""), |  | ||||||
|               _buildSubTitle("Langues"), |  | ||||||
|               _buildMarkdown(_race?.languages), |               _buildMarkdown(_race?.languages), | ||||||
|             ], |             ], | ||||||
|           ) |           ) | ||||||
|  |  | ||||||
|  | @ -162,7 +162,7 @@ packages: | ||||||
|       name: intl |       name: intl | ||||||
|       url: "https://pub.dartlang.org" |       url: "https://pub.dartlang.org" | ||||||
|     source: hosted |     source: hosted | ||||||
|     version: "0.16.1" |     version: "0.16.0" | ||||||
|   intl_translation: |   intl_translation: | ||||||
|     dependency: "direct main" |     dependency: "direct main" | ||||||
|     description: |     description: | ||||||
|  |  | ||||||
|  | @ -87,6 +87,12 @@ flutter: | ||||||
|         - asset: assets/Cinzel-Bold.otf |         - asset: assets/Cinzel-Bold.otf | ||||||
|           weight: 700 |           weight: 700 | ||||||
|         - asset: assets/Cinzel-Regular.otf |         - asset: assets/Cinzel-Regular.otf | ||||||
|  |     - family: Cinzel-Regular | ||||||
|  |       fonts: | ||||||
|  |         - asset: assets/Cinzel-Regular.otf | ||||||
|  |     - family: Cinzel-Bold | ||||||
|  |       fonts: | ||||||
|  |         - asset: assets/Cinzel-Bold.otf | ||||||
|     - family: LinuxLibertine |     - family: LinuxLibertine | ||||||
|       fonts: |       fonts: | ||||||
|         - asset: assets/LinLibertine_R.ttf |         - asset: assets/LinLibertine_R.ttf | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez