31 lines
860 B
Dart
31 lines
860 B
Dart
/// Wrapper BLoC pour la page des cotisations
|
|
library cotisations_page_wrapper;
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:get_it/get_it.dart';
|
|
import '../../bloc/cotisations_bloc.dart';
|
|
import '../../bloc/cotisations_event.dart';
|
|
import 'cotisations_page.dart';
|
|
|
|
final _getIt = GetIt.instance;
|
|
|
|
/// Wrapper qui fournit le BLoC à la page des cotisations
|
|
class CotisationsPageWrapper extends StatelessWidget {
|
|
const CotisationsPageWrapper({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocProvider<CotisationsBloc>(
|
|
create: (context) {
|
|
final bloc = _getIt<CotisationsBloc>();
|
|
// Charger les cotisations au démarrage
|
|
bloc.add(const LoadCotisations());
|
|
return bloc;
|
|
},
|
|
child: const CotisationsPage(),
|
|
);
|
|
}
|
|
}
|
|
|