validate method

void validate()

Implementation

void validate() {
  if (!available && enabled) {
    throw const FormatException(
      'An unavailable flashlight cannot be enabled.',
    );
  }
}