flutter_loader library

Copyright 2021 Hieu Rocker

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Simplifies resource loading with convenient builders.

Use DefaultLoaderBuilder for handling resource loading with default UI implementations for different states in LoaderState. For advanced usage, use LoaderBuilder.

Classes

DefaultLoaderBuilder
A Widget that makes it easier to use LoaderBuilder by providing different WidgetBuilder for different states in the loader's lifecycle.
DefaultLoaderThemeData
Defines the configuration of the overall visual Theme for a DefaultLoaderBuilder.
LoaderBuilder
A Widget that replace its content with different widgets depends on the state of the loader.
LoaderController
A controller for the loader.

Enums

LoaderState
State of the loader in its lifecycle: init -> loading <-> error or loaded

Functions

defaultErrorMessageResolver(dynamic error) String
The default ErrorMessageResolver.

Typedefs

ErrorMessageResolver = String Function(dynamic error)
Signature for a function that converts an error into a String.
FutureProvider = Future Function()
Signature for a function that creates a Future.
LoaderWidgetBuilder = Widget Function(BuildContext, LoaderController, Widget?)
Signature for a function that creates a Widget from BuildContext, LoaderController and Widget. The given Widget is provided via LoaderBuilder.child for caching purpose.