Home > OS >  ListView Scrolling not working in dart/flutter
ListView Scrolling not working in dart/flutter

Time:12-07

I need scrolling but not scrolling. at this moment, some data/item show but maximum data has been hide. so how to overcome/scrolling the all data items. I need scrolling but not scrolling. at this moment, some data/item show but maximum data has been hide. so how to overcome/scrolling the all data items. I need scrolling but not scrolling. at this moment, some data/item show but maximum data has been hide. so how to overcome/scrolling the all data items. my source code below :

   body: 
        ListView(
          children: [
            ListView.builder(
                scrollDirection: Axis.vertical,
                shrinkWrap: true,
                itemCount: _mOfferListRemoveDuplicate == null ? 0 : _mOfferListRemoveDuplicate.length,
                // itemCount: _mOfferList == null ? 0 : _mOfferList.length,
                itemBuilder: (BuildContext context, index) {
                  return Card(
                      margin: EdgeInsets.all(5.0),
                      elevation: 1,
                      child: SizedBox(
                        height: 100,
                        child: ListView(
                          children: [
                            Padding(
                              padding: const EdgeInsets.all(8.0),
                              child: Text(
                                _mOfferListRemoveDuplicate[index],
                                textAlign: TextAlign.left,
                                style: TextStyle(fontSize: 4.0, color: Colors.green,),
                              ),
                            ),
                            Padding(
                              padding: const EdgeInsets.all(8.0),
                              child: ListView.builder(
                                  scrollDirection: Axis.vertical,
                                  shrinkWrap: true,
                                  itemCount:
                                      _mOfferList == null ? 0 : _mOfferList.length,
                                  itemBuilder: (BuildContext context, index) {
                                    return Column(
                                      children: [
                                        Text(""   _mOfferList[index].offerTitle,style: TextStyle(fontSize: 5.0),)
                                      ],
                                    );
                                  }),
                            ),
                          ],
                        ),
                      ));
                }),
          ],
        ));

CodePudding user response:

in each listview and listview.builder (expect first one) use this code :

physics: ScrollPhysics(),
shrinkWrap: true,

it must work

  • Related