Provider support for overlay, make it easy to build toast and In-App notification.

Overview

overlay_support

Pub Pub CI codecov

Provider support for overlay, make it easy to build toast and In-App notification.

this library support ALL platform

Interaction

If you want to see the ui effect of this library, just click here https://boyan01.github.io/overlay_support/#/

How To Use

  1. add dependencies into you project pubspec.yaml file

    dependencies:
        overlay_support: latest_version
    • Current latest_version is Pub

For project without migrate to null safety, please use version overlay_support: 1.0.5-hotfix1

  1. wrap your AppWidget with OverlaySupport
  return OverlaySupport.global(child: MaterialApp());
  1. show toast or simple notifications
import 'package:overlay_support/overlay_support.dart';

void onClick() {
    // popup a toast.
    toast('Hello world!');

    // show a notification at top of screen.
    showSimpleNotification(
        Text("this is a message from simple notification"),
        background: Colors.green);
}

more instructions check here : example/README.md

License

see License File

End

if you have some suggestion or advice, please open an issue to let me known. This will greatly help the improvement of the usability of this project. Thanks.

Comments
  • Notifications are overlapping each other

    Notifications are overlapping each other

    I think by default, notifications should wait for an active notification to be dismissed before displaying the next one.

    I can't see a case where someone would want to have a notification removed by another one without it running its course, honestly, so this behavior is a must!

    opened by benPesso 11
  • WidgetsBinding.instance now is not nullable

    WidgetsBinding.instance now is not nullable

    in latest version of flutter WidgetsBinding.instance changed type from nullable to non nullable

    we get this warning :

    Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
    
    bug 
    opened by DJafari 9
  • NoSuchMethodError: The method 'hide' was called on null.

    NoSuchMethodError: The method 'hide' was called on null.

    Thank you for such a fantastic package. I spot an exception:

    NoSuchMethodError: The method 'hide' was called on null. Receiver: null Tried calling: hide() #0 NotificationEntry.dismiss (package:overlay_support/src/overlay_entry.dart:22) #1 showOverlay.. (package:overlay_support/src/overlay.dart:43) #2 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:988) #3 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleBeginFrame. (package:flutter/src/scheduler/binding.dart:904)

    bug 
    opened by ryanhz 9
  • Support for `BottomSlideNotification`

    Support for `BottomSlideNotification`

    Hi,

    This PR covers the new implementation of #39 which removes references to SnackBar and updates implementation to use position which can be NotificationPosition.top or NotificationPosition.bottom.

    opened by gilescm 6
  • Support for SnackBar style notifications

    Support for SnackBar style notifications

    Hi, I've recently used this package to show a "No internet connection" message, and the use case was that the notification appear at the bottom of the screen like the SnackBar widget.

    I saw that there's no customisability in this regard. So I've made a few very small changes to showSimpleNotification, showOverlayNotification and added a new BottomSlideNotification to allow for behaviour that mimics SnackBar, with all the other benefits of this package.

    Improvements to my implementation can be made, for instance BottomSlideNotification only has a small difference to TopSlideNotification so they could be merged with an optional position parameter passed in. However, I didn't want to change the code too much so didn't implement this.

    Let me know what you think and if this is something you would want to bring into the main branch.

    opened by gilescm 6
  • Provide modal parameter to showSimpleNotification

    Provide modal parameter to showSimpleNotification

    Currently, in its simplest form - the quickest way to show a notification at the top of the screen is via showSimpleNotification. Without resorting to writing custom notification overlay, can we extend the showSimpleNotification to include an optional parameter

    bool modal=true

    This way - if Notifications are tied to (say) button taps - then repeated Notifications will not be shown because the first Notification at the top of the screen being MODAL will prevent this.

    enhancement 
    opened by MsXam 5
  • Make overlays and toasts clickthrough

    Make overlays and toasts clickthrough

    Thanks a lot for making this fantastic package!

    It would be great if there were a way to make the overlays and toasts optionally clickthrough. I use this package to display an info notification, but it currently blocks other elements behind it from being clicked. This is suboptimal as it breaks the flow of the app. Would this be possible?

    enhancement 
    opened by blue1stone 4
  • Issue with RestartWidget.

    Issue with RestartWidget.

    Hi, I use RestartWidget or PhoenixWidget with MaterialApp. I try to implement overlaysupport.global by following your guide and after that my restart function not work anymore. Env:

    • Flutter channel master
    • overlay_support: 1.2.1

    Please help!

    opened by mrbamboovn 4
  • getting The method 'ancestorWidgetOfExactType' isn't defined for the class 'BuildContext'.

    getting The method 'ancestorWidgetOfExactType' isn't defined for the class 'BuildContext'.

    Describe the bug Running "flutter pub get" in safehandsfordoc... Launching lib\main.dart on Chrome in debug mode... lib\main.dart /D:/flutter/.pub-cache/hosted/pub.dartlang.org/overlay_support-1.0.5/lib/src/overlay.dart:156:19: Error: The method 'ancestorWidgetOfExactType' isn't defined for the class 'BuildContext'.

    'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/D:/flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'ancestorWidgetOfExactType'. if (context.ancestorWidgetOfExactType(OverlaySupport) != null) { ^^^^^^^^^^^^^^^^^^^^^^^^^ /D:/flutter/.pub-cache/hosted/pub.dartlang.org/overlay_support-1.0.5/lib/src/overlay_entry.dart:17:37: Error: The method 'ancestorWidgetOfExactType' isn't defined for the class 'BuildContext'.

    'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/D:/flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'ancestorWidgetOfExactType'. final animatedOverlay = context.ancestorWidgetOfExactType(_AnimatedOverlay);

                             ^^^^^^^^^^^^^^^^^^^^^^^^^
    

    /D:/flutter/.pub-cache/hosted/pub.dartlang.org/overlay_support-1.0.5/lib/src/theme.dart:53:20: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.

    'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/D:/flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'. return context.inheritFromWidgetOfExactType(OverlaySupportTheme) as OverlaySupportTheme;

            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    

    Failed to compile application. Exited (sigterm)

    To Reproduce Steps to reproduce the behavior:

    1. just added in pubyaml
    2. returned OverlaySupport
    3. used showSimpleNotification

    Version (please complete the following information):

    • Flutter Version: Flutter 1.26.0-17.2
    • OS: WEB
    • OverlaySupport Version : ^1.0.5
    bug 
    opened by hemanthkb97 4
  • Can you showSimpleNotification from the bottom of the screen?

    Can you showSimpleNotification from the bottom of the screen?

    Is it possible to have the notification show at the bottom of the screen rather than the top? Is there something I could modify in the package to get it to show at the bottom instead of the top?

    bug 
    opened by callumclift 4
  • error: The class 'WidgetsBinding' cannot be null

    error: The class 'WidgetsBinding' cannot be null

    Describe the bug image

    To Reproduce Steps to reproduce the behavior:

    • Add OverlaySupport to flutter project (v2.10.5)
    • Execute "flutter run"

    image

    Expected behavior "flutter run" should work correctly

    Version (please complete the following information):

    • Flutter Version: [v2.10.5]
    • OS: [Android]
    • OverlaySupport Version : [v2.0.0]

    Proposed solution To fix this problem, you need to add ! to file overlay_entry.dart on line 102 (as in the screen below) image

    bug 
    opened by ironda2020 3
  • Popups/Calendar is not coming over the overlay

    Popups/Calendar is not coming over the overlay

    Description

    If we put a calendar/Datepicker such as ShowDatePickerhttps://api.flutter.dev/flutter/material/showDatePicker.html button inside the overlay, the calendar popups behind the overlay which is not accessible. We have to close the overlay to access the calendar.

    To Reproduce Steps to reproduce the behavior:

    1. Implement 'ShowOverlay' in an empty screen
    2. Add ShowDatePicker inside that overlay (overlay being the parent of ShowDatePicker)
    3. Try to open ShowDatePicker

    Expected behaviour The expected behaviour of the similar situation should be that the calendar stacks on top of the overlay and is accessible also.

    Screenshots Screenshot 2022-12-09 at 4 50 31 PM

    Version (please complete the following information):

    • Flutter Version: 3.3.9
    • OS: Chrome (macOS 14)
    • OverlaySupport Version : latest

    Additional context Add any other context about the problem here.

    bug 
    opened by Lazeeez 11
  •  Should  showOverlay() parameter builder be pass Animation instead of progress ?

    Should showOverlay() parameter builder be pass Animation instead of progress ?

    Now:

    typedef Widget AnimatedOverlayWidgetBuilder(BuildContext context, double progress);
    

    Should be:

    typedef Widget AnimatedOverlayWidgetBuilder(BuildContext context, Animation<double> animation);
    
    help wanted 
    opened by boyan01 1
