Estoy iniciando en flutter y en mi aplicación busco mostrar una card para cada key que se encuentre en firebase
es decir que el key sea el texto titulo y el subtitulo el valor de la key, se me ocurrio crear una listview para mostrar los datos
para ello trate de hacer lo siguiente pero no muestra ningun dato:
import 'package:flutter/material.dart';
import 'package:firebase_database/firebase_database.dart';
import 'nuevo.dart';
void main() {
runApp(new MaterialApp(
home: MyHomePage(),
));
}
class MyHomePage extends StatelessWidget {
List <Post> list=new List();
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Data"),
),
body: new Container(
child:new Center(
child: new ListView.builder(itemBuilder: (BuildContext context ,int index){
return new Card(
child: new Column(
children: <Widget>[
new Text(list[index].title),
new Text(list[index].content)
],
),
);
},
itemCount: list==null?0:list.length,
),
)
)
);
}
}
nuevo.dart
import 'package:flutter/material.dart';
class Post {
String title;
String content;
Post(this.title,this.content);
Post.fromJson(var value){
this.title = value['title'];
this.content = value['content'];
}
}
Si me pudieran apoyar con documentacion o un tutorial completo sobre firebase con flutter tambiense los agradeceria