-
-
Save ijoschek/77eb8280c6141b74fcd3bc3494856366 to your computer and use it in GitHub Desktop.
flutter_firestore_tut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
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