throwIf function
Two handy functions that help me to express my intention clearer and shorter to check for runtime errors
Implementation
// ignore: avoid_positional_boolean_parameters
void throwIf(bool condition, Object error) {
if (condition) throw error;
}