Created
June 19, 2019 16:29
-
-
Save aaronksaunders/1a629ca7ccf98c0d173f8c02cbe840c1 to your computer and use it in GitHub Desktop.
Markdium-Flutter Tabs w/ State Management
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RaisedButton( | |
child: Text("Add Item"), | |
onPressed: () async { | |
final form = _formKey.currentState; | |
form.save(); | |
if (form.validate()) { | |
Provider.of(context) | |
.add(new Item(_name, num.parse(_price))); | |
} else { | |
print('validate failed'); | |
} | |
_formKey.currentState.reset(); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment