ActionSlider class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ActionSlider
Constructors
-
ActionSlider.custom({Key? key, BackgroundBuilder? outerBackgroundBuilder, BackgroundBuilder? backgroundBuilder, required ForegroundBuilder foregroundBuilder, double toggleWidth = 55.0, EdgeInsetsGeometry toggleMargin = const EdgeInsets.all(5.0), double height = 65.0, Duration slideAnimationDuration = const Duration(milliseconds: 1000), Color? backgroundColor, Widget? outerBackgroundChild, Widget? backgroundChild, Widget? foregroundChild, BorderRadius backgroundBorderRadius = const BorderRadius.all(Radius.circular(100.0)), SliderAction? action, ActionSliderController? controller, Duration loadingAnimationDuration = const Duration(milliseconds: 350), double? width, Duration reverseSlideAnimationDuration = const Duration(milliseconds: 250), Duration movementDuration = const Duration(milliseconds: 150), Curve slideAnimationCurve = Curves.decelerate, Curve reverseSlideAnimationCurve = Curves.bounceIn, Curve loadingAnimationCurve = Curves.easeInOut, Curve movementCurve = Curves.linear, List<
BoxShadow> boxShadow = const [BoxShadow(color: Colors.black26, spreadRadius: 1, blurRadius: 2, offset: Offset(0, 2))], SliderBehavior? sliderBehavior = SliderBehavior.move, TapCallback? onTap = _defaultOnTap, double actionThreshold = 1.0, ThresholdType actionThresholdType = ThresholdType.instant, StateChangeCallback? stateChangeCallback, TextDirection? direction = TextDirection.ltr}) -
Constructor with very high customizability
const
-
ActionSlider.dual({Key? key, Widget? startChild, Widget? endChild, Widget? loadingIcon, Widget successIcon = const Icon(Icons.check_rounded), Widget failureIcon = const Icon(Icons.close_rounded), Widget? icon, ForegroundBuilder? customForegroundBuilder, Widget? customForegroundBuilderChild, BackgroundBuilder? customBackgroundBuilder, Widget? customBackgroundBuilderChild, BackgroundBuilder? customOuterBackgroundBuilder, Widget? customOuterBackgroundBuilderChild, Color? toggleColor, Color? backgroundColor, double height = 65.0, double borderWidth = 5.0, bool rolling = false, SliderAction? startAction, SliderAction? endAction, TapCallback? onTap = _defaultOnTap, ActionSliderController? controller, double? width, Duration slideAnimationDuration = const Duration(milliseconds: 250), Duration reverseSlideAnimationDuration = const Duration(milliseconds: 1000), Duration movementDuration = const Duration(milliseconds: 150), Duration loadingAnimationDuration = const Duration(milliseconds: 350), Duration crossFadeDuration = const Duration(milliseconds: 250), Curve slideAnimationCurve = Curves.decelerate, Curve reverseSlideAnimationCurve = Curves.bounceIn, Curve loadingAnimationCurve = Curves.easeInOut, Curve movementCurve = Curves.linear, AlignmentGeometry iconAlignment = Alignment.center, BorderRadius backgroundBorderRadius = const BorderRadius.all(Radius.circular(100.0)), BorderRadius? foregroundBorderRadius, List<
BoxShadow> boxShadow = const [BoxShadow(color: Colors.black26, spreadRadius: 1, blurRadius: 2, offset: Offset(0, 2))], SliderBehavior? sliderBehavior = SliderBehavior.move, double startActionThreshold = 0.0, double endActionThreshold = 1.0, ThresholdType actionThresholdType = ThresholdType.instant, StateChangeCallback? stateChangeCallback, TextDirection? direction = TextDirection.ltr}) - Standard constructor for creating a dual slider.
-
ActionSlider.standard({Key? key, Widget? child, Widget? loadingIcon, Widget successIcon = const Icon(Icons.check_rounded), Widget failureIcon = const Icon(Icons.close_rounded), Widget? icon, ForegroundBuilder? customForegroundBuilder, Widget? customForegroundBuilderChild, BackgroundBuilder? customBackgroundBuilder, Widget? customBackgroundBuilderChild, BackgroundBuilder? customOuterBackgroundBuilder, Widget? customOuterBackgroundBuilderChild, Color? toggleColor, Color? backgroundColor, double height = 65.0, double borderWidth = 5.0, bool rolling = false, SliderAction? action, TapCallback? onTap = _defaultOnTap, ActionSliderController? controller, double? width, Duration slideAnimationDuration = const Duration(milliseconds: 250), Duration reverseSlideAnimationDuration = const Duration(milliseconds: 1000), Duration movementDuration = const Duration(milliseconds: 150), Duration loadingAnimationDuration = const Duration(milliseconds: 350), Duration crossFadeDuration = const Duration(milliseconds: 250), Curve slideAnimationCurve = Curves.decelerate, Curve reverseSlideAnimationCurve = Curves.bounceIn, Curve loadingAnimationCurve = Curves.easeInOut, Curve movementCurve = Curves.linear, AlignmentGeometry iconAlignment = Alignment.center, BorderRadius backgroundBorderRadius = const BorderRadius.all(Radius.circular(100.0)), BorderRadius? foregroundBorderRadius, List<
BoxShadow> boxShadow = const [BoxShadow(color: Colors.black26, spreadRadius: 1, blurRadius: 2, offset: Offset(0, 2))], SliderBehavior? sliderBehavior = SliderBehavior.move, double actionThreshold = 1.0, ThresholdType actionThresholdType = ThresholdType.instant, StateChangeCallback? stateChangeCallback, TextDirection? direction = TextDirection.ltr}) - Standard constructor for creating a slider.
Properties
- action → SliderAction?
-
Callback for sliding completely to the right.
Here you should call the loading, success and failure methods of the
controller for controlling the further behaviour/animations of the
slider.
final
- actionThreshold → double
-
The threshold at which the action should be triggered. Should be between 0.0 and 1.0.
final
- actionThresholdType → ThresholdType
-
The ThresholdType of the actionThreshold.
final
- backgroundBorderRadius → BorderRadius
-
BorderRadius of the Container in the background.
final
- backgroundBuilder → BackgroundBuilder?
-
The builder for the background of the toggle.
final
- backgroundChild → Widget?
-
The child which is optionally given to the backgroundBuilder for efficiency reasons.
final
- backgroundColor → Color?
-
The Color of the Container in the background.
final
-
boxShadow
→ List<
BoxShadow> -
The
BoxShadow
of the background Container.final - controller → ActionSliderController?
-
Controller for controlling the widget from everywhere.
final
- direction → TextDirection?
-
The direction of the slider.
final
- foregroundBuilder → ForegroundBuilder
-
The builder for the toggle.
final
- foregroundChild → Widget?
-
The child which is optionally given to the foregroundBuilder for efficiency reasons.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
The total height of the widget.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadingAnimationCurve → Curve
-
The Curve for going into the loading mode.
final
- loadingAnimationDuration → Duration
-
The Duration for going into the loading mode.
final
- movementCurve → Curve
-
The Curve for changing the position of the toggle.
final
- movementDuration → Duration
-
The Duration for changing the position of the toggle.
final
- onTap → TapCallback?
-
Callback for tapping on the ActionSlider. Defaults to (c) => c.jump().
Is only called if the toggle is currently not dragged.
If you want onTap to be called in any case, you should wrap ActionSlider
in a GestureDetector.
final
- outerBackgroundBuilder → BackgroundBuilder?
-
The builder for outer background. Overwrites backgroundColor, backgroundBorderRadius and boxShadow.
final
- outerBackgroundChild → Widget?
-
The child which is optionally given to the outerBackgroundBuilder for efficiency reasons.
final
- reverseSlideAnimationCurve → Curve
-
The Curve for the toggle coming back after the user released it or after the sliding animation.
final
- reverseSlideAnimationDuration → Duration
-
The Duration for the toggle coming back after the user released it or after the sliding animation.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- slideAnimationCurve → Curve
-
The Curve for the sliding animation when the user taps anywhere on the widget.
final
- slideAnimationDuration → Duration
-
The Duration for the sliding animation when the user taps anywhere on the widget.
final
- sliderBehavior → SliderBehavior?
-
This SliderBehavior defines the behaviour when moving the toggle.
final
- stateChangeCallback → StateChangeCallback?
-
Callback when the
ActionSliderState
changes. With this you can define more individual behavior than with action, if it is necessary.final - toggleMargin → EdgeInsetsGeometry
-
The margin of the sliding toggle.
final
- toggleWidth → double
-
The width of the sliding toggle.
final
- width → double?
-
The total width of the widget. If this is
null
it uses the whole available width.final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ActionSlider> -
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