A package for controlling overlay components such as in-app notification, toast, and snack bar.
- Support all platforms(Implemented only with dart)
- Provide several types of overlays
- in-app notification
- toast
- snack bar
- Various overlay control features
- show
- close
- close all
- queued
- clear queue
- dismissible
- Easily customizable
- animation
- duration
- shadow
- vibration
- color
- etc
dependencies:
nice_overlay: ^latest_version
import 'package:nice_overlay/nice_overlay.dart';
Create navigator key and call NiceOverlay.init(). #
GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
NiceOverlay.init(navigatorKey);
MaterialApp(
navigatorKey: navigatorKey,
// ...
);
// These examples are just very simple examples.
// There are more properties for customizing.
// Please check the Properties part to see other properties!
// in-app notification
NiceOverlay.showInAppNotification(
NiceInAppNotification(
title: const Text('In app notification'),
body: const Text('What a nice in app notification!'),
),
);
// snack bar
NiceOverlay.showSnackBar(
NiceSnackBar(
message: Text('What a nice snack bar!'),
action: GestureDetector(
onTap: NiceOverlay.closeSnackBar,
child: const Text('close'),
),
),
);
// toast
NiceOverlay.showToast(
NiceToast(
message: const Text('What a nice toast!'),
),
);
| name |
type |
| title |
Widget? |
| body |
Widget? |
| onTap |
void Function()? |
| leading |
Widget? |
| trailing |
Widget? |
| vibrate |
bool |
| displayDuration |
Duration |
| minimumDisplayDuration |
Duration |
| dismissDirection |
DismissDirection |
| isDismissible |
bool |
| showingAnimationCurve |
Curve |
| showingAnimationDuration |
Duration |
| closingAnimationCurve |
Curve |
| closingAnimationDuration |
Duration |
| backgroundColor |
Color |
| boxShadows |
List |
| borderRadius |
BorderRadius |
| padding |
EdgeInsets |
| margin |
EdgeInsets |
| name |
type |
| message |
Widget? |
| action |
Widget? |
| vibrate |
bool |
| displayDuration |
Duration |
| minimumDisplayDuration |
Duration |
| isDismissible |
bool |
| showingAnimationCurve |
Curve |
| showingAnimationDuration |
Duration |
| closingAnimationCurve |
Curve |
| closingAnimationDuration |
Duration |
| backgroundColor |
Color |
| boxShadows |
List |
| borderRadius |
BorderRadius |
| padding |
EdgeInsets |
| margin |
EdgeInsets |
| niceSnackBarPosition |
NiceSnackBarPosition |
| useSafeArea |
bool |
| name |
type |
| message |
Widget? |
| onTap |
void Function()? |
| vibrate |
bool |
| displayDuration |
Duration |
| minimumDisplayDuration |
Duration |
| dismissDirection |
DismissDirection |
| isDismissible |
bool |
| showingAnimationCurve |
Curve |
| showingAnimationDuration |
Duration |
| closingAnimationCurve |
Curve |
| closingAnimationDuration |
Duration |
| backgroundColor |
Color |
| boxShadows |
List |
| borderRadius |
BorderRadius |
| padding |
EdgeInsets |
| margin |
EdgeInsets |
| niceToastPosition |
NiceToastPosition |