Releases(v2.1.0)
Owner
Bin
不以物喜,不以己悲。
Bin
A really easy to use flutter toast library

BotToast ?? A really easy to use flutter toast library! Language: English | 中文简体 ?? Overview ?? Online Demo ?? Example ?? Renderings ?? Getting starte

null 719 Dec 28, 2022
Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.

sticky_and_expandable_list Flutter implementation of sticky headers and expandable list.Support use it in a CustomScrollView. README i18n:中文说明 Feature

tp7309 114 Nov 16, 2022
An alternative to Overlay which allows you to easily render and hit test a widget outside its parent bounds

An alternative to Overlay which allows you to easily render and hit test a widget outside its parent bounds. Based on the original idea by @shrouxm he

gskinner team 26 Dec 31, 2022
A basic flutter loading overlay

A basic loading overlay Features Creates a new scope where the user cannot leave until you programmatically pop it. Usage import 'package:flutter/mate

null 0 Nov 8, 2021
Flutter widget to show text in popup or overlay container

flutter_show_more_text_popup Flutter widget to show text in popup or overlay container Installation Add this to your package's pubspec.yaml file depen

Sanjay Sharma 44 Jul 5, 2022
Flutter overlay loading dialog example

flutter_overlay_loading_dialog_example Demo

Javeed Ishaq 4 Mar 24, 2022
A Flutter package to show beautiful animated snackbars directly using overlay

