Coder Social home page Coder Social logo

flutter_load_widget's Introduction

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

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

flutter_load_widget's People

Contributors

caijinglong avatar ebbbang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.