as<T> function

List<T>? as<T>(
  1. List? children
)

Implementation

List<T>? as<T>(List? children) {
  if (children == null) {
    return null;
  }

  if (children.isEmpty) {
    return [];
  }
  return children.map((e) => e as T).toList();
}