I am trying to display thumbnail of videos and i am fetching the thumbnail url from firebase and using Image.network to display them but the thumbnail are not displaying on the first they only came when i hot reload I am calling the fetch ThumbnailUrls like this
class _XtreamTubeState extends State<XtreamTube> {
@override
void initState() {
super.initState();
_fetchThumbnailUrls();
}
I am displaying the thumbnails like this
class HomeScreen extends StatelessWidget {
final List<String> thumbnailUrl;
const HomeScreen({super.key, required this.thumbnailUrl});
@override
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
slivers: [
const CustomSliverTubeAppBar(),
SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) {
final video = thumbnailUrl[index];
print('video$video');
return VideoContainer(videoUrl: video);
},
childCount: thumbnailUrl.length,
))
],
),
);
}
}
I have tried a lot of thing
i think in the build the thumbnailUrl list should not be empty and that is causing the improper rendering
so try this
other approach :