overlay_manager 0.0.1 overlay_manager: ^0.0.1 copied to clipboard
Group and manage easily flutter overlays.
Overlay Manager #
Import #
import 'package:overlay_manager/overlay_manager.dart';
Create #
final manager = GlobalOverlayManager(navigatorKey: navKey);
or
final manager = ContextOverlayManager(context: context);
Using #
- For show an overlay:
manager.show(
barrierColor: Colors.red.shade500.withOpacity(0.2),
onDismiss: print,
isDismissible: false,
builder: (context, entry) => AlertMessage(
onClose: () => entry.close(0),
),
);
call entry.close(0)
to close this overlay.
- If you want to close all overlay when the screen is disposed, let's try:
@override
void dispose() {
manager.closeAll();
super.dispose();
}
- The [overlay] rearrange is coming soon.