ListUic<T> constructor
ListUic<T> ({
- Key? key,
- required ListUicController<
T> controller, - required Widget itemBuilder(
- T item
- Icon emptyDataIcon = const Icon(Icons.sentiment_dissatisfied, size: 96.0, color: Colors.black26),
- String emptyDataText = 'No results',
- Widget? emptyDataView,
- Icon emptyErrorIcon = const Icon(Icons.error_outline, size: 96.0, color: Colors.black26),
- String emptyErrorText = 'Error loading data',
- Widget? emptyErrorView,
- String emptyProgressText = 'Loading...',
- Widget? emptyProgressView,
- Widget? nextPageProgressView,
- String errorText = 'Error loading data',
- Color errorColor = Colors.redAccent,
Implementation
ListUic({
Key? key,
required this.controller,
required this.itemBuilder,
this.emptyDataIcon = const Icon(
Icons.sentiment_dissatisfied,
size: 96.0,
color: Colors.black26,
),
this.emptyDataText = 'No results',
Widget? emptyDataView,
this.emptyErrorIcon = const Icon(
Icons.error_outline,
size: 96.0,
color: Colors.black26,
),
this.emptyErrorText = 'Error loading data',
Widget? emptyErrorView,
this.emptyProgressText = 'Loading...',
Widget? emptyProgressView,
Widget? nextPageProgressView,
this.errorText = 'Error loading data',
this.errorColor = Colors.redAccent,
}) : assert(emptyDataView != null || emptyDataText.isNotEmpty),
emptyDataView = emptyDataView ??
ListUicEmptyView(
controller: controller,
icon: emptyDataIcon,
text: emptyDataText),
emptyErrorView = emptyErrorView ??
ListUicEmptyView(
controller: controller,
icon: emptyErrorIcon,
text: emptyErrorText),
emptyProgressView = emptyProgressView ??
ListUicEmptyProgressView(text: emptyProgressText),
nextPageProgressView =
nextPageProgressView ?? const ListUicNextPageProgressView(),
super(key: key);