loader_container

A Simple Loader Widget for Flutter! Easily show loading widgets when your page is doing tasks in the background!


License
MIT

Documentation

loader_container

A Simple Loader Widget for Flutter! Easily show loading widgets when your page is doing tasks in the background!

💾 Installation

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  loader_container: <latest version>

📦 Usage

Import this class

import 'package:loader_container/loader_container.dart';

Define a LoaderController

// The bool value determines the initial state of loading.
LoaderController _controller = LoaderController(true);

Basic structure

  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: LoaderContainer(
          controller: _controller,
          loadingWidget: Center(
              child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                CircularProgressIndicator(),
                RaisedButton(
                  onPressed: () {
                    _controller.value = false;
                  },
                  child: Center(
                    child: Text("Dismiss Loading!"),
                  ),
                )
              ],
            ),
          ),
          child: MyHomePage(title: 'Flutter Demo Home Page')),
    );
  }

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.