overlay_kit 1.0.3 icon indicating copy to clipboard operation
overlay_kit: ^1.0.3 copied to clipboard

Flutter OverlayKit.

overlay_loading_progress #

A flutter package of overlay kit.

Content #

  1. Loading Progress
  2. Toast Message
  3. Future Extension

Usage #

1- add this line to pubspec.yaml

   dependencies:
     overlay_kit: ^1.0.3

2- import package

import 'package:overlay_kit/overlay_kit.dart';

3- Wrap your MaterialApp with OverlayKit

  @override
  Widget build(BuildContext context) {
    return OverlayKit(
      child: MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: const MyHomePage(title: 'Flutter Demo Home Page'),
      ),
    );
  }

1. Loading Progress #

Start it with

OverlayLoadingProgress.start();

Stop it with

OverlayLoadingProgress.stop();

Complete Example

OverlayLoadingProgress.start();
await Future.delayed(const Duration(seconds: 3));
OverlayLoadingProgress.stop();
drawing

Use With Gif

OverlayLoadingProgress.start(gifOrImagePath: 'assets/loading.gif');
await Future.delayed(const Duration(seconds: 3));
OverlayLoadingProgress.stop();
drawing

Use With Custom Widget

OverlayLoadingProgress.start(
  widget: Container(
    width: MediaQuery.of(context).size.width / 4,
    padding: EdgeInsets.all(MediaQuery.of(context).size.width / 13),
    child: const AspectRatio(
    aspectRatio: 1,
    child: const CircularProgressIndicator(),
    ),
  ),
);
await Future.delayed(const Duration(seconds: 3));
OverlayLoadingProgress.stop();

2- Toast Message #

Show it with

OverlayToastMessage.show(textMessage: 'Dismiss All And Show Toast');
drawing

Use With Custom Widget

OverlayToastMessage.show(
  widget: yourWidget,
);
drawing

2- Future Extension #

Show Loading Progress with Extension.

Future.delayed(const Duration(seconds: 5)).callWithProgress();