Skip to content

Anchor End on last list #20

@uzuki-P

Description

@uzuki-P

Need an option to make item anchor automatically change to SelectedItemAnchor.END when it's on the end of the list.
I'm trying using GetX Obs to change the anchor, but it kinda buggy right now.

Obx(() {
  final itemAnchor = (controller.newsIndex.value + 1) >=
          (controller.listNews.length - 1)
      ? SelectedItemAnchor.END
      : SelectedItemAnchor.START;

  return ScrollSnapList(
    itemCount: controller.listNews.length,
    itemSize: 264,
    onItemFocus: (i) => controller.newsIndex.value = i,
    itemBuilder: (_, i) => _newsItem(controller.listNews[i]),
    selectedItemAnchor: itemAnchor,
    endOfListTolerance: 200,
  );
})

Animation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions