Instantly share code, notes, and snippets.

@ijoschek /.\lib\scr\home.dart Secret
Last active Dec 5, 2018

Embed
What would you like to do?
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