0

I want to scroll a list of widgets together like in the given video. Preview Link

i try below code but it's not working. please guide me if do any changes.


ListView.separated(
            physics: const BouncingScrollPhysics(),
            itemCount: 10,
            separatorBuilder: (context, index) => sizeBoxHeight(6),
            itemBuilder: (context, index) => card(
              child: SizedBox(
                height: getProportionateScreenHeight(66),
                width: getProportionateScreenWidth(382),
                child: Padding(
                  padding: EdgeInsets.symmetric(
                    horizontal: getProportionateScreenWidth(10),
                    vertical: getProportionateScreenHeight(13),
                  ),
                  child: Row(
                    children: [
                      SizedBox(
                        width: getProportionateScreenWidth(121),
                        child: ///First Widget
                            ),
                          ],
                        ),
                      ),
                      SizedBox(
                        width: getProportionateScreenWidth(241),
                        child: SingleChildScrollView(
                          controller: _scrollController2,
                          physics: const BouncingScrollPhysics(),
                          scrollDirection: Axis.horizontal,
                          child: //Second Widget
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ),
          ),


as per this code only perticular index item is scrolled.

1 Answers1

2

set ScrollDirection to Axis.horizontal

Saad
  • 539
  • 2
  • 19