added default meal name
This commit is contained in:
parent
dff45b0ec4
commit
f6e1a08d06
2 changed files with 9 additions and 1 deletions
|
@ -16,6 +16,14 @@ class AddMealScreen extends BasedScreen {
|
||||||
class _AddMealScreen extends State<AddMealScreen> {
|
class _AddMealScreen extends State<AddMealScreen> {
|
||||||
final nameController = TextEditingController();
|
final nameController = TextEditingController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState () {
|
||||||
|
super.initState();
|
||||||
|
setState(() {
|
||||||
|
nameController.text = "Meal ${widget.diary.meals.length}";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
nameController.dispose();
|
nameController.dispose();
|
||||||
|
|
|
@ -24,7 +24,7 @@ class DiaryWidget extends StatelessWidget {
|
||||||
title: Row(
|
title: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Spacer(),
|
const Spacer(),
|
||||||
Text(
|
Text(
|
||||||
"${diary.calories.toStringAsFixed(1)} kcal",
|
"${diary.calories.toStringAsFixed(1)} kcal",
|
||||||
style: Theme.of(context).textTheme.headlineLarge!.copyWith(
|
style: Theme.of(context).textTheme.headlineLarge!.copyWith(
|
||||||
|
|
Loading…
Reference in a new issue