AdvancedListView<T> constructor
const
AdvancedListView<T> ({
- Key? key,
- required List<
T> items, - required Widget itemBuilder(
- BuildContext context,
- T item,
- int index,
- BoxConstraints constraints,
- LayoutMode layoutMode = LayoutMode.auto,
- SliverGridDelegate? gridDelegate,
- double? minItemWidth,
- bool isLoading = false,
- WidgetBuilder? skeletonBuilder,
- int skeletonCount = 10,
- int sortComparator(
- T a,
- T b
- bool sortOrderAscending = true,
- bool allowReorder = false,
- void onReorder()?,
- Widget indexBarBuilder(
- BuildContext context
- ValueChanged<
String> ? onIndexTap, - bool multiSelectEnabled = false,
- bool singleSelectEnabled = false,
- ValueChanged<
Set< ? onSelectionChanged,T> > - ValueChanged<
T?> ? onSelected, - Future<
void> onRefresh()?, - List<
Widget> leadingActions(- BuildContext context,
- T item,
- int index
- List<
Widget> trailingActions(- BuildContext context,
- T item,
- int index
- void onLeadingSwipe(
- T item,
- int index
- void onTrailingSwipe(
- T item,
- int index
- Widget? emptyWidget,
- Widget? errorWidget,
- ScrollController? scrollController,
- ScrollPhysics? physics,
- EdgeInsets? padding,
- double mainAxisSpacing = 0.0,
- double crossAxisSpacing = 0.0,
- double childAspectRatio = 1.0,
- bool showIndexBar = false,
- List<
String> ? indexBarLetters, - Duration animationDuration = const Duration(milliseconds: 300),
- ValueChanged<
T> ? onItemTap, - ValueChanged<
T> ? onItemLongPress, - Key? listKey,
Implementation
const AdvancedListView({
super.key,
required this.items,
required this.itemBuilder,
this.layoutMode = LayoutMode.auto,
this.gridDelegate,
this.minItemWidth,
this.isLoading = false,
this.skeletonBuilder,
this.skeletonCount = 10,
this.sortComparator,
this.sortOrderAscending = true,
this.allowReorder = false,
this.onReorder,
this.indexBarBuilder,
this.onIndexTap,
this.multiSelectEnabled = false,
this.singleSelectEnabled = false,
this.onSelectionChanged,
this.onSelected,
this.onRefresh,
this.leadingActions,
this.trailingActions,
this.onLeadingSwipe,
this.onTrailingSwipe,
this.emptyWidget,
this.errorWidget,
this.scrollController,
this.physics,
this.padding,
this.mainAxisSpacing = 0.0,
this.crossAxisSpacing = 0.0,
this.childAspectRatio = 1.0,
this.showIndexBar = false,
this.indexBarLetters,
this.animationDuration = const Duration(milliseconds: 300),
this.onItemTap,
this.onItemLongPress,
this.listKey,
}) : assert(
!(multiSelectEnabled && singleSelectEnabled),
'Cannot enable both multi-select and single-select modes',
);