maheshj01 / alphabet_scroll_view

A Scrollable ListView Widget with the dynamic vertical Alphabet List on the Side which you can drag and tap to scroll to the first item starting with that letter in the list.
https://pub.dev/packages/alphabet_scroll_view
MIT License
27 stars 20 forks source link

Redesign and simplify the API to mimic official ListView.builder #12

Open maheshj01 opened 1 year ago

maheshj01 commented 1 year ago

Current API

 AlphabetScrollView(
              list: list.map((e) => AlphaModel(e)).toList(),
              // isAlphabetsFiltered: false,
              alignment: LetterAlignment.right,
              itemExtent: 50,
              unselectedTextStyle: TextStyle(),
              selectedTextStyle: TextStyle(),
              overlayWidget: (String value){
                return YourWidget();
              },
              itemBuilder: (_, k, id) {
                return ListWidget(),
                );
              },
            )

Proposal

 AlphabetScrollView(
    list: list.map((e) => AlphaModel(e)).toList(),
    alignment: LetterAlignment.right,
    unselectedTextStyle: TextStyle(),
    selectedTextStyle: TextStyle(),
    overlayBuilder: (BuildContext context, String selectedLetter){
       return  Widget(selectedLetter);
     },
     itemBuilder: (_, k, id) {
       return ListWidget();
    },
  );

Sanitary Tests

maheshj01 commented 1 year ago

Proposed Solution

philitell commented 1 year ago

It would also be great if it is possible to set scroll-physics - like for normal ListView e.g.

    physics: const ClampingScrollPhysics(
      parent: AlwaysScrollableScrollPhysics(),
    ),
maheshj01 commented 1 month ago

Here are some questions when answered would help getting this issue resolved faster.

On phone right now will make this detailed soon