Flutter - Firebase - realtime database -update/add data

0

I am building an application using flutter in android studio, I have successfully provided the email authentication and now i am trying to store data on google firebase realtime database, but every time i run the application instead of changing data in database, i am getting as error in run window mentioned below.

D/NetworkSecurityConfig( 1417): No Network Security Config specified, using platform default D/NetworkManagementSocketTagger( 1417): tagSocket(101) with statsTag=0xffffffff, statsUid=-1

import 'package:flutter/material.dart';
import 'package:firebase_database/firebase_database.dart';

final FirebaseDatabase database = FirebaseDatabase();
final DatabaseReference dbref =
FirebaseDatabase.instance.reference().child('email');
void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Center(
        child: RaisedButton(
          onPressed: () {
            dbref.set({'denish': 'hello'}).then((_) {});
            print("change by:");
            print(dbref);
          },
          child: Text("write"),
        ),
      ),
    );
  }[enter image description here][1]
android-studio
flutter
firebase-realtime-database
asked on Stack Overflow Sep 12, 2020 by Vismay Viradiya • edited Sep 14, 2020 by Vismay Viradiya

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0