Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

[scrollable_positioned_list] Scrollbar issue fix discussion #303

@k-s-t-i

Description

@k-s-t-i

Problem description

Scrollable positioned list currently isn't compatible with the entire Scrollbar API since a ScrollController is necessary for some features of the API.

The following code works with a scrollbar. But not when isAlwaysShown is set to true.

return MediaQuery.removePadding(
      context: context,
      removeTop: true,
      removeBottom: true,
      child: Scrollbar(
        thickness: 8,
        radius: Radius.circular(4),
        interactive: true,
        child: ScrollablePositionedList.builder(
              itemCount: totalItems,
              itemScrollController: itemScrollController,
              itemPositionsListener: itemPositionsListener,
              initialScrollIndex:
                  selectedValue != null ? items.indexOf(selectedValue!) : 0,
              itemBuilder: (context, index) {
                return GestureDetector(
                  onTap: () => onSelect(items[index]),
                  child: Container(
                    color: getItemColor(index, context),
                    child: buildDropdownList(context, index),
                  ),
                );
              },
          ),
     ), 
);

Proposal

I am thinking of extending the ItemScrollController API like this:
bitstackapp@0466304. To provide access to the scroll controller.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions