flutter_loader 0.2.6 icon indicating copy to clipboard operation
flutter_loader: ^0.2.6 copied to clipboard

A Flutter package for simplifying resource loading with customizable UI

flutter_loader #

Latest version on pub.dev

A Flutter package for simplifying resource loading.

Getting Started #

Import the library with

import 'package:flutter_loader/flutter_loader.dart';

Then you can build a UI for loading resource with

LoaderBuilder(
    loader: () async {
        await _loadResourceAsync();
    },
    builder: (context, controller, widget) {
        return _buildContent(context, controller, widget);
    }
)

Or use DefaultLoaderBuilder with default UI implementation:

DefaultLoaderBuilder(
    loader: () => _loadResourceAsync(),
)

DefaulLoaderBuilder offers UI for the full lifecycle of the loader:

  • init: show loading indicator
  • loading: show loading indicator
  • error: show an error message and a button for retrying
  • loaded: show a text message displaying the loaded data

You can optional provide initBuilder, loadingBuilder, errorBuilder, loadedBuilder to customize the UI for each of the above states. You can also customize the style of DefaultLoaderBuilder by providing DefaultLoaderThemeData via themeData.

5
likes
140
pub points
61%
popularity

Publisher

verified publisher iconhieurocker.com

A Flutter package for simplifying resource loading with customizable UI

Homepage

Documentation

API reference

License

Icon for licenses.Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_loader