findInDescendants method Null safety

Future<SmoothCategory<T>?> findInDescendants(
  1. 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;
}