initCheckboxState method

void initCheckboxState()
inherited

Implementation

void initCheckboxState() {
  final String checkboxKey = _checkedElement.hashCode.toString();
  final bool? early = CheckboxElementState.getEarlyCheckboxState(checkboxKey);
  // Restore early checked state and then clear it to avoid leaks/cross-page interference.
  if (early != null) {
    setState(() {
      (_checkedElement as dynamic)._checked = early;
    });
    CheckboxElementState.clearEarlyCheckboxState(checkboxKey);
    return;
  }

  // Initialize from attribute presence for HTML parsing: <input checked> yields value="".
  if ((_checkedElement as dynamic).hasAttribute('checked') == true) {
    setState(() {
      (_checkedElement as dynamic)._checked = true;
    });
  }
}