diff options
Diffstat (limited to 'client_app_flutter/lib/main.dart')
-rw-r--r-- | client_app_flutter/lib/main.dart | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/client_app_flutter/lib/main.dart b/client_app_flutter/lib/main.dart index 31bc250..5fd98b4 100644 --- a/client_app_flutter/lib/main.dart +++ b/client_app_flutter/lib/main.dart @@ -65,6 +65,8 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State<MyHomePage> { FirebaseDatabase database = FirebaseDatabase.instance; + // final ref = FirebaseDatabase.instance.ref(); + int _counter = 0; void _incrementCounter() { @@ -74,8 +76,16 @@ class _MyHomePageState extends State<MyHomePage> { // so that the display can reflect the updated values. If we changed // _counter without calling setState(), then the build method would not be // called again, and so nothing would appear to happen. - // _counter++; - _counter = database.hashCode; + _counter++; + // final snapshot = await ref.child('temperature').get(); + final snapshot = database.ref().child('temperature').get(); + // if (snapshot.exists) { + // print(snapshot.value); + // var _counter = snapshot.value; + // } else { + // print('No data available.'); + // } + // // _counter = ref.child('temperature').get() as int; }); } |