Skip to content

Instantly share code, notes, and snippets.

@AakashPandey
Created January 2, 2020 12:09
Show Gist options
  • Save AakashPandey/b3666d1321618c0d304484769c8b592a to your computer and use it in GitHub Desktop.
Save AakashPandey/b3666d1321618c0d304484769c8b592a to your computer and use it in GitHub Desktop.
floatingActionButton: FloatingActionButton(
child: Icon(Icons.save),
onPressed: () {
if (_inp.text != "" && widget.hero == null) {
allHeroesList.addHero(_inp.text);
Navigator.of(context).pop();
} else if (_inp.text != "") {
allHeroesList.editHero(widget.hero.name, _inp.text);
Navigator.of(context).pop();
}
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment