docs(code): add doc comments to all public widgets and providers

Document MyApp, MainPage, PokemonImage/Tile/TypeWidget, and the gen-filter
and theme providers/notifiers. Every public class/enum now has a /// doc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Maxiwere45 2026-06-23 11:58:29 +02:00
parent 9d49cef271
commit 7fd122fd91
7 changed files with 11 additions and 3 deletions

View File

@ -17,6 +17,7 @@ void main() {
runApp(const ProviderScope(child: MyApp())); runApp(const ProviderScope(child: MyApp()));
} }
/// Widget racine : construit le MaterialApp (thème dérivé de la palette, routes).
class MyApp extends ConsumerWidget { class MyApp extends ConsumerWidget {
const MyApp({super.key}); const MyApp({super.key});

View File

@ -6,6 +6,7 @@ import 'pokemon_list.dart';
import 'guess_page.dart'; import 'guess_page.dart';
import 'system_page.dart'; import 'system_page.dart';
/// Coquille principale : navigation par onglets (liste / jeu / système) via un IndexedStack.
class MainPage extends ConsumerWidget { class MainPage extends ConsumerWidget {
const MainPage({Key? key}) : super(key: key); const MainPage({Key? key}) : super(key: key);

View File

@ -3,6 +3,8 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../../core/config/app_constants.dart'; import '../../core/config/app_constants.dart';
/// Gère les générations activées pour le tirage et fournit un id aléatoire dans celles-ci.
/// La sélection est persistée dans les préférences.
class GenFilterNotifier extends Notifier<Set<int>> { class GenFilterNotifier extends Notifier<Set<int>> {
@override @override
Set<int> build() { Set<int> build() {
@ -50,5 +52,6 @@ class GenFilterNotifier extends Notifier<Set<int>> {
} }
} }
/// Ensemble des index de générations actuellement activées pour le jeu.
final genFilterProvider = final genFilterProvider =
NotifierProvider<GenFilterNotifier, Set<int>>(GenFilterNotifier.new); NotifierProvider<GenFilterNotifier, Set<int>>(GenFilterNotifier.new);

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
/// Palette de couleurs nommée de l'application (couleur primaire + surface de fond).
class AppPalette { class AppPalette {
final String name; final String name;
final Color primary; final Color primary;
@ -24,6 +25,7 @@ const List<AppPalette> appPalettes = [
const String _prefsPaletteIndex = 'palette_index'; const String _prefsPaletteIndex = 'palette_index';
/// Gère l'index de la palette sélectionnée, persistée dans les préférences.
class ThemeNotifier extends Notifier<int> { class ThemeNotifier extends Notifier<int> {
@override @override
int build() { int build() {
@ -46,4 +48,5 @@ class ThemeNotifier extends Notifier<int> {
AppPalette get current => appPalettes[state]; AppPalette get current => appPalettes[state];
} }
/// Index de la palette de couleurs active.
final themeProvider = NotifierProvider<ThemeNotifier, int>(ThemeNotifier.new); final themeProvider = NotifierProvider<ThemeNotifier, int>(ThemeNotifier.new);

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// Image réseau d'un Pokémon, avec URL de repli et placeholder en cas d'échec de chargement.
class PokemonImage extends StatelessWidget { class PokemonImage extends StatelessWidget {
final String imageUrl; final String imageUrl;
final String? fallbackUrl; final String? fallbackUrl;

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import '../../domain/entities/pokemon.dart'; import '../../domain/entities/pokemon.dart';
import 'pokemon_image.dart'; import 'pokemon_image.dart';
/// Ligne de liste d'un Pokémon : image et nom si attrapé, masqué (???) sinon.
class PokemonTile extends StatelessWidget { class PokemonTile extends StatelessWidget {
const PokemonTile(this.pokemon, {Key? key}) : super(key: key); const PokemonTile(this.pokemon, {Key? key}) : super(key: key);

View File

@ -2,9 +2,7 @@ import 'package:flutter/material.dart';
import '../../domain/entities/pokemon.dart'; import '../../domain/entities/pokemon.dart';
import '../theme/type_colors.dart'; import '../theme/type_colors.dart';
// Widget qui permet d'afficher un type de Pokémon /// Pastille colorée affichant le nom d'un type de Pokémon (couleur de fond selon le type).
// Elle prend en paramètre un type de Pokémon
// Elle affiche le nom du type avec une couleur de fond correspondant au type
class PokemonTypeWidget extends StatelessWidget { class PokemonTypeWidget extends StatelessWidget {
const PokemonTypeWidget(this.type, {Key? key}) : super(key: key); const PokemonTypeWidget(this.type, {Key? key}) : super(key: key);