CustomErrorBuilder class
A customizable error widget builder for pagination errors.
Provides pre-built error UI styles that can be used with error builders in pagination widgets.
Example Usage
SmartPaginatedListView<Product>(
request: PaginationRequest(page: 1, pageSize: 20),
provider: PaginationProvider.future(fetchProducts),
childBuilder: (context, product, index) => ProductCard(product: product),
firstPageErrorBuilder: (context, error, retry) {
return CustomErrorBuilder.material(
context: context,
error: error,
onRetry: retry,
title: 'Failed to load products',
message: 'Please check your internet connection',
);
},
loadMoreErrorBuilder: (context, error, retry) {
return CustomErrorBuilder.compact(
context: context,
error: error,
onRetry: retry,
);
},
)
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
card(
{required BuildContext context, required Exception error, required VoidCallback onRetry, String? title, String? message, double? elevation}) → Widget - Creates a card-style error widget with shadow and rounded corners
-
compact(
{required BuildContext context, required Exception error, required VoidCallback onRetry, String? message, Color? backgroundColor, Color? textColor}) → Widget - Creates a compact error widget for inline errors (like load more errors)
-
custom(
{required BuildContext context, required Exception error, required VoidCallback onRetry, required Widget builder(BuildContext context, Exception error, VoidCallback onRetry)}) → Widget - Creates a custom error widget with complete control
-
material(
{required BuildContext context, required Exception error, required VoidCallback onRetry, String? title, String? message, IconData? icon, Color? iconColor, String? retryButtonText}) → Widget - Creates a Material Design style error widget with full details
-
minimal(
{required BuildContext context, required Exception error, required VoidCallback onRetry, String? message}) → Widget - Creates a minimal error widget with just a message and retry icon button
-
snackbar(
{required BuildContext context, required Exception error, required VoidCallback onRetry, String? message, Color? backgroundColor}) → Widget - Creates a snackbar-style error widget that appears at the bottom