cosee/alphabet_list_view
Flutter 套件。具有黏性標題和類似 iOS 的可點擊側邊欄的 ListView。
- Stars
- 14
- Forks
- 20
- 最近推送(UTC)
- 2026年8月16日
- 專案狀態
- 未封存
語言DartC++CMakeSwiftCHTMLShellKotlinObjective-C
技術主題
使用的依賴
依賴清單 5 項
- flutter
{"sdk":"flutter"} - flutter_sticky_header
^0.8.0 - flutter_test開發依賴
{"sdk":"flutter"} - cosee_lints開發依賴
^0.13.0 - dart_code_linter開發依賴
^4.0.0
原始 README
以下為英文專案原文快照,最新內容請造訪 GitHub。
展開 / 收合專案 README
Alphabet List View
pub package package publisher style license
A ListView with sticky headers and an iOS-like clickable sidebar.
Preview example
Features
- Easy to create
- Customizable header
- Customizable sidebar
- Customizable overlay
- Right to left language support
- Configurable sidebar items
Usage
Depend on it:
dependencies:
alphabet_list_view: ^1.1.1
Import it:
import 'package:alphabet_list_view/alphabet_list_view.dart';
Example:
final List<AlphabetListViewItemGroup> tech = [
AlphabetListViewItemGroup(
tag: 'A',
children: const [
Text('Apple'),
Text('Amazon'),
Text('Alibaba'),
],
),
AlphabetListViewItemGroup(
tag: 'I',
children: const [
Text('Intel'),
Text('IBM'),
],
),
];
AlphabetListView(
items: tech,
);
Default symbols
You can easily get the alphabet (A-Z) using the following code:
final String alphabet = DefaultScrollbarSymbols.alphabet;
Customization options
final List<AlphabetListViewItemGroup> tech = [
AlphabetListViewItemGroup(
tag: 'A',
children: const [
Text('Apple'),
Text('Amazon'),
Text('Alibaba'),
],
),
AlphabetListViewItemGroup(
tag: 'I',
children: const [
Text('Intel'),
Text('IBM'),
],
),
];
final AlphabetListViewOptions options = AlphabetListViewOptions(
listOptions: ListOptions(
listHeaderBuilder: (context, symbol) => Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.circular(100),
),
child: Text(symbol),
),
),
),
scrollbarOptions: const ScrollbarOptions(
backgroundColor: Colors.yellow,
),
overlayOptions: const OverlayOptions(
showOverlay: false,
),
);
AlphabetListView(
items: tech,
options: options,
);