【发布时间】:2021-04-01 13:22:56
【问题描述】:
static String _url = "https://notes-7f146-default-rtdb.firebaseio.com";
static Future browse() async {
final List<Notes> _notes = [];
var respose = await http.get(Uri.parse(_url + '/notes.json?'));
final extractedData =
await convert.json.decode(respose.body) as Map<String, dynamic>;
extractedData.forEach((key, value) {
_notes.add(Notes(
title: value['title'], desc: value['desc'], key: key.toString()));
});
// _notes = collection.map((json) => Notes.fromJson(json)).toList();
return _notes;
}
我怎样才能从中制作一个流?
【问题讨论】: