byNameOrNull method
Implementation
T? byNameOrNull(
String? value, {
bool caseSensitive = true,
}) {
if (value == null) return null;
for (final item in this) {
if (caseSensitive) {
if (item.name == value) return item;
} else {
if (item.name.toLowerCase() == value.toLowerCase()) {
return item;
}
}
}
return null;
}