simple_overlay 1.0.1 copy "simple_overlay: ^1.0.1" to clipboard
simple_overlay: ^1.0.1 copied to clipboard

A simple overlay library.

simple_overlay #

The simple and easy overlay package. With it, you can overlay a custom widget on any other widget.

Features #

  • Custom widget overlay;
  • Auto show on build;
  • Auto hide by duration;
  • Hide on tap outside overlay;
  • Controller with show/hide functions;
  • Custom background shadow color/opacity;

Getting started #

1 - Import library on pubspec.yaml:

dependencies:
  simple_overlay: ^1.0.0
copied to clipboard

2 - Add import for SimpleOverlay package on your file:

import 'package:simple_overlay/simple_overlay.dart';
copied to clipboard

3 - Creating SimpleOverlayWidget:

SimpleOverlayWidget(
  controller: SimpleOverlayController(),
  configuration: SimpleOverlayConfiguration(
    startShowing: false,
    hideOnTapOutside: true,
    autoHideDuration: const Duration(seconds: 5),
    shadowColor: Colors.black,
    shadowOpacity: 0.5,
    onShowOverlay: () {
      // Called after show overlay widget
    },
    onHideOverlay: () {
      // Called after hide overlay widget
    },
  ),
  position: SimpleOverlayPosition.topLeft(),
  overlayWidget: _overlayWidget,
  child: _child,
)
copied to clipboard

4 - Show/hide overlay manually:

final controller = SimpleOverlayController();
...
controller.show();
controller.hide();
copied to clipboard
4
likes
130
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.19 - 2025.04.03

A simple overlay library.

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on simple_overlay