Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Markdium-Flutter Tabs w/ State Management
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