Skip to content

Instantly share code, notes, and snippets.

@ijoschek 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> {
//...
@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
You can’t perform that action at this time.