flutter_loader 0.2.5 copy "flutter_loader: ^0.2.5" to clipboard
flutter_loader: ^0.2.5 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.

6
likes
150
pub points
47%
popularity

Publisher

verified publisherhieurocker.com

A Flutter package for simplifying resource loading with customizable UI

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on flutter_loader