bottom_loader 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 69

bottom_loader #

A light weight package to show loader using bottom modal sheet. As it is a stateful widget, you can change the text shown on the bottom sheet dynamically.

Get the library   Example

Supported Dart Versions #

Dart SDK version >= 2.1.0

Demo #

Installation #

Pub

Add the Package

dependencies:
  bottom_loader: ^0.0.1

How to use #

Import the package in your dart file

import 'package:bottom_loader/bottom_loader.dart';

Create an instance of BottomLoader

BottomLoader bl;

Initialise the bl object inside the build() method passing context to it

  1. Initialize the Bottom Loader object
    bl = new BottomLoader(context);
    
  2. By default it will show a bottom loader with loader as CircularProgressIndicator but you can specifycustom loader widget and specify if you want your bottom loader to dismiss when back button is pressed isDismissible parameter (Optional)
    //For bottom loader
    //loader aceepts any custom widget as loader
    bl = new BottomLoader(context, isDismissible: true/false, showLogs: true/false,loader: CircularProgressIndicator());
        
    
  3. Style the bottom loading sheet (Optional)
    bl.style(
      message: 'Loading File...',
      backgroundColor: Colors.white,
      messageTextStyle: TextStyle(
         color: Colors.black, fontSize: 19.0, fontWeight: FontWeight.w600)
      );
    
    Note: You don't need to use all parameters, all of them are optional
    
  4. Showing the bottom loader
    await bl.show();
    
  5. Dismissing the bottom loader
    bl.close().then((isHidden) {
      print(isHidden);
    });
    

Want to contribute? #

Pull requests and issues are always welcome!

How to contribute?

  1. Fork the repository
  2. Clone it to your local machine
  3. Open the project in your favourite editor
  4. Open cmd/terminal and run flutter clean and then flutter packages get
  5. Make the changes
  6. Create a Pull Request

View the issues here

This library is only tested for Android, iOS contributors are most welcome

0.1.1 #

  • New Demo image

0.1.0 #

  • Documentation update
  • Custom Widget support for loader bug fix

0.0.1 #

  • Package release

example/lib/main.dart

import 'package:bottom_loader/bottom_loader.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Bottom progress Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  BottomLoader bl;

  @override
  Widget build(BuildContext context) {
    bl = new BottomLoader(
      context,
      isDismissible: false,
    );
    //changing the default message
    bl.style(
      message: 'Please wait...',
    );
    return Scaffold(
      appBar: AppBar(
        title: Text('Bottom Loading'),
      ),
      body: Container(
        child: Center(
          child: RaisedButton(
              child: Text('Show bottom loader'),
              onPressed: () {
                //for showing the bottom loader invoke the show() method
                bl.display();

                //navigating to next page after 5 seconds
                Future.delayed(Duration(seconds: 5)).whenComplete(() {
                  bl.close();

                  Navigator.of(context).push(MaterialPageRoute(
                      builder: (context) => Scaffold(
                            body: Center(child: Text('Second Screen')),
                          )));
                });
              }),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  bottom_loader: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:bottom_loader/bottom_loader.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
39
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [bottom_loader] that is in a package requiring null.

Health suggestions

Format lib/bottom_loader.dart.

Run flutter format to format lib/bottom_loader.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test