Easily show beautiful snack bars directly using overlays. Create custom snack bars and show them with awesome animations.

Sajad Abdollahi 11 Dec 27, 2022
A package for flutter to use alert and toast within one line code.

easy_alert A package for flutter to use alert and toast within one line code. Getting Started Add easy_alert: to your pubspec.yaml, and run flutt

null 34 Jun 25, 2021
A pure flutter toast library

oktoast A library for flutter. A pure dart toast Library. You can completely customize the style of toast. 中文博客介绍 Screenshot Default Custom GIF Versio

OpenFlutter 438 Dec 24, 2022
A Styled Toast Flutter package.

flutter_styled_toast A Styled Toast Flutter package. You can highly customize toast ever. Beautify toast with a series of animations and make toast mo

null 67 Jan 8, 2023
Donation/Support buttons to allow you to add your favorite support buttons like: Paypal, Ko-fi or Patreon and more.

flutter_donation_buttons Donation/Support buttons to allow you to add your favorite support buttons like: Paypal, Ko-fi or Patreon and more. Getting S

null 6 Dec 10, 2022
Show custom in-app notification with any Widgets in flutter

notify_inapp show custom in-app notification with any Widgets. Getting Started Add this to your package's pubspec.yaml file: dependencies: notify_in

NewTab 3 Aug 19, 2022
A provider that passes EventBus down to all the widgets.

A provider that passes EventBus down to all the widgets.

null 0 Jul 9, 2022
Unofficial search provider for Medium for dart/flutter apps.

medium_search Unofficial search provider for Medium that can be used in dart or flutter apps. This library provides you an easy way to get search resu

Clone Conflict 1 Jan 10, 2022
Make your native android Dialog Fancy and Gify.

Make your native android Dialog Fancy and Gify. A library that takes the standard Android Dialog to the next level with a variety of styling options and Gif's. Style your dialog from code.

Shashank Singhal 522 Jan 2, 2023
Flutter custom widget to make a group buttons. Included Radio and CheckBox buttons.

Flutter widget to create a group of buttons fast ?? Included Radio and CheckBox buttons models with custom groping types ?? Show some ❤️ and star the

Stanislav Ilin 162 Dec 26, 2022
A Flutter Widget to make interactive timeline widget.

Bubble Timeline Package A Flutter Widget to make interactive timeline widget. This widget can be used to make Event Timelines, or Timelines for certai

Vansh Goel 12 Sep 22, 2022
Widget, that can make any static located widget hidable

Installing See the official installing guidline from hidable/install Usage & Overview To start using Hidable widget, we have to create a ScrollControl

Anon 18 Dec 16, 2022
A flutter carousel widget, support infinite scroll, and custom child widget.

carousel_slider A carousel slider widget. Features Infinite scroll Custom child widgets Auto play Supported platforms Flutter Android Flutter iOS Flut

Bart T 1 Nov 25, 2021