Skip to content

uxmarkowski/overlay_popup_entry

Repository files navigation

overlay_popup_entry

A Flutter package that allows you to display custom pop-up elements through the Overlay without needing to wrap your Scaffold. It can be controlled through a custom controller, making it easy to show and hide overlay popups dynamically.

Features

  • Display custom popups on top of your current screen via Overlay.
  • No need to wrap Scaffold, the popups can be shown independently.
  • Controlled through a custom controller, enabling dynamic visibility and interactions.

Getting started

To use overlay_popup_entry, add it to your pubspec.yaml file:

dependencies:
  overlay_popup_entry: ^1.0.0

Then run flutter pub get to install the package.

Usage

  1. Import the package in your Dart file:
import 'package:overlay_popup_entry/overlay_popup_entry.dart';
  1. Create an instance of OverlayPopupController:
final overlayController = OverlayPopupController();
  1. Use the controller to show or hide the popup:
overlayController.show(
child: YourContent()
); // Show the popup
overlayController.hide(); // Hide the popup
  1. Create your custom popup widget and pass it to the controller as needed.

Example

Here's a simple example of how to use the OverlayPopup in your app:

import 'package:flutter/material.dart';
import 'package:overlay_popup_entry/overlay_popup_entry.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  final OverlayPopupController _popupController = OverlayPopupController();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Overlay Popup Example')),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              _popupController.show(
                  child: YourContent()
              ); // Show the popup
            },
            child: Text('Show Popup'),
          ),
        ),
      ),
    );
  }
}

In this example, tapping the "Show Popup" button will display the popup, which can be controlled through the OverlayPopupController.

Additional information

  • For detailed documentation, check the official Flutter documentation.
  • To contribute, fork the repository, create a branch, and submit a pull request.
  • For any issues or feature requests, open an issue on the repository's GitHub page.

Happy coding!

About

My flutter package for managing overlay popups via a controller.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages