title: Flutter How to change container height based on the ListView items height?
body: <p>I have a Container in this Container implemented Listview. I want to implement like that container height will take listview items height currently its hardcoded 150. I dont want to make it scrollable . Scaffold wraped with singlechildscrollview.If i remove container height that throw an error unbounded height.</p>
  <pre><code>Container(
                      height: 150,
                      color: Colors.red,
                      width: double.infinity,
                      child: FutureBuilder(
                          future: assesmentfuture,
                          builder:
                              (context, AsyncSnapshot&lt;List&lt;Assesment&gt;&gt; sn) {
                            if (sn.hasData) {
                              return ListView.builder(
                                  itemCount: sn.data!.length,
                                  itemBuilder: (context, index) {
                                    return Padding(
                                      padding: const EdgeInsets.symmetric(
                                          horizontal: 10),
                                      child: Container(
                                        color: Colors.green,
                                        child: Text(
                                          sn.data![index].text,
                                          style: GoogleFonts.roboto(
                                            fontSize: 14,
                                            fontWeight: FontWeight.w400,
                                          ),
                                          textAlign: TextAlign.justify,
                                        ),
                                      ),
                                    );
                                  });
                            }
                            if (sn.hasError) {
                              return Center(
                                child: Text(&quot;Error&quot;),
                              );
                            }
  
                            return Center(
                              child: CircularProgressIndicator(),
                            );
                          }),
                    )
  </code></pre>