findInDescendants method Null safety
- T value
Implementation
Future<SmoothCategory<T>?> findInDescendants(T value) async {
final List<SmoothCategory<T>> results = await getDescendants()
.where((SmoothCategory<T> child) => child.value == value)
.toList();
if (results.isEmpty) {
return null;
}
return results.single;
}