Flushbar<T> class

A highly customizable widget so you can notify your user when you fell like he needs a beautiful explanation.

Inheritance

Constructors

Flushbar({Key? key, required Widget titleText, Widget? messageText, Widget? icon, Function? onUndo, OnTap? onTap, Duration? duration, EdgeInsets margin = const EdgeInsets.all(24), EdgeInsets padding = const EdgeInsets.symmetric(vertical: 12, horizontal: 16), BorderRadius? borderRadius = const BorderRadius.all(Radius.circular(8)), Color backgroundColor = const Color.fromRGBO(23, 23, 23, 1), List<BoxShadow>? boxShadows = const [BoxShadow(offset: Offset(0, 8), blurRadius: 14, color: Color.fromRGBO(23, 23, 23, 0.08)), BoxShadow(offset: Offset(0, 3), blurRadius: 6, color: Color.fromRGBO(23, 23, 23, 0.12))], bool isDismissible = true, FlushbarDismissDirection dismissDirection = FlushbarDismissDirection.VERTICAL, FlushbarPosition flushbarPosition = FlushbarPosition.BOTTOM, FlushbarStyle flushbarStyle = FlushbarStyle.FLOATING, Curve forwardAnimationCurve = Curves.easeOutCirc, Curve reverseAnimationCurve = Curves.easeOutCirc, Duration animationDuration = const Duration(seconds: 300), FlushbarStatusCallback? onStatusChanged, double barBlur = 0.0, bool blockBackgroundInteraction = false, double? routeBlur, Color? routeColor, FlushbarRoute<T?>? flushbarRoute})

Properties

animationDuration Duration
Use it to speed up or slow down the animation duration
final
backgroundColor Color
Will be ignored if backgroundGradient is not null
final
barBlur double
Default is 0.0. If different than 0.0, blurs only Flushbar's background. To take effect, make sure your backgroundColor has some opacity. The greater the value, the greater the blur.
final
blockBackgroundInteraction bool
Determines if user can interact with the screen behind it If this is false, routeBlur and routeColor will be ignored
final
borderRadius BorderRadius?
Adds a radius to corners specified of Flushbar. Best combined with margin.
final
boxShadows List<BoxShadow>?
boxShadows The shadows generated by Flushbar. You can use more than one if you feel the need.
final
dismissDirection FlushbarDismissDirection
FlushbarDismissDirection.VERTICAL by default. Can also be FlushbarDismissDirection.HORIZONTAL in which case both left and right dismiss are allowed.
final
duration Duration?
How long until Flushbar will hide itself (be dismissed). To make it indefinite, leave it null.
final
flushbarPosition FlushbarPosition
Flushbar can be based on FlushbarPosition.TOP or on FlushbarPosition.BOTTOM of your screen. FlushbarPosition.BOTTOM is the default.
final
flushbarRoute FlushbarRoute<T?>?
getter/setter pair
flushbarStyle FlushbarStyle
Flushbar can be floating or be grounded to the edge of the screen. If grounded, I do not recommend using margin or borderRadius. FlushbarStyle.FLOATING is the default If grounded, I do not recommend using a backgroundColor with transparency or barBlur
final
forwardAnimationCurve Curve
The Curve animation used when show() is called. Curves.easeOut is default
final
hashCode int
The hash code for this object.
no setterinherited
icon Widget?
You can use any widget here, but I recommend Icon or Image as indication of what kind of message you are displaying. Other widgets may break the layout
final
isDismissible bool
Determines if the user can swipe or click the overlay (if routeBlur > 0) to dismiss. It is recommended that you set duration != null if this is false. If the user swipes to dismiss or clicks the overlay, no value will be returned.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsets
Adds a custom margin to Flushbar
final
messageText Widget?
Although this accepts a Widget, it is meant to receive Text or RichText
final
onStatusChanged FlushbarStatusCallback?
A callback for you to listen to the different Flushbar status
final
onTap OnTap?
A callback that registers the user's click anywhere. An alternative to mainButton
final
onUndo Function?
A callback that registers the user's click to the undo button.
final
onUndoEnds Function?
The default method after the onUndo callback ends.
getter/setter pair
padding EdgeInsets
Adds a custom padding to Flushbar
final
reverseAnimationCurve Curve
The Curve animation used when dismiss() is called. Curves.fastOutSlowIn is default
final
routeBlur double?
Default is 0.0. If different than 0.0, creates a blurred overlay that prevents the user from interacting with the screen. The greater the value, the greater the blur. It does not take effect if blockBackgroundInteraction is false
final
routeColor Color?
Default is Colors.transparent. Only takes effect if routeBlur > 0.0. Make sure you use a color with transparency here e.g. Colors.grey600.withOpacity(0.2). It does not take effect if blockBackgroundInteraction is false
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
titleText Widget
Although this accepts a Widget, it is meant to receive Text or RichText
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
dismiss([T? result]) Future<T?>
Dismisses the flushbar causing is to return a future containing result. When this future finishes, it is guaranteed that Flushbar was dismissed.
isAppearing() bool
isDismissed() bool
Checks if the flushbar is dismissed
isHiding() bool
isShowing() bool
Checks if the flushbar is visible
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
show(BuildContext context) Future<T?>
Show the flushbar. Kicks in FlushbarStatus.IS_APPEARING state followed by FlushbarStatus.SHOWING
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited