load

pub package GitHub

Global loading widget, which can be used through simple configuration.

Pure flutter library, not use native code.

It is similar to OKToast in use.

ScreenShot

Screenshot_2019-05-21-14-08-42-731_com.example.ex.png

Usage

  • install

Add to yaml

version is pub package

dependencies:
  load: $latest_version
  • import
import 'package:load/load.dart';
  • wrap your application
void main() {
  runApp(
    LoadingProvider(
      child: MyApp(),
    ),
  );
}

or

LoadingProvider(
  child: MaterialApp(),
);

see example/lib/main.dart

  • show or hide dialog
showLoadingDialog();
showCustomLoadingWidget(Container()); // custom dialog
hideLoadingDialog();

Advanced Usage

Custom Loading Widget

Using LoadingThemeData and loadingWidgetBuilder

LoadingProvider(
  themeData: LoadingThemeData(),
  loadingWidgetBuilder: (ctx, data) {
    return Center(
      child: SizedBox(
        width: 30,
        height: 30,
        child: Container(
          child: CupertinoActivityIndicator(),
          color: Colors.blue,
        ),
      ),
    );
  },
  child: MyApp(),
);

image

Custom some config

All params is optional

ParamsTypeDefault ValueDesc
backgroundColorColorColors.black54Background transparent mask
tapDismissbooltrueWill it close when touching the background?
loadingBackgroundColorColorColors.whiteBackground color for the center Loading Widget
loadingPaddingEdgeInsetsEdgeInsets.all(8.0)Padding for the center Loading Widget
loadingSizeSizeSize(55,55)Size for the center Loading Widget
animDurationDurationDuration(milliseconds: 300)Show/Hide Time Duration

Libraries

load

Dart

VM

dart:ffi
Foreign Function Interface for interoperability with the C programming language. [...]

Web

dart:html
HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model). [...]
dart:js
Low-level support for interoperating with JavaScript. [...]
dart:js_util
Utility methods to efficiently manipulate typed JSInterop objects in cases where the name to call is not known at runtime. You should only use these methods when the same effect cannot be achieved with @JS annotations. These methods would be extension methods on JSObject if Dart supported extension methods.