1
Can anyone tell me where I’m wrong with this code?
import 'package:anime_app/models/home_page.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
class AnimeList extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: StreamBuilder(
stream: Firestore.instance.collection('animes').snapshots(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
if (!snapshot.hasData) return const Text('Carregando...');
return ListView.builder(
itemCount: snapshot.data.documents.length,
itemBuilder: (BuildContext context, int index) {
DocumentSnapshot doc = snapshot.data.documents[index];
return ListView(
children: [
Container(
width: 100,
height: 100,
color: Colors.black,
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage(doc['link_img'])),
),
),
],
);
},
);
}),
);
}
}
(Read in relaxed tone) I think you are wrong in the question... What is happening or not? What is the expected result? Do any errors? xD
– Matheus Ribeiro