Flash<T> class
A highly customizable widget so you can notify your user when you fell like he needs a beautiful explanation.
- Inheritance
Constructors
-
Flash({Key? key, required FlashController controller, required Widget child, EdgeInsets margin = EdgeInsets.zero, BorderRadius? borderRadius, Color? borderColor, double borderWidth = 1.0, Brightness brightness = Brightness.light, Color backgroundColor = Colors.white, List<
BoxShadow> ? boxShadows, Gradient? backgroundGradient, GestureTapCallback? onTap, bool enableDrag = true, HorizontalDismissDirection? horizontalDismissDirection, Duration insetAnimationDuration = const Duration(milliseconds: 100), Curve insetAnimationCurve = Curves.fastOutSlowIn, AlignmentGeometry? alignment, FlashPosition? position = FlashPosition.bottom, FlashStyle? style = FlashStyle.floating, Curve forwardAnimationCurve = Curves.fastOutSlowIn, Curve reverseAnimationCurve = Curves.fastOutSlowIn, double? barrierBlur, Color? barrierColor, bool barrierDismissible = true}) -
Flash.bar({Key? key, required FlashController controller, required Widget child, EdgeInsets margin = EdgeInsets.zero, BorderRadius? borderRadius, Color? borderColor, double borderWidth = 1.0, Brightness brightness = Brightness.light, Color backgroundColor = Colors.white, List<
BoxShadow> ? boxShadows, Gradient? backgroundGradient, GestureTapCallback? onTap, bool enableDrag = true, HorizontalDismissDirection? horizontalDismissDirection, Duration insetAnimationDuration = const Duration(milliseconds: 100), Curve insetAnimationCurve = Curves.fastOutSlowIn, FlashPosition? position = FlashPosition.bottom, FlashStyle? style = FlashStyle.floating, Curve forwardAnimationCurve = Curves.fastOutSlowIn, Curve reverseAnimationCurve = Curves.fastOutSlowIn, double? barrierBlur, Color? barrierColor, bool barrierDismissible = true}) -
Flash.dialog({Key? key, required FlashController controller, required Widget child, EdgeInsets margin = EdgeInsets.zero, BorderRadius? borderRadius, Color? borderColor, double borderWidth = 1.0, Brightness brightness = Brightness.light, Color backgroundColor = Colors.white, List<
BoxShadow> ? boxShadows, Gradient? backgroundGradient, GestureTapCallback? onTap, bool enableDrag = false, HorizontalDismissDirection? horizontalDismissDirection, Duration insetAnimationDuration = const Duration(milliseconds: 100), Curve insetAnimationCurve = Curves.fastOutSlowIn, AlignmentGeometry? alignment = Alignment.center, Curve forwardAnimationCurve = Curves.fastOutSlowIn, Curve reverseAnimationCurve = Curves.fastOutSlowIn, double? barrierBlur, Color? barrierColor = Colors.black54, bool barrierDismissible = true})
Properties
- alignment → AlignmentGeometry?
-
How to align the flash.
final
- backgroundColor → Color
-
Will be ignored if backgroundGradient is not null
final
- backgroundGradient → Gradient?
-
Makes backgroundColor be ignored.
final
- barrierBlur → double?
-
Only takes effect if FlashController.persistent is false.
Creates a blurred overlay that prevents the user from interacting with the screen.
The greater the value, the greater the blur.
final
- barrierColor → Color?
-
Only takes effect if FlashController.persistent is false.
Make sure you use a color with transparency here e.g. Colors.grey
600
.withOpacity(0.2).final - barrierDismissible → bool
-
Only takes effect if FlashController.persistent is false, and barrierBlur or barrierColor is not null.
Whether you can dismiss this flashbar by tapping the modal barrier.
final
- borderColor → Color?
-
Adds a border to every side of Flash
final
- borderRadius → BorderRadius?
-
Adds a radius to all corners of Flash. Best combined with margin.
final
- borderWidth → double
-
Changes the width of the border if borderColor is specified
final
-
boxShadows
→ List<
BoxShadow> ? -
boxShadows The shadows generated by Flashbar. Leave it null if you don't want a shadow.
You can use more than one if you feel the need.
Check (this example)
https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/shadows.dart
final - brightness → Brightness
-
The brightness of the backgroundColor or backgroundGradient
final
- child → Widget
-
The widget below this widget in the tree.
final
- controller → FlashController
-
final
- enableDrag → bool
-
Determines if the user can swipe vertically to dismiss the bar.
It is recommended that you set
duration
!= null if this is false. If the user swipes to dismiss no value will be returned.final - forwardAnimationCurve → Curve
-
The Curve animation used when show() is called. Curves.fastOutSlowIn is default
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- horizontalDismissDirection → HorizontalDismissDirection?
-
Determines if the user can swipe horizontally to dismiss the bar.
It is recommended that you set
duration
!= null if this is false. If the user swipes to dismiss no value will be returned.final - insetAnimationCurve → Curve
-
The curve to use for the animation shown when the system keyboard intrudes
into the space that the dialog is placed in.
final
- insetAnimationDuration → Duration
-
The duration of the animation to show when the system keyboard intrudes
into the space that the dialog is placed in.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- margin → EdgeInsets
-
Adds a custom margin to Flash
final
- onTap → GestureTapCallback?
-
A callback that registers the user's click anywhere. An alternative to
primaryAction
final - position → FlashPosition?
-
Flash can be based on FlashPosition.top or on FlashPosition.bottom of your screen.
final
- reverseAnimationCurve → Curve
-
The Curve animation used when dismiss() is called. Curves.fastOutSlowIn is default
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → FlashStyle?
-
Flash can be floating or be grounded to the edge of the screen.
If
flashStyle
is grounded, I do not recommend using margin or borderRadius.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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
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}) → 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