AppListView<T> constructor
const
AppListView<T> ({
- Key? key,
- required List<
T> items, - ValueChanged<
T> ? onTap, - bool isSelectable = false,
- T? selectedItem,
- Color? selectedColor = Colors.blue,
- Color? unselectedColor = Colors.white,
- double? borderRadius = 12,
- double? borderWidth,
- Color? borderColor,
- EdgeInsets padding = const EdgeInsets.all(12),
- Color? backgroundColor = Colors.white,
- String titleBuilder(
- T
- String subtitleBuilder(
- T
- IconData leadingIconBuilder(
- T
- IconData trailingIconBuilder(
- T
- double? titleSize,
- double? subtitleSize,
- double iconSize = 24,
- double? dividerHeight,
- Color? titleColor,
- Color? subtitleColor,
- Color? leadingIconColor,
- Color? trailingIconColor,
- TextStyle? titleStyle,
- TextStyle? subtitleStyle,
- TextStyle? selectedTitleStyle = const TextStyle(color: Colors.white),
- TextStyle? unselectedTitleStyle,
- TextStyle? selectedSubtitleStyle = const TextStyle(color: Colors.white),
- TextStyle? unselectedSubtitleStyle,
- IconThemeData? selectedLeadingIconStyle = const IconThemeData(color: Colors.white),
- IconThemeData? unselectedLeadingIconStyle,
- IconThemeData? selectedTrailingIconStyle = const IconThemeData(color: Colors.white),
- IconThemeData? unselectedTrailingIconStyle,
- bool isSearchable = false,
- String searchHint = 'Search items...',
- TextStyle? searchHintStyle,
- IconData? searchLeadingIcon = Icons.search,
- IconData? searchTrailingIcon = Icons.clear,
- double searchHeight = 56,
- double? searchBorderRadius = 12,
- Color? searchFillColor = Colors.white,
- Color? searchFillActiveColor = const Color(0xFFF2F2F2),
- Color? searchBorderColor = Colors.grey,
- double searchBorderWidth = 1,
- IconThemeData? searchLeadingIconStyle = const IconThemeData(color: Colors.grey),
- IconThemeData? searchTrailingIconStyle = const IconThemeData(color: Colors.grey),
- ValueChanged<
String> ? onSearchChanged, - bool isShowTitle = true,
- String? listTitle = "Items",
- TextStyle? listTitleStyle,
- IconData listFilterIcon = Icons.filter_list,
- IconThemeData? listFilterIconStyle,
- bool isShowFilter = true,
- List<
String> filterNames = const ['New', 'Old'], - ValueChanged<
String> ? onFilterSelected, - Widget? noResultsWidget,
- EdgeInsetsGeometry? searchPadding,
Implementation
const AppListView({
super.key,
required this.items,
this.onTap,
// Selection
this.isSelectable = false,
this.selectedItem,
this.selectedColor = Colors.blue,
this.unselectedColor = Colors.white,
// Border
this.borderRadius = 12,
this.borderWidth,
this.borderColor,
// Layout
this.padding = const EdgeInsets.all(12),
// Background
this.backgroundColor = Colors.white,
// Content builders
this.titleBuilder,
this.subtitleBuilder,
this.leadingIconBuilder,
this.trailingIconBuilder,
// Sizes
this.titleSize,
this.subtitleSize,
this.iconSize = 24,
this.dividerHeight,
// Colors (fallback only)
this.titleColor,
this.subtitleColor,
this.leadingIconColor,
this.trailingIconColor,
// Base styles
this.titleStyle,
this.subtitleStyle,
// Selected / Unselected TEXT styles
this.selectedTitleStyle = const TextStyle(color: Colors.white),
this.unselectedTitleStyle,
this.selectedSubtitleStyle = const TextStyle(color: Colors.white),
this.unselectedSubtitleStyle,
// Selected / Unselected ICON styles
this.selectedLeadingIconStyle = const IconThemeData(color: Colors.white),
this.unselectedLeadingIconStyle,
this.selectedTrailingIconStyle = const IconThemeData(color: Colors.white),
this.unselectedTrailingIconStyle,
// Search
this.isSearchable = false,
this.searchHint = 'Search items...',
this.searchHintStyle,
this.searchLeadingIcon = Icons.search,
this.searchTrailingIcon = Icons.clear,
this.searchHeight = 56,
this.searchBorderRadius = 12,
this.searchFillColor = Colors.white,
this.searchFillActiveColor = const Color(0xFFF2F2F2),
this.searchBorderColor = Colors.grey,
this.searchBorderWidth = 1,
// Search icon styles
this.searchLeadingIconStyle = const IconThemeData(color: Colors.grey),
this.searchTrailingIconStyle = const IconThemeData(color: Colors.grey),
this.onSearchChanged,
// List title
this.isShowTitle = true,
this.listTitle = "Items",
this.listTitleStyle,
this.listFilterIcon = Icons.filter_list,
this.listFilterIconStyle,
this.isShowFilter = true,
this.filterNames = const ['New', 'Old'],
this.onFilterSelected,
// No results widget
this.noResultsWidget,
this.searchPadding,
});