diff options
author | xAlpharax <42233094+xAlpharax@users.noreply.github.com> | 2023-11-05 05:24:13 +0200 |
---|---|---|
committer | xAlpharax <42233094+xAlpharax@users.noreply.github.com> | 2023-11-05 05:24:13 +0200 |
commit | 29e9e7f1e428ef946ca8cd46fdd891efb659f98c (patch) | |
tree | b617226c34f07834ac319e5012402df9e4cdce66 /client_app_flutter/lib/main.dart | |
parent | c2b4fccc4dd0a7087e7d0dfd2d6cf9ca31bbb775 (diff) |
Added logic with Firebase and the supplied lib for RTDB
- (Real Time Database)
Changes to be committed:
modified: client_app_flutter/lib/main.dart
modified: client_app_flutter/pubspec.lock
modified: client_app_flutter/pubspec.yaml
Diffstat (limited to 'client_app_flutter/lib/main.dart')
-rw-r--r-- | client_app_flutter/lib/main.dart | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client_app_flutter/lib/main.dart b/client_app_flutter/lib/main.dart index e00d0ae..31bc250 100644 --- a/client_app_flutter/lib/main.dart +++ b/client_app_flutter/lib/main.dart @@ -3,9 +3,13 @@ import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:client_app_flutter/firebase_options.dart'; +import 'package:firebase_database/firebase_database.dart'; + Future <void> main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); + + // FirebaseDatabase database = FirebaseDatabase.instance; runApp(const MyApp()); } @@ -60,6 +64,7 @@ class MyHomePage extends StatefulWidget { } class _MyHomePageState extends State<MyHomePage> { + FirebaseDatabase database = FirebaseDatabase.instance; int _counter = 0; void _incrementCounter() { @@ -69,7 +74,8 @@ 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++; + _counter = database.hashCode; }); } |