reload_widget 0.0.5 copy "reload_widget: ^0.0.5" to clipboard
reload_widget: ^0.0.5 copied to clipboard

A Flutter component that supports tapping Reload when fetching data fails.

A Flutter component that supports tapping Reload when fetching data fails.

Usage #

  @override
  Widget build(BuildContext context) {
    return ReloadWidget(
      (BuildContext builderContext) {
        return Center(
          child: Text(
            'Data: $_data',
            style: const TextStyle(
              fontSize: 28,
              fontWeight: FontWeight.w700,
              color: Colors.green
            )
          )
        );
      },
      onReload: () async {
        // To simulate API calls
        final Result result = await Api.call();
  
        if (result.success) {
          _data = result.data;
        }
      
        return result.success ? ReloadStatus.succeeded : ReloadStatus.timeout;
      }
    );
  }
3
likes
150
pub points
11%
popularity

Publisher

verified publisherwacow.cc

A Flutter component that supports tapping Reload when fetching data fails.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on reload_widget