mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-29 22:45:44 +00:00 
			
		
		
		
	Ajustements
This commit is contained in:
		
							parent
							
								
									1197df6527
								
							
						
					
					
						commit
						512adf99d8
					
				
					 2 changed files with 88 additions and 48 deletions
				
			
		|  | @ -96,9 +96,10 @@ class _PCEditorPageState extends State<PCEditorPage> { | ||||||
| 
 | 
 | ||||||
|   // widgets generics |   // widgets generics | ||||||
| 
 | 
 | ||||||
|   Widget _loadMarkdown(String markdown) { |   Widget _buildMarkdown(String markdown) { | ||||||
|     return MarkdownBody( |     return MarkdownBody( | ||||||
|       data: markdown ?? "", |       data: markdown ?? "", | ||||||
|  |       styleSheet: mainMarkdownStyleSheet(context), | ||||||
|       onTapLink: (link) => Navigator.push( |       onTapLink: (link) => Navigator.push( | ||||||
|         context, |         context, | ||||||
|         MaterialPageRoute(builder: (context) => LibraryPage(id: link)), |         MaterialPageRoute(builder: (context) => LibraryPage(id: link)), | ||||||
|  | @ -106,7 +107,15 @@ class _PCEditorPageState extends State<PCEditorPage> { | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   Widget _loadItemsWidget<T extends Item>( |   Widget _buildSubTitle(String title) { | ||||||
|  |     return Text(title, | ||||||
|  |         style: TextStyle( | ||||||
|  |           fontSize: 16, | ||||||
|  |           fontFamily: "Cinzel", | ||||||
|  |         )); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   Widget _buildItemsWidget<T extends Item>( | ||||||
|       {String hintText, |       {String hintText, | ||||||
|       List<T> items, |       List<T> items, | ||||||
|       T selectedItem, |       T selectedItem, | ||||||
|  | @ -130,8 +139,8 @@ class _PCEditorPageState extends State<PCEditorPage> { | ||||||
| 
 | 
 | ||||||
|   // widgets specifics |   // widgets specifics | ||||||
| 
 | 
 | ||||||
|   Widget _loadRacesWidget() { |   Widget _buildRacesWidget() { | ||||||
|     return _loadItemsWidget<RaceItem>( |     return _buildItemsWidget<RaceItem>( | ||||||
|       hintText: "Race", |       hintText: "Race", | ||||||
|       items: _races, |       items: _races, | ||||||
|       selectedItem: _race, |       selectedItem: _race, | ||||||
|  | @ -141,9 +150,9 @@ class _PCEditorPageState extends State<PCEditorPage> { | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   Widget _loadSubRacesWidget() { |   Widget _buildSubRacesWidget() { | ||||||
|     return _subRaces != null |     return _subRaces != null | ||||||
|         ? _loadItemsWidget<SubRaceItem>( |         ? _buildItemsWidget<SubRaceItem>( | ||||||
|             hintText: "Variante", |             hintText: "Variante", | ||||||
|             items: _subRaces, |             items: _subRaces, | ||||||
|             selectedItem: _subRace, |             selectedItem: _subRace, | ||||||
|  | @ -154,39 +163,39 @@ class _PCEditorPageState extends State<PCEditorPage> { | ||||||
|         : SizedBox.shrink(); |         : SizedBox.shrink(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   Widget _loadRaceDetailsWidget() { |   Widget _buildRaceDetailsWidget() { | ||||||
|     return _race != null |     return _race != null | ||||||
|         ? Column( |         ? Column( | ||||||
|       crossAxisAlignment: CrossAxisAlignment.start, |             crossAxisAlignment: CrossAxisAlignment.start, | ||||||
|             children: [ |             children: [ | ||||||
|               Text("Augmentation de caractéristiques", style: TextStyle(fontSize: 16, fontFamily: "Cinzel",)), |               _buildSubTitle("Augmentation de caractéristiques"), | ||||||
|               _loadMarkdown(_race?.abilityScoreIncrease), |               _buildMarkdown(_race?.abilityScoreIncrease), | ||||||
|               _loadMarkdown(_subRace?.abilityScoreIncrease), |               _buildMarkdown(_subRace?.abilityScoreIncrease), | ||||||
|               Text(""), |               Text(""), | ||||||
|               Text("Âge"), |               _buildSubTitle("Âge"), | ||||||
|               _loadMarkdown(_race?.age), |               _buildMarkdown(_race?.age), | ||||||
|               Text(""), |               Text(""), | ||||||
|               Text("Alignement"), |               _buildSubTitle("Alignement"), | ||||||
|               _loadMarkdown(_race?.alignment), |               _buildMarkdown(_race?.alignment), | ||||||
|               Text(""), |               Text(""), | ||||||
|               Text("Taille"), |               _buildSubTitle("Taille"), | ||||||
|               _loadMarkdown(_race?.size), |               _buildMarkdown(_race?.size), | ||||||
|               Text(""), |               Text(""), | ||||||
|               Text("Vitesse"), |               _buildSubTitle("Vitesse"), | ||||||
|               _loadMarkdown(_race?.speed), |               _buildMarkdown(_race?.speed), | ||||||
|               Text(""), |               Text(""), | ||||||
|               Text("Vision dans le noir"), |               _buildSubTitle("Vision dans le noir"), | ||||||
|               _loadMarkdown(_race?.darkvision), |               _buildMarkdown(_race?.darkvision), | ||||||
|               Text(""), |               Text(""), | ||||||
|               Text("Langues"), |               _buildSubTitle("Langues"), | ||||||
|               _loadMarkdown(_race?.languages), |               _buildMarkdown(_race?.languages), | ||||||
|             ], |             ], | ||||||
|           ) |           ) | ||||||
|         : SizedBox.shrink(); |         : SizedBox.shrink(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   Widget _loadBackgroundsWidget() { |   Widget _buildBackgroundsWidget() { | ||||||
|     return _loadItemsWidget<BackgroundItem>( |     return _buildItemsWidget<BackgroundItem>( | ||||||
|       hintText: "Historique", |       hintText: "Historique", | ||||||
|       items: _backgrounds, |       items: _backgrounds, | ||||||
|       selectedItem: _background, |       selectedItem: _background, | ||||||
|  | @ -196,9 +205,9 @@ class _PCEditorPageState extends State<PCEditorPage> { | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   Widget _loadSubBackgroundsWidget() { |   Widget _buildSubBackgroundsWidget() { | ||||||
|     return _subBackgrounds != null |     return _subBackgrounds != null | ||||||
|         ? _loadItemsWidget<SubBackgroundItem>( |         ? _buildItemsWidget<SubBackgroundItem>( | ||||||
|             hintText: "Variante", |             hintText: "Variante", | ||||||
|             items: _subBackgrounds, |             items: _subBackgrounds, | ||||||
|             selectedItem: _subBackground, |             selectedItem: _subBackground, | ||||||
|  | @ -219,50 +228,81 @@ class _PCEditorPageState extends State<PCEditorPage> { | ||||||
|           bottom: TabBar( |           bottom: TabBar( | ||||||
|             labelColor: Colors.black, |             labelColor: Colors.black, | ||||||
|             isScrollable: true, |             isScrollable: true, | ||||||
|             indicatorColor: Theme.of(context).accentColor, // Colors.red, |             indicatorColor: Theme.of(context).accentColor, | ||||||
|  |             // Colors.red, | ||||||
|             indicatorSize: TabBarIndicatorSize.label, |             indicatorSize: TabBarIndicatorSize.label, | ||||||
|             tabs: <Widget>[ |             tabs: <Widget>[ | ||||||
|               Text( |               Text( | ||||||
|                 AppLocalizations.of(context).raceTitle, |                 AppLocalizations.of(context).raceTitle, | ||||||
|                 style: TextStyle(fontSize: 25, fontFamily: "Cinzel",), |                 style: TextStyle( | ||||||
|  |                   fontSize: 25, | ||||||
|  |                   fontFamily: "Cinzel", | ||||||
|  |                 ), | ||||||
|               ), |               ), | ||||||
|               Text( |               Text( | ||||||
|                 AppLocalizations.of(context).backgroundTitle, |                 AppLocalizations.of(context).backgroundTitle, | ||||||
|                 style: TextStyle(fontSize: 25, fontFamily: "Cinzel",), |                 style: TextStyle( | ||||||
|  |                   fontSize: 25, | ||||||
|  |                   fontFamily: "Cinzel", | ||||||
|  |                 ), | ||||||
|               ), |               ), | ||||||
|               Text( |               Text( | ||||||
|                 AppLocalizations.of(context).classTitle, |                 AppLocalizations.of(context).classTitle, | ||||||
|                 style: TextStyle(fontSize: 25, fontFamily: "Cinzel",), |                 style: TextStyle( | ||||||
|  |                   fontSize: 25, | ||||||
|  |                   fontFamily: "Cinzel", | ||||||
|  |                 ), | ||||||
|               ), |               ), | ||||||
|               Text( |               Text( | ||||||
|                 AppLocalizations.of(context).abilitiesTitle, |                 AppLocalizations.of(context).abilitiesTitle, | ||||||
|                 style: TextStyle(fontSize: 25, fontFamily: "Cinzel",), |                 style: TextStyle( | ||||||
|  |                   fontSize: 25, | ||||||
|  |                   fontFamily: "Cinzel", | ||||||
|  |                 ), | ||||||
|               ), |               ), | ||||||
|               Text( |               Text( | ||||||
|                 AppLocalizations.of(context).othersTitle, |                 AppLocalizations.of(context).othersTitle, | ||||||
|                 style: TextStyle(fontSize: 25, fontFamily: "Cinzel",), |                 style: TextStyle( | ||||||
|  |                   fontSize: 25, | ||||||
|  |                   fontFamily: "Cinzel", | ||||||
|  |                 ), | ||||||
|               ), |               ), | ||||||
|             ], |             ], | ||||||
|           ), |           ), | ||||||
|         ), |         ), | ||||||
|         body: TabBarView( |         body: TabBarView( | ||||||
|           children: [ |           children: [ | ||||||
|             ListView( |             Container( | ||||||
|               children: <Widget>[ |               margin: EdgeInsets.all(10.0), | ||||||
|                 _loadRacesWidget(), |               child: ListView( | ||||||
|                 _loadSubRacesWidget(), |                 children: <Widget>[ | ||||||
|                 _loadRaceDetailsWidget(), |                   _buildRacesWidget(), | ||||||
|               ], |                   _buildSubRacesWidget(), | ||||||
|  |                   _buildRaceDetailsWidget(), | ||||||
|  |                 ], | ||||||
|  |               ), | ||||||
|             ), |             ), | ||||||
|             ListView( |             Container( | ||||||
|               children: <Widget>[ |               margin: EdgeInsets.all(10.0), | ||||||
|                 _loadBackgroundsWidget(), |               child: ListView( | ||||||
|                 _loadSubBackgroundsWidget(), |                 children: <Widget>[ | ||||||
|               ], |                   _buildBackgroundsWidget(), | ||||||
|  |                   _buildSubBackgroundsWidget(), | ||||||
|  |                 ], | ||||||
|  |               ), | ||||||
|  |             ), | ||||||
|  |             Container( | ||||||
|  |               margin: EdgeInsets.all(10.0), | ||||||
|  |               child: Text(AppLocalizations.of(context).classTitle), | ||||||
|  |             ), | ||||||
|  |             Container( | ||||||
|  |               margin: EdgeInsets.all(10.0), | ||||||
|  |               child: Text(AppLocalizations.of(context).abilitiesTitle), | ||||||
|  |             ), | ||||||
|  |             Container( | ||||||
|  |               margin: EdgeInsets.all(10.0), | ||||||
|  |               child: Text(AppLocalizations.of(context).othersTitle), | ||||||
|             ), |             ), | ||||||
|             Text(AppLocalizations.of(context).classTitle), |  | ||||||
|             Text(AppLocalizations.of(context).abilitiesTitle), |  | ||||||
|             Text(AppLocalizations.of(context).othersTitle), |  | ||||||
|           ], |           ], | ||||||
|         ), |         ), | ||||||
|       ), |       ), | ||||||
|  |  | ||||||
|  | @ -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.0" |     version: "0.16.1" | ||||||
|   intl_translation: |   intl_translation: | ||||||
|     dependency: "direct main" |     dependency: "direct main" | ||||||
|     description: |     description: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez