label function
The <label> HTML element represents a caption for an item in a user interface.
htmlFor
: The value of the for attribute must be a single id for a labelable form-related element in the same document as the <label> element. So, any given label element can be associated with only one form control.
Implementation
Component label(List<Component> children,
{String? htmlFor,
Key? key,
String? id,
String? classes,
Styles? styles,
Map<String, String>? attributes,
Map<String, EventCallback>? events}) {
return DomComponent(
tag: 'label',
key: key,
id: id,
classes: classes,
styles: styles,
attributes: {
...attributes ?? {},
if (htmlFor != null) 'for': htmlFor,
},
events: events,
children: children,
);
}