Skip to content

AsyncOverlay is a simple package for creating custom loading overlays during async Future operations, inspired by FutureProgressDialog.

License

Notifications You must be signed in to change notification settings

imark00/async_overlay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

async_overlay

AsyncOverlay is a simple package, inspired by the future_progress_dialog package for displaying custom overlay UIs during asynchronous Future operations. It empowers developers to define their own unique loading overlays, offering a flexible alternative to default UI options.

Supported Dart Version

Dart SDK version >=3.6.0

Installation

Add async_overlay to pubspec:

dependencies:
  async_overlay: # latest version 

Usage

Import the package

import 'package:async_overlay/async_overlay.dart';

Call showDialog method with AsyncOverlay to show overlay loading UI

  • without message
await showDialog(
      context: context,
      builder: (context) => AsyncOverlay(asyncFutureTask()),
    );

  • with message
await showDialog(
      context: context,
      builder: (context) => AsyncOverlay(
        asyncFutureTask(),
        message: Text('Loading'),
      ),
    );

  • with custom loading widget
await showDialog(
      context: context,
      builder: (context) => AsyncOverlay(
        asyncFutureTask(),
        message: Text('Loading'),
        loadingWidget: const CustomLoader(),
      ),
    );

  • with custom overlay UI
await showDialog(
      context: context,
      builder: (context) => AsyncOverlay(
        asyncFutureTask(),
        customOverlayUI: Container(
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.all(Radius.circular(16)),
          ),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              Lottie.network(
                'https://lottie.host/add90c20-d592-4c79-90b1-35d4cdff3035/SXrl7L2Y8G.json',
                height: 200,
                width: 230,
                renderCache: RenderCache.raster,
              ),
              Lottie.network(
                'https://lottie.host/a3f86098-dd8c-4f30-9aa4-e4795eda9243/9b4YUI1crz.json',
                height: 112,
                width: 127,
                renderCache: RenderCache.raster,
              ),
            ],
          ),
        ),
      ),
    );

Visitors Count

Loading

About

AsyncOverlay is a simple package for creating custom loading overlays during async Future operations, inspired by FutureProgressDialog.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published