title: How to work with asset images in carousel_slider?
body: <p>This is where I call the widget and try to pass in a List of widgets with the Pictures in.</p>
  
  <pre><code>Row(
      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
      children: [
        Padding(
          padding: const EdgeInsets.all(10),
             child: CarouselSlider(
                 options: CarouselOptions(
               aspectRatio: 2.0,
               enlargeCenterPage: true,
               enableInfiniteScroll: false,
               initialPage: 2,
               autoPlay: false,
              ),
               items: imageSliders,
            )),
  </code></pre>
  
  <p>Thats the list of widgets.</p>
  
  <pre><code>final List&lt;String&gt; imgList = [
    'images/shoppinglist_main.jpg',
    'images/shoppinglist_main.jpg'
  ];
  
  final List&lt;Widget&gt; imageSliders = imgList
      .map((item) =&gt; Container(
            child: Container(
              margin: EdgeInsets.all(5.0),
              child: ClipRRect(
                  borderRadius: BorderRadius.all(Radius.circular(5.0)),
                  child: Stack(
                    children: &lt;Widget&gt;[
                      Image.asset(item, fit: BoxFit.cover, width: 1000.0),
                      Positioned(
                        bottom: 0.0,
                        left: 0.0,
                        right: 0.0,
                        child: Container(
                          decoration: BoxDecoration(
                            gradient: LinearGradient(
                              colors: [
                                Color.fromARGB(200, 0, 0, 0),
                                Color.fromARGB(0, 0, 0, 0)
                              ],
                              begin: Alignment.bottomCenter,
                              end: Alignment.topCenter,
                            ),
                          ),
                          padding: EdgeInsets.symmetric(
                              vertical: 10.0, horizontal: 20.0),
                          child: Text(
                            'No. ${imgList.indexOf(item)} image',
                            style: TextStyle(
                              color: Colors.white,
                              fontSize: 20.0,
                              fontWeight: FontWeight.bold,
                            ),
                          ),
                        ),
                      ),
                    ],
                  )),
            ),
          ))
      .toList();
  </code></pre>
  
  <p>Here is the error message:</p>
  
  <p>Null is not a subtype of Future.
  This will become a failure when runtime null safety is enabled.
  Restarted application in 63ms.
  ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
  The following assertion was thrown during performLayout():
  RenderAspectRatio has unbounded constraints.
  This RenderAspectRatio was given an aspect ratio of 2 but was given both unbounded width and
  unbounded height constraints. Because both constraints were unbounded, this render object doesn't
  know how much size to consume.
  The relevant error-causing widget was:
    AspectRatio</p>
  
  <p>Can someone please give me a hint on how to solve this...</p>