AnimatedButton class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- AnimatedButton
Constructors
-
AnimatedButton({Key? key, required String text, required VoidCallback? onPress, TransitionType transitionType = TransitionType.LEFT_TO_RIGHT, TextStyle textStyle = const TextStyle(color: Colors.white, fontSize: 20), Color selectedTextColor = Colors.blue, Color selectedBackgroundColor = Colors.white, Color backgroundColor = Colors.white60, bool isReverse = false, int textMaxLine = 1, TextOverflow textOverflow = TextOverflow.clip, AlignmentGeometry textAlignment = Alignment.center, double height = 50, double width = double.infinity, Duration animationDuration = const Duration(milliseconds: 500), ValueChanged<
bool> ? onChanges, Color borderColor = Colors.transparent, double borderRadius = 0, double borderWidth = 0, Gradient? gradient, Gradient? selectedGradientColor, bool isSelected = false, String selectedText = '', AnimatedOn animatedOn = AnimatedOn.onTap}) -
const
-
AnimatedButton.strip({Key? key, required String text, required VoidCallback? onPress, bool isReverse = false, double height = 50, double width = double.infinity, StripTransitionType stripTransitionType = StripTransitionType.LEFT_TO_RIGHT, TextStyle textStyle = const TextStyle(color: Colors.white, fontSize: 20), Color selectedTextColor = Colors.blue, Color selectedBackgroundColor = Colors.white, int textMaxLine = 1, TextOverflow textOverflow = TextOverflow.clip, AlignmentGeometry textAlignment = Alignment.center, Duration animationDuration = const Duration(milliseconds: 500), Color backgroundColor = Colors.white60, Color stripColor = Colors.white, double stripSize = 6, ValueChanged<
bool> ? onChanges, Gradient? gradient, Gradient? selectedGradientColor, bool isSelected = false, String selectedText = '', AnimatedOn animatedOn = AnimatedOn.onTap})
Properties
- animatedOn → AnimatedOn
-
animatedOn when animated
By Default value AnimatedOn.onTap
final
- animationDuration → Duration
-
Duration animation duration on button
By default it is 500 ms
final
- backgroundColor → Color
-
Color button background colour which displaying when
the user deselect button
final
- borderColor → Color
-
Color color of the border by Default it is Colors.transparent
final
- borderRadius → double
-
double radius of the border bt Default it is 0
final
- borderWidth → double
-
double width of the border by Default it is 0
final
- gradient → Gradient?
-
gradient, which also fills the button
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
double height of button
by default it is 50
final
- isReverse → bool
-
bool
true
- you can select and deselect button after select/deselect itfalse
- you can't deselect it after select it. by Default isfalse
final - isSelected → bool
-
isSelected if this is true then button is selected
it's false then button is deselected;
default it is false
final
- isStrip → bool
-
bool this value will be
true
when user used AnimatedButton widgetfalse
when user used AnimatedButton.strip widget user can change this valuefinal - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onChanges
→ ValueChanged<
bool> ? -
called this function when user press on button and pass value of button
true
- button selectedfalse
- button deSelectedfinal - onPress → VoidCallback?
-
Adds the onTap VoidCallback to the animated button.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedBackgroundColor → Color
-
Color button background colour which displaying
when the user press on button / select it
final
- selectedGradientColor → Gradient?
-
selectedGradientColor, which also fills the selected button
final
- selectedText → String
-
String text of button which display when button is selected
final
- selectedTextColor → Color
-
Color text colour which displaying when the user press on the button / select it
final
- stripColor → Color
-
Color color of strip which used in AnimatedButton.strip widget
final
- stripSize → double
-
double size of strip it will use width when used TransitionType.LEFT_TO_RIGHT
or TransitionType.RIGHT_TO_LEFT animation and it will use height when used
TransitionType.BOTTOM_TO_TOP or TransitionType.TOP_TO_BOTTOM
final
- stripTransitionType → StripTransitionType
-
StripTransitionType type of animation which apply to Strip Button
by Default it is TransitionType.LEFT_TO_RIGHT
final
- text → String
-
String text of button
final
- textAlignment → AlignmentGeometry
-
The x and y values of the Alignment control the horizontal and vertical
alignment, respectively. An x value of -1.0 means that the left edge of
the child is aligned with the left edge of the parent whereas an x value
of 1.0 means that the right edge of the child is aligned with the right
edge of the parent. Other values interpolate (and extrapolate) linearly.
For example, a value of 0.0 means that the center of the child is aligned
with the center of the parent.
final
- textMaxLine → int
-
If the text exceeds the given number of lines, it will be truncated according
to
overflow
.final - textOverflow → TextOverflow
-
How visual overflow should be handled.
final
- textStyle → TextStyle
-
TextStyle textStyle of button's text
final
- transitionType → TransitionType
-
TransitionType type of animation which apply to Button
by Default it is TransitionType.LEFT_TO_RIGHT
final
- width → double
-
double width of button
by default it is double.infinity
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _AnimatedButtonState -
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