button<L, V> function
DomElement<L, V>
button<L, V>({
- String? key,
- List<
String> ? classes, - Map<
String, String> ? attributes, - Map<
String, String> ? styles, - String? accesskey,
- String? autocapitalize,
- String? contenteditable,
- String? dir,
- bool? disabled,
- String? draggable,
- String? form,
- String? formaction,
- String? formenctype,
- String? formmethod,
- bool? formnovalidate,
- String? formtarget,
- String? id,
- String? itemprop,
- String? lang,
- String? name,
- String? role,
- String? slot,
- String? spellcheck,
- String? tabindex,
- String? title,
- String? translate,
- String? type,
- String? value,
- Map<
String, DomEventFn< ? events,L, V> > - DomLifecycleEventFn<
L> ? onCreate, - DomLifecycleEventFn<
L> ? onUpdate, - DomLifecycleEventFn<
L> ? onRemove, - Iterable<
DomNode< ? children,L, V> > - DomNode<
L, V> ? child, - String? text,
An interactive element activated by a user with a mouse, keyboard, finger, voice command, or other assistive technology. Once activated, it performs an action, such as submitting a form or opening a dialog.
Implementation
DomElement<L, V> button<L, V>({
String? key,
List<String>? classes,
Map<String, String>? attributes,
Map<String, String>? styles,
/// Keyboard shortcut to activate or add focus to the element.
String? accesskey,
/// Sets whether input is automatically capitalized when entered by user
String? autocapitalize,
/// Indicates whether the element's content is editable.
String? contenteditable,
/// Defines the text direction. Allowed values are ltr (Left-To-Right) or
/// rtl (Right-To-Left)
String? dir,
/// Indicates whether the user can interact with the element.
bool? disabled,
/// Defines whether the element can be dragged.
String? draggable,
/// Indicates the form that is the owner of the element.
String? form,
/// Indicates the action of the element, overriding the action defined in
/// the <form>.
String? formaction,
/// If the button/input is a submit button (e.g. type="submit"),
/// this attribute sets the encoding type to use during form submission. If
/// this attribute is specified, it overrides the
/// enctype attribute of the button's
/// form owner.
String? formenctype,
/// If the button/input is a submit button (e.g. type="submit"),
/// this attribute sets the submission method to use during form submission
/// (GET, POST, etc.). If this attribute is
/// specified, it overrides the method attribute of the
/// button's form owner.
String? formmethod,
/// If the button/input is a submit button (e.g. type="submit"),
/// this boolean attribute specifies that the form is not to be validated
/// when it is submitted. If this attribute is specified, it overrides the
/// novalidate attribute of the button's
/// form owner.
bool? formnovalidate,
/// If the button/input is a submit button (e.g. type="submit"),
/// this attribute specifies the browsing context (for example, tab, window,
/// or inline frame) in which to display the response that is received after
/// submitting the form. If this attribute is specified, it overrides the
/// target attribute of the button's
/// form owner.
String? formtarget,
/// Prevents rendering of given element, while keeping child elements, e.g.
/// script elements, active.
String? hidden,
/// Often used with CSS to style a specific element. The value of this
/// attribute must be unique.
String? id,
///
String? itemprop,
/// Defines the language used in the element.
String? lang,
/// Name of the element. For example used by the server to identify the
/// fields in form submits.
String? name,
/// Defines an explicit role for an element for use by assistive technologies.
String? role,
/// Assigns a slot in a shadow DOM shadow tree to an element.
String? slot,
/// Indicates whether spell checking is allowed for the element.
String? spellcheck,
/// Overrides the browser's default tab order and follows the one specified
/// instead.
String? tabindex,
/// Text to be displayed in a tooltip when hovering over the element.
String? title,
/// Specify whether an element's attribute values and the values of its
/// Text node
/// children are to be translated when the page is localized, or whether to
/// leave them unchanged.
String? translate,
/// Defines the type of the element.
String? type,
/// Defines a default value which will be displayed in the element on page
/// load.
String? value,
Map<String, DomEventFn<L, V>>? events,
DomLifecycleEventFn<L>? onCreate,
DomLifecycleEventFn<L>? onUpdate,
DomLifecycleEventFn<L>? onRemove,
Iterable<DomNode<L, V>>? children,
DomNode<L, V>? child,
String? text,
}) {
return DomElement<L, V>(
'button',
key: key,
classes: classes,
attributes: <String, String>{
if (accesskey != null) 'accesskey': accesskey,
if (autocapitalize != null) 'autocapitalize': autocapitalize,
if (contenteditable != null) 'contenteditable': contenteditable,
if (dir != null) 'dir': dir,
if (disabled ?? false) 'disabled': 'disabled',
if (draggable != null) 'draggable': draggable,
if (form != null) 'form': form,
if (formaction != null) 'formaction': formaction,
if (formenctype != null) 'formenctype': formenctype,
if (formmethod != null) 'formmethod': formmethod,
if (formnovalidate ?? false) 'formnovalidate': 'formnovalidate',
if (formtarget != null) 'formtarget': formtarget,
if (hidden != null) 'hidden': hidden,
if (id != null) 'id': id,
if (itemprop != null) 'itemprop': itemprop,
if (lang != null) 'lang': lang,
if (name != null) 'name': name,
if (role != null) 'role': role,
if (slot != null) 'slot': slot,
if (spellcheck != null) 'spellcheck': spellcheck,
if (tabindex != null) 'tabindex': tabindex,
if (title != null) 'title': title,
if (translate != null) 'translate': translate,
if (type != null) 'type': type,
if (value != null) 'value': value,
...?attributes,
},
styles: styles,
events: events,
onCreate: onCreate,
onUpdate: onUpdate,
onRemove: onRemove,
children: children,
child: child,
text: text,
);
}