feat: start of pending screen
This commit is contained in:
parent
019a21f00e
commit
ee9c4c3801
12 changed files with 425 additions and 67 deletions
|
|
@ -1,6 +1,7 @@
|
|||
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/bal_page/widget/pending/bal_pending_screen.dart';
|
||||
import 'package:seshat/ui/core/ui/navigation_bar.dart';
|
||||
import 'package:seshat/ui/core/ui/await_loading.dart';
|
||||
|
||||
|
|
@ -16,26 +17,29 @@ class BalPage extends StatefulWidget {
|
|||
class _BalPageState extends State<BalPage> {
|
||||
@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 => AwaitLoading(),
|
||||
true => switch (widget.viewModel.bal == null) {
|
||||
true => Center(
|
||||
return ListenableBuilder(
|
||||
listenable: widget.viewModel,
|
||||
builder: (context, child) {
|
||||
return switch (widget.viewModel.isLoaded) {
|
||||
false => Scaffold(
|
||||
bottomNavigationBar: AppNavigationBar(startIndex: 0),
|
||||
body: AwaitLoading(),
|
||||
),
|
||||
true => switch (widget.viewModel.bal == null) {
|
||||
true => Scaffold(
|
||||
bottomNavigationBar: AppNavigationBar(startIndex: 0),
|
||||
body: 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")),
|
||||
},
|
||||
),
|
||||
false => switch (widget.viewModel.bal!.state) {
|
||||
BalState.pending => BalPendingScreen(viewModel: widget.viewModel),
|
||||
BalState.ongoing => Center(child: Text("Ongoing")),
|
||||
BalState.ended => Center(child: Text("Ending")),
|
||||
},
|
||||
};
|
||||
},
|
||||
),
|
||||
},
|
||||
};
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue