ShajuDeButton class
ShajuDe Design System's button, with haptic feedback, tooltip, taping area, and more. The button have 5 types: primary, secondary, and warning. The button have 5 types of haptic feedback: lightImpact, mediumImpact, heavyImpact, selectionClick, and none.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- ShajuDeButton
Constructors
- ShajuDeButton(String? label, {Key? key, EdgeInsets padding = const EdgeInsets.all(8.0), double width = 100, VoidCallback? onPressed, IconData? icon, bool isLoading = false, bool isDisabled = false, TextStyle? textStyle, ButtonType buttonType = ButtonType.primary, double? height, String? tooltip = "", bool showTooltip = true, HapticFeedbackType hapticFeedbackType = HapticFeedbackType.mediumImpact, EdgeInsets tapArea = const EdgeInsets.all(20)})
-
const
Properties
-
The type of button.
final
- hapticFeedbackType → HapticFeedbackType
-
The type of haptic feedback to be played when the button is pressed.
Haptic feedback is a vibration that occurs when the user interacts with the UI element. It is used to provide feedback to the user that the interaction was successful.
The haptic feedback type can be customized to suit the needs of the application. For example, a light impact can be used for a button that is pressed frequently, while a heavy impact can be used for a button that is pressed infrequently.
NOTE : Haptic feedback is only available for supported devices.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
The height of the button, in logical pixels.
final
- icon → IconData?
-
The icon to be displayed on the button.
final
- isDisabled → bool
-
The disabled state of the button.
final
- isLoading → bool
-
The loading state of the button.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String?
-
The title text to be displayed on the button.
final
- onPressed → VoidCallback?
-
The callback that is called when the button is tapped.
final
- padding → EdgeInsets
-
The padding around the button determines the tap area for user interactions. Providing sufficient padding is crucial for a good user experience, as it ensures that the button can be easily tapped without unintentional errors. According to a UX case study by Nielsen Norman Group (link: Touch Target Size), larger touch targets improve usability and reduce errors.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showTooltip → bool
-
The tooltip is a small text that appears when the user hovers over the button. It is used to provide additional information about the button.
final
- tapArea → EdgeInsets
-
The padding around the button determines the tap area for user interactions. Providing sufficient padding is crucial for a good user experience, as it ensures that the button can be easily tapped without unintentional errors. According to a UX case study by Nielsen Norman Group (link: Touch Target Size), larger touch targets improve usability and reduce errors.
Consider the target audience and the device on which the application will be used when determining the appropriate padding for the button. It is recommended to follow the guidelines provided in the UX case study to ensure optimal touch target size and minimize user frustration.
final
- textStyle → TextStyle?
-
The text style of the button.
final
- tooltip → String?
-
The tooltip is a small text that appears when the user hovers over the button. It is used to provide additional information about the button.
final
- width → double
-
The width of the button, in logical pixels.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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, 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