railson-ferreira / scrollable_list_tab_scroller

Customizable Flutter widget that synchronizes a scrollable list of grouped items with tabs
https://pub.dev/packages/scrollable_list_tab_scroller
MIT License
19 stars 13 forks source link

Tab bar doesn't change when there is not enough items in the item builder #8

Closed theAkshay60 closed 5 months ago

theAkshay60 commented 10 months ago
Screenshot 2023-12-12 at 4 08 35 PM

In the above image when I tap on the Category Five, it's not scrolling to Category five, it's just stuck at category 4

ScrollableListTabScroller(
        padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 0),
        scrollDirection: Axis.vertical,
        headerContainerBuilder: (context, child) {
          return Container(
            color: Colors.white,
            child: child,
          );
        },
        itemCount: resultList!.length,
        itemBuilder: (BuildContext context, int index) {
          final data = resultList?[index];

          return Column(
            children: [
              Ink(
                color: Colors.lightGreen,
                child: ListTile(
                  title: Text(
                    '${data?.category}',
                    style: const TextStyle(fontSize: 18),
                  ),
                ),
              ),
              for (int i = 0; i < data!.item!.length; i++)
                ListTile(
                  title: Text(
                    '${data.item?[i]}',
                    style: const TextStyle(fontSize: 18),
                  ),
                ),
            ],
          );
        },
        tabBuilder: (BuildContext context, int index, bool active) {
          return Container(
            width: size.width / 4,
            margin: const EdgeInsets.symmetric(horizontal: 10),
            decoration: BoxDecoration(
              border: Border(
                bottom: BorderSide(
                  color: active
                      ? const Color.fromRGBO(0, 79, 224, 1)
                      : Colors.transparent,
                  width: 2,
                ),
              ),
            ),
            child: Center(
              child: Text(
                "${resultList?[index].category}",
                style: TextStyle(
                  fontSize: 18,
                  color: active
                      ? const Color.fromRGBO(0, 79, 224, 1)
                      : Colors.black,
                ),
              ),
            ),
          );
        },
        initialAlignment: 0,
        earlyChangePositionOffset: 50,
      )
railson-ferreira commented 10 months ago

I'm aware about this issue, although it is still in a very low priority.

ChikkuRajan commented 5 months ago

Hi , i am also facing same issue , is there any latest update regarding this(any solution)

railson-ferreira commented 5 months ago

Solved: https://github.com/railson-ferreira/scrollable_list_tab_scroller/releases/tag/v2.0.0

ChikkuRajan commented 5 months ago

Hi its working..
thanks,