Skip to content

Instantly share code, notes, and snippets.

@aaronksaunders
Created June 19, 2019 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronksaunders/0bf316bdacba241112e768a6221bc0cc to your computer and use it in GitHub Desktop.
Save aaronksaunders/0bf316bdacba241112e768a6221bc0cc to your computer and use it in GitHub Desktop.
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