feat: start of pending screen
This commit is contained in:
parent
019a21f00e
commit
ee9c4c3801
12 changed files with 425 additions and 67 deletions
|
|
@ -1,5 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:intl/date_symbol_data_local.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:seshat/domain/models/bal.dart';
|
||||
import 'package:seshat/ui/core/ui/navigation_bar.dart';
|
||||
import 'package:seshat/ui/home_page/view_model/home_view_model.dart';
|
||||
|
|
@ -18,6 +20,8 @@ class HomePage extends StatefulWidget {
|
|||
class _HomePageState extends State<HomePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
initializeDateFormatting();
|
||||
var format = DateFormat("dd MMM yyyy", "fr");
|
||||
return Scaffold(
|
||||
bottomNavigationBar: AppNavigationBar(startIndex: 0),
|
||||
appBar: AppBar(
|
||||
|
|
@ -55,30 +59,24 @@ class _HomePageState extends State<HomePage> {
|
|||
title: Text(bal.name),
|
||||
subtitle: switch (bal.state) {
|
||||
BalState.pending => Text(
|
||||
"À venir · Débute le ${bal.startTime.toString()}",
|
||||
"À venir · Débute le ${format.format(bal.startTime)}",
|
||||
),
|
||||
BalState.ongoing => Text("En cours"),
|
||||
BalState.ended => Text("Terminée"),
|
||||
},
|
||||
trailing: switch (bal.state) {
|
||||
BalState.pending => IconButton(
|
||||
onPressed: () {
|
||||
_moveToBal(context, bal.id);
|
||||
},
|
||||
icon: Icon(Icons.edit),
|
||||
),
|
||||
BalState.ongoing => IconButton(
|
||||
onPressed: () {
|
||||
_moveToBal(context, bal.id);
|
||||
},
|
||||
icon: Icon(Icons.arrow_forward),
|
||||
),
|
||||
BalState.ended => IconButton(
|
||||
onPressed: () {
|
||||
_moveToBal(context, bal.id);
|
||||
},
|
||||
icon: Icon(Icons.analytics),
|
||||
),
|
||||
_ => IconButton(
|
||||
onPressed: () {
|
||||
_moveToBal(context, bal.id);
|
||||
},
|
||||
icon: Icon(Icons.arrow_forward),
|
||||
),
|
||||
},
|
||||
),
|
||||
),
|
||||
|
|
@ -113,6 +111,7 @@ class _HomePageState extends State<HomePage> {
|
|||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) {
|
||||
return CreateConfirmationPopup(
|
||||
viewModel: widget.viewModel,
|
||||
|
|
|
|||
Reference in a new issue