dynamicToList<T> static method

List<T> dynamicToList<T>(
  1. dynamic list,
  2. T f(
    1. dynamic e
    )
)

Implementation

static List<T> dynamicToList<T>(
  dynamic list,
  T Function(dynamic e) f,
) {
  if (list is List) return List<T>.from(list.map((x) => f(x)));
  return [];
}