Code Monkey home page Code Monkey logo

flutteroverlayloader's Introduction

Build Passing Pub Version Pub Likes Pub Points Pub Popularity GitHub forks GitHub stars GitHub issues GitHub followers Twitter GitHub license

flutter_overlay_loader

A simple Flutter package for managing loader when fetching remote data or any long running async task. Flutter overlay loader is easy to use. You can show loader using only write two lines of code.

Overlay loader without overlaying Appbar

drawing drawing

Overlay Loader without overlaying BottomAppBar and also overlaying AppBar

drawing

Getting Started

Installing

dependencies:
  flutter_overlay_loader: ^1.0.8

Import

import 'package:flutter_overlay_loader/flutter_overlay_loader.dart';

How To Use

When start network call then call this line of code..

Loader.show(context,progressIndicator:LinearProgressIndicator());

After finished network call then call :

Loader.hide();

You can customize this loader..

Loader.show(context,
  isSafeAreaOverlay: false,
  isBottomBarOverlay: false,
  overlayFromBottom: 80,
  overlayColor: Colors.black26,
  progressIndicator: CircularProgressIndicator(backgroundColor: Colors.red),
  themeData: Theme.of(context)
    .copyWith(colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.green))
);

You can also check loader is showing or not using the property : Loader.isShown and you can prevent back pressed like this snippet:

WillPopScope(
  child: //TODO , 
  onWillPop:()async => !Loader.isShown
)

Finally dispose call hide method on dispose method :

@override
void dispose() {
  Loader.hide();

  super.dispose();
}

flutteroverlayloader's People

Contributors

aramayyes avatar ruaa-ali avatar spporan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutteroverlayloader's Issues

Cannot Show Overlay Loader

I cannot show Overlay Loader because of this exception:
I/flutter (10277): 'package:flutter/src/widgets/overlay.dart': Failed assertion: line 147 pos 12: '_overlay != null': is not true.
It is very simple case. I call Loader.show before network call but that exception failed. What did I miss?

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Version 10.0.19042.1348], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.63.1)
[√] Connected device (3 available)

flutter_overlay_loader: ^1.0.3

Why SafeArea

Hi I use you lib in my app, but after investigate your code I see that you use into the overlay the SafeArea. Now if we need to cover all down widgets with a semi transparent overlay, why we need to skip the notch or bottom padding?

Need Text

I include the plugin to my code working fine. But when want to add text below the progress bar text comes with yellow underline.

Overlay Color Change

Hi,

Can we change the background color of the overlay itself and are there any other properties we have access to in regards to the overlay?

Sorry, I'm a flutter NoOB!

Regards

Bottom part of screen not covered by the overlay

Hello,

If isAppbarOverlay=false is passed, bottom part of the screen is not covered by overlay on some phones (i.e. iPhone 13).
This is happening because SafeArea is used as a wrapper and in some phones SafeArea adds padding from bottom part of the screen. This could be easily fixed by utilizing bottom=false prop of SafeArea, that can exclude this padding if only app bad overlay should be excluded.

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.