Skip to content

Instantly share code, notes, and snippets.

@ijoschek
Last active December 5, 2018 09:01
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 ijoschek/77eb8280c6141b74fcd3bc3494856366 to your computer and use it in GitHub Desktop.
Save ijoschek/77eb8280c6141b74fcd3bc3494856366 to your computer and use it in GitHub Desktop.
flutter_firestore_tut
//...
class _Home extends State<StatefulWidget> {
//...
void clickEdit(item) {
_myUpdateContr.text = item['text'];
showDialog(
context: context,
builder: (_) => SimpleDialog(
title: Text('Edit text'),
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
Expanded(
child: TextField(
controller: _myUpdateContr,
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Enter new Text!'),
),
),
RaisedButton(
color: Colors.orange,
textColor: Colors.white,
splashColor: Colors.orangeAccent,
child: const Text('Update'),
onPressed: () {
clickUpdate(item);
},
),
],
),
),
],
));
}
//...
@override
Widget build(BuildContext context) {
return Scaffold(
//...
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment