1

I am trying to do a carousel view by taking images from firebase. I am able to get the images in a listView and am able to successfully place them in cards, but unfortunately im not able to scroll the list view.

return Container(
          width: double.infinity,
          height: 300,
          child: ListView(
            scrollDirection: Axis.horizontal,
            children: snapshot.data!.docs.map((DocumentSnapshot document) {
              Map<String, dynamic> data = document.data()! as Map<String, dynamic>;
              return Padding(
                padding: const EdgeInsets.all(8.0),
                child: Center(
                  child: Stack(
                    children: [
                      SizedBox(
                        height: 200,
                        child: Card(
                          elevation: 10,
                          child: ClipRRect(
                              borderRadius: BorderRadius.circular(4),
                              child: Image.network(data['image'],width: 400,fit: BoxFit.fill,)),
                        ),
                      ),
                    ],
                  ),
                ),
              );
            }).toList(),
          ),
        );

Any help?

Sharan Raj
  • 11
  • 1

1 Answers1

0

Container > SingleChildScroolView > ListView try

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 31 '21 at 02:36