Search
 
SCRIPT & CODE EXAMPLE
 

DART

var keys = snap.value.keys;

@override
  void initState() {
  super.initState();
    final ref = FirebaseDatabase.instance.ref().child('employee');

    ref.once().then((snap){
  //TO retrieve all the documents from collection
  dynamic keys = snap.snapshot.value;
  //To get only the document IDs of all documents.
  dynamic KEYS = keys.keys;

  dynamic data = snap.snapshot.value;
        for (var key in KEYS){
          Employee d = new Employee(
            id : data [key]['id'],
            name : data[key]['name'],
            email : data[key]['email'],
            emp_id: data[key]['emp_id']
          );
          myAllData.add(d);
        }


      setState(() {
       print('Length : ${myAllData.length}');
      });
    });
Comment

PREVIOUS NEXT
Code Example
Dart :: image not shoing when i use network image,flutter 
Dart :: access blocprovider inside a dispose method in flutter 
Dart :: How to i convert this python code to dart? 
Dart :: flutter multi icon button 
Dart :: how to effect container radius to children flutter 
Dart :: perform async function in widget build method 
Dart :: onpressed flutter calculate 
Dart :: flutter provider difference between Consumer<T and context.watch<T 
Dart :: dart compiler 
Dart :: dart test matcher expecting a field value 
Dart :: flutter toast not working 
Dart :: dart async map 
Dart :: how to perform a text search over json data in flutter 
Dart :: git : open another branch ( like clone ) 
Dart :: dart map what is 
Dart :: flutter when to use methods 
Swift :: swift ui debug print 
Swift :: swift ui square root 
Swift :: swift 5 btn change image 
Swift :: Preload database in app with Realm swift 
Swift :: check when webview finish loading swift 
Swift :: round down swift 
Swift :: how to check object is nil in swift 
Swift :: swift how to animate constraint change 
Swift :: unit testing swift 
Swift :: make preivew in dark mode swiftui 
Swift :: swift add width height constraint to view without a lot of code 
Swift :: swift edit constraint programmatically 
Swift :: swift pdf preview image 
Swift :: declaring optionals swift 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =