Skip to content

eduardoazvd17/simple_overlay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.1

2 - Add import for SimpleOverlay package on your file:

import 'package:simple_overlay/simple_overlay.dart';

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,
)

4 - Show/hide overlay manually:

final controller = SimpleOverlayController();
...
controller.show();
controller.hide();

Releases

No releases published

Packages

No packages published