getOnce static method

Future<List> getOnce(
  1. String reference
)

Implementation

static Future<List> getOnce(String reference) async {
  DatabaseReference ref = FirebaseDatabase.instance.ref(reference);
  DataSnapshot snapshot = await ref.get();

  Map mapX = snapshot.value as Map;
  List retVal = [];
  for (var i = 0; i < mapX.keys.length; i++) {
    retVal.add(JeaFire.decodeAndTagAddEndElement(
        mapX.keys.elementAt(i), mapX.values.elementAt(i)));
  }
  return retVal;
}