GitHub Pub Version Style

Used to simplify the display of AsyncValues from Riverpod.


The basic purpose of the package is to save you from having to create error/loading states every time you want to display an AsyncValue. The AsyncValueWidget automatically shows a progress indicator in the loading state, and an error message in the error state.

A "Retry" button can be added by specifying an onRetry callback.

Widget build(BuildContext context, WidgetRef ref) {
    final myValue = ref.watch(myProvider);

    return AsyncValueWidget<String>(
        value: myValue,
        builder: (context, data) {
            return Text(data);
        onRetry: () => ref.refresh(myProvider),


There is a variety of customisation options available in AsyncValueWidget. Many of these options can be applied globally (or for any other widget tree scope) using the DefaultAsyncValueWidgetConfig widget:

    transitionDuration: const Duration(milliseconds: 50),
    // Lots of other options available
    child: MyApp(),