feat: honestly forgot
This commit is contained in:
parent
48bcf0b1f8
commit
da953ba651
19 changed files with 1097 additions and 244 deletions
40
lib/ui/bal_page/widget/bal_screen.dart
Normal file
40
lib/ui/bal_page/widget/bal_screen.dart
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:seshat/domain/models/bal.dart';
|
||||
import 'package:seshat/ui/bal_page/view_model/bal_view_model.dart';
|
||||
import 'package:seshat/ui/core/ui/navigation_bar.dart';
|
||||
|
||||
class BalScreen extends StatefulWidget {
|
||||
const BalScreen({super.key, required this.viewModel});
|
||||
|
||||
final BalViewModel viewModel;
|
||||
|
||||
@override
|
||||
State<BalScreen> createState() => _BalScreenState();
|
||||
}
|
||||
|
||||
class _BalScreenState extends State<BalScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
bottomNavigationBar: AppNavigationBar(startIndex: 0),
|
||||
body: ListenableBuilder(
|
||||
listenable: widget.viewModel,
|
||||
builder: (context, child) {
|
||||
return switch (widget.viewModel.isLoaded) {
|
||||
false => Center(child: CircularProgressIndicator()),
|
||||
true => switch (widget.viewModel.bal == null) {
|
||||
true => Center(
|
||||
child: Text("La BAL référencée n'est pas accessible"),
|
||||
),
|
||||
false => switch (widget.viewModel.bal!.state) {
|
||||
BalState.pending => Center(child: Text("Pending")),
|
||||
BalState.ongoing => Center(child: Text("Ongoing")),
|
||||
BalState.ended => Center(child: Text("Ending")),
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in a new issue