AppListView<T> constructor

const AppListView<T>({
  1. Key? key,
  2. required List<T> items,
  3. ValueChanged<T>? onTap,
  4. bool isSelectable = false,
  5. T? selectedItem,
  6. Color? selectedColor = Colors.blue,
  7. Color? unselectedColor = Colors.white,
  8. double? borderRadius = 12,
  9. double? borderWidth,
  10. Color? borderColor,
  11. EdgeInsets padding = const EdgeInsets.all(12),
  12. Color? backgroundColor = Colors.white,
  13. String titleBuilder(
    1. T
    )?,
  14. String subtitleBuilder(
    1. T
    )?,
  15. IconData leadingIconBuilder(
    1. T
    )?,
  16. IconData trailingIconBuilder(
    1. T
    )?,
  17. double? titleSize,
  18. double? subtitleSize,
  19. double iconSize = 24,
  20. double? dividerHeight,
  21. Color? titleColor,
  22. Color? subtitleColor,
  23. Color? leadingIconColor,
  24. Color? trailingIconColor,
  25. TextStyle? titleStyle,
  26. TextStyle? subtitleStyle,
  27. TextStyle? selectedTitleStyle = const TextStyle(color: Colors.white),
  28. TextStyle? unselectedTitleStyle,
  29. TextStyle? selectedSubtitleStyle = const TextStyle(color: Colors.white),
  30. TextStyle? unselectedSubtitleStyle,
  31. IconThemeData? selectedLeadingIconStyle = const IconThemeData(color: Colors.white),
  32. IconThemeData? unselectedLeadingIconStyle,
  33. IconThemeData? selectedTrailingIconStyle = const IconThemeData(color: Colors.white),
  34. IconThemeData? unselectedTrailingIconStyle,
  35. bool isSearchable = false,
  36. String searchHint = 'Search items...',
  37. TextStyle? searchHintStyle,
  38. IconData? searchLeadingIcon = Icons.search,
  39. IconData? searchTrailingIcon = Icons.clear,
  40. double searchHeight = 56,
  41. double? searchBorderRadius = 12,
  42. Color? searchFillColor = Colors.white,
  43. Color? searchFillActiveColor = const Color(0xFFF2F2F2),
  44. Color? searchBorderColor = Colors.grey,
  45. double searchBorderWidth = 1,
  46. IconThemeData? searchLeadingIconStyle = const IconThemeData(color: Colors.grey),
  47. IconThemeData? searchTrailingIconStyle = const IconThemeData(color: Colors.grey),
  48. ValueChanged<String>? onSearchChanged,
  49. bool isShowTitle = true,
  50. String? listTitle = "Items",
  51. TextStyle? listTitleStyle,
  52. IconData listFilterIcon = Icons.filter_list,
  53. IconThemeData? listFilterIconStyle,
  54. bool isShowFilter = true,
  55. List<String> filterNames = const ['New', 'Old'],
  56. ValueChanged<String>? onFilterSelected,
  57. Widget? noResultsWidget,
  58. 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,
});