added default meal name

This commit is contained in:
doman 2023-07-30 14:42:55 +02:00
parent dff45b0ec4
commit f6e1a08d06
2 changed files with 9 additions and 1 deletions

View file

@ -16,6 +16,14 @@ class AddMealScreen extends BasedScreen {
class _AddMealScreen extends State<AddMealScreen> {
final nameController = TextEditingController();
@override
void initState () {
super.initState();
setState(() {
nameController.text = "Meal ${widget.diary.meals.length}";
});
}
@override
void dispose() {
nameController.dispose();

View file

@ -24,7 +24,7 @@ class DiaryWidget extends StatelessWidget {
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Spacer(),
const Spacer(),
Text(
"${diary.calories.toStringAsFixed(1)} kcal",
style: Theme.of(context).textTheme.headlineLarge!.copyWith(