checkbox function
({HTMLInputElement box, HTMLElement root})
checkbox(})
A checkbox with a label.
Implementation
({web.HTMLElement root, web.HTMLInputElement box}) checkbox(
String label, {
required String id,
bool checked = false,
}) {
final box = el('input', id: id) as web.HTMLInputElement;
box.type = 'checkbox';
box.checked = checked;
final root = el(
'label',
classes: 'check',
attrs: {'for': id},
children: [box, textNode(label)],
);
return (root: root, box: box);
}