-
-
Save ijoschek/f11efe24fa6039095c0f1e487eb6b86e 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> { | |
//... | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Flutter Firestore Tutorial'), | |
), | |
body: Padding( | |
padding: const EdgeInsets.all(18.0), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.stretch, | |
children: <Widget>[ | |
Center(child: Text('Total Interactions: $_interactionCount')), | |
Row( | |
children: <Widget>[ | |
Expanded( | |
child: TextField( | |
controller: _myContr, | |
decoration: InputDecoration( | |
border: InputBorder.none, hintText: 'Enter Text'), | |
), | |
), | |
RaisedButton( | |
color: Colors.cyan, | |
textColor: Colors.white, | |
splashColor: Colors.cyanAccent, | |
child: const Text('Write to Firestore'), | |
onPressed: clickWrite, | |
), | |
], | |
), | |
Divider(), | |
Center( | |
child: | |
Text('Get Number of Docs with specific Text: $_queriedDocs'), | |
), | |
Row( | |
children: <Widget>[ | |
Expanded( | |
child: TextField( | |
controller: _getContr, | |
decoration: InputDecoration( | |
border: InputBorder.none, hintText: 'Enter Text'), | |
), | |
), | |
RaisedButton( | |
color: Colors.amber, | |
textColor: Colors.white, | |
splashColor: Colors.amberAccent, | |
child: const Text('Get'), | |
onPressed: clickGet, | |
), | |
], | |
), | |
Divider(), | |
Center(child: Text('Documents in Store: $_totalDocs')), | |
Row( | |
children: <Widget>[ | |
Expanded(child: Text('Turn on Listener')), | |
Switch( | |
value: _switchOnOff, | |
onChanged: (val) { | |
switchListener(val); | |
}), | |
], | |
), | |
Divider(), | |
//... | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment