title: not able to return elements with nested gridview builder - fluttter
body: <p>my case is that i am retrieving values image and text for challenges (like products ...etc), the challenges should appear one by one vertically first the image appears then the text appears over the image in the centre so i used stack and padding and i was able to retrieve one challenge information only, now i want to retrieve all challenges vertically using gridview builder, so i have did this :</p>
  <pre><code> Widget build(BuildContext context) {
      return GridView.builder(
          scrollDirection: Axis.vertical,
          gridDelegate:
              SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: _challenges.length),
          itemBuilder: (_, index) {
            return InkWell(
              onTap: () {},
              child: Stack(
                children: [
                  Padding(
                    padding: EdgeInsets.all(10.0),
                    child: Center(
                      child: ClipRRect(
                        borderRadius: BorderRadius.circular(15),
                        child: Image(
                          image:
                              NetworkImage(_challenges[index][&quot;image-path&quot;][0]),
                          fit: BoxFit.cover,
                          height: 150,
                          width: 350,
                          opacity: AlwaysStoppedAnimation(.4),
                        ),
                      ),
                    ),
                  ),
                  Padding(
                    padding: const EdgeInsets.all(60.0),
                    child: Center(
                      child: Text(
                        &quot;${_challenges[index][&quot;name&quot;]}\n${_challenges[index][&quot;date&quot;]}&quot;,
                        style: TextStyle(
                            color: Colors.white,
                            fontSize: 20,
                            fontWeight: FontWeight.bold),
                      ),
                    ),
                  ),
                ],
              ),
            );
          });
  </code></pre>
  <p>every time i hot reload the app i get this error:</p>
  <pre><code>'package:flutter/src/rendering/sliver_grid.dart': Failed assertion: line 319 pos 15: 'crossAxisCount != null &amp;&amp; crossAxisCount &gt; 0': is not true.
  </code></pre>
  <p>and in just in case this is how i retrieved the data from Firestore:</p>
  <pre><code> List _challenges = [];
  
    fetchChallengeData() async {
      var _fireStoreInstance = FirebaseFirestore.instance;
      QuerySnapshot qn = await _fireStoreInstance.collection(&quot;challenges&quot;).get();
  
      setState(() {
        for (int i = 0; i &lt; qn.docs.length; i++) {
          _challenges.add({
            &quot;image-path&quot;: qn.docs[i][&quot;image-path&quot;],
            &quot;name&quot;: qn.docs[i][&quot;name&quot;],
            &quot;date&quot;: qn.docs[i][&quot;date&quot;],
          });
        }
      });
    }
  
    @override
    void initState() {
      fetchChallengeData();
  
      super.initState();
    }
  </code></pre>
  <p>the home screen where i use to display the element looks like:</p>
  <pre><code>return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.purple,
        title: Text(
          &quot;أتحداك&quot;,
          style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold),
        ),
        centerTitle: true,
      ),
      body: SingleChildScrollView(
        child: Column(
          children: [
            AdsBanner(),
            SizedBox(
              height: 50,
            ),
            Directionality(
              textDirection: TextDirection.rtl,
              child: Padding(
                padding: const EdgeInsets.all(8.0),
                child: Row(
                  children: [
                    Text(
                      &quot;التحديات&quot;,
                      style: TextStyle(fontSize: 20),
                    ),
                    Text(
                      &quot; (إضغط على التحدي للإشتراك به)&quot;,
                      style: TextStyle(fontSize: 15),
                    )
                  ],
                ),
              ),
            ),
            ChallengeCard(),
          ],
        ),
      ),
      endDrawer: NavigationDrawer());
  </code></pre>
  <p>so basically the parent is column and the parent of the column is singleChildScrollView,</p>
  <p>any help i would be grateful, Thanks.</p>