ButtonDirective class

ButtonDirective adds all basic required a11y functional for any element, that are designed to work as a button (clickable icon, etc.)

This does NOT consume the triggering mouse event or keyboard event, so that if a transitive parent wants to listen to all events in it's scope (ex. click on anything to hide popup), it can do so.

Gives a common event trigger for keyboard, and click events.

Inheritance
Implemented types
Mixed-in types
Implementers
Annotations
  • @Directive(selector: '[buttonDecorator]', visibility: Visibility.all)

Constructors

ButtonDirective(Element element, @Attribute('role') String? role, {bool addTabIndexWhenNonTabbable = false, bool handleSpacePresses = true})

Properties

ariaRole String?
no setter
disabled bool
Is the component disabled.
getter/setter pairoverride
disabledStr String
String value to be passed to aria-disabled.
no setter
hashCode int
The hash code for this object.
no setterinherited
hostTabIndex String?
no setteroverride
role String?
Role of this component used for a11y.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tabbable bool
Is the component tabbable.
getter/setter pair
tabIndex String?
no setterinherited
tabindex String?
The tab index of the component.
no getter
trigger Stream<UIEvent>
Fired when the button is activated via click, tap, or key press.
no setter

Methods

dispose() → void
Disposes this disposable and any resources it has open.
inherited
focus() → void
Item/component focuses itself
inherited
handleClick(MouseEvent mouseEvent) → void
Triggers if not disabled.
handleKeyPress(KeyboardEvent keyboardEvent) → void
Triggers on enter and space if not disabled.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateTabIndex() → void
Use this method if you want to manually compute and cache the tab index.
inherited

Operators

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