Search packages, repositories and app categories

GitHub repositoryCaiJingLong/flutter_load_widget

flutter_load_widget

CaiJingLong/flutter_load_widget open-source repository details.

flutter_load_widget project cover
Stars
35
Forks
12
Last push (UTC)
Aug 22, 2022
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

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(),
);

Debug custom loading widget in Flutter inspector

You can try to use next method to include the widget:

MaterialApp(
  builder: (context, widget) {
    return LoadingProvider(
      child: widget,
    );
  },
);

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

Params Type Default Value Desc
backgroundColor Color Colors.black54 Background transparent mask
tapDismiss bool true Will it close when touching the background?
loadingBackgroundColor Color Colors.white Background color for the center Loading Widget
loadingPadding EdgeInsets EdgeInsets.all(8.0) Padding for the center Loading Widget
loadingSize Size Size(55,55) Size for the center Loading Widget
animDuration Duration Duration(milliseconds: 300) Show/Hide Time Duration
Caijinglong GitHub avatar
GitHub author

Caijinglong ↗

from android to flutter. also know ios/react/flutter/python/golang

@fluttercandies Beijing/ChinaOfficial website ↗
LanguagesDartObjective-CShellJava

Packages published by this repository

Dependencies used

Dependency list 2 items

  • flutter{"sdk":"flutter"}
  • flutter_testDevelopment{"sdk":"flutter"}

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