Real time database CRUD

PHOTO EMBED

Sun Jun 14 2020 07:08:20 GMT+0000 (Coordinated Universal Time)

Saved by @pratik.gtm #dart

final ref = FirebaseDatabase.instance.reference();

 void getData() {
    ref
        .child('videos')
        .child('class_10')
        .child('chapter_1')
        .once()
        .then((DataSnapshot data) {
      print(data.value);
      print(data.key);
    });
  }
  
    void createRecord() {
    ref
        .child('videos')
        .child('class_10')
        .child('chapter_1')
        .set([
      {"length": "1:3333", "title": "Introduction 1.1"},
      {"length": "2:30", "title": "Introduction 1.2"}
    ]);
  }
content_copyCOPY

.yaml file: firebase_database: ^3.1.1

https://petercoding.com/firebase/2020/02/06/get-started-with-firebase-in-flutter/