FutureBuilder not working inside ListView

Viewed 74

i have FutureBuilder and ListView I want to show the bottom of some was one page after downloading JSON they appear as one piece. I added FutureBuilder inside ListView can't appear FutureBuilder and i have error in console

======== Exception caught by rendering library ===================================================== The following assertion was thrown during paint(): RenderBox was not laid out: RenderRepaintBoundary#e0a8a relayoutBoundary=up16 NEEDS-PAINT 'package:flutter/src/rendering/box.dart': Failed assertion: line 1930 pos 12: 'hasSize'

2 Answers

Add shrinkwrap and physics under ListView.builder

ListView.builder(
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: rodios.length,

)

Make sure the ListView is in a container that has sizes:

Container(width: double.infinity, height: double.infinity, child: ListView...)
Related