Merge pull request #7 from Cyanose/feature/add-entry-on-enter-when-gram-field-foccused
add Entry on product or grams field submitted
This commit is contained in:
		
						commit
						67b1811a89
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -132,6 +132,8 @@ class _AddEntryScreen extends State<AddEntryScreen> {
 | 
			
		|||
                  FilteringTextInputFormatter.allow(RegExp(r'^(\d+)?[\.,]?\d{0,2}')),
 | 
			
		||||
                ],
 | 
			
		||||
                controller: gramsController,
 | 
			
		||||
                onFieldSubmitted: (_) => _addEntry(),
 | 
			
		||||
                autofocus: true,
 | 
			
		||||
              ),
 | 
			
		||||
              TextFormField(
 | 
			
		||||
                decoration: const InputDecoration(
 | 
			
		||||
| 
						 | 
				
			
			@ -139,6 +141,7 @@ class _AddEntryScreen extends State<AddEntryScreen> {
 | 
			
		|||
                ),
 | 
			
		||||
                controller: productNameController,
 | 
			
		||||
                onChanged: (_) => _getProducts(),
 | 
			
		||||
                onFieldSubmitted: (_) => _addEntry(),
 | 
			
		||||
              ),
 | 
			
		||||
              TextButton(
 | 
			
		||||
                onPressed: () {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue