add Entry on grams field submitted
add Entry on product field submitted as well
This commit is contained in:
parent
a961580e2d
commit
4843215569
1 changed files with 2 additions and 0 deletions
|
@ -132,6 +132,7 @@ class _AddEntryScreen extends State<AddEntryScreen> {
|
||||||
FilteringTextInputFormatter.allow(RegExp(r'^(\d+)?[\.,]?\d{0,2}')),
|
FilteringTextInputFormatter.allow(RegExp(r'^(\d+)?[\.,]?\d{0,2}')),
|
||||||
],
|
],
|
||||||
controller: gramsController,
|
controller: gramsController,
|
||||||
|
onFieldSubmitted: (_) => _addEntry(),
|
||||||
),
|
),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
|
@ -139,6 +140,7 @@ class _AddEntryScreen extends State<AddEntryScreen> {
|
||||||
),
|
),
|
||||||
controller: productNameController,
|
controller: productNameController,
|
||||||
onChanged: (_) => _getProducts(),
|
onChanged: (_) => _getProducts(),
|
||||||
|
onFieldSubmitted: (_) => _addEntry(),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
Loading…
Reference in a new issue