listFromJson static method

List<IndexUnitEnum> listFromJson(
  1. dynamic json, {
  2. bool growable = false,
})

Returns a List containing instances of IndexUnitEnum that were successfully decoded from the passed json.

Implementation

static List<IndexUnitEnum> listFromJson(dynamic json, {bool growable = false,}) {
  final result = <IndexUnitEnum>[];
  if (json is List && json.isNotEmpty) {
    for (final row in json) {
      final value = IndexUnitEnum.fromJson(row);
      if (value != null) {
        result.add(value);
      }
    }
  }
  return result.toList(growable: growable);
}