backgroundIndexListFromJson function

List<BackgroundIndex> backgroundIndexListFromJson(
  1. List? backgroundIndex, [
  2. List<BackgroundIndex>? defaultValue
])

Implementation

List<enums.BackgroundIndex> backgroundIndexListFromJson(
  List? backgroundIndex, [
  List<enums.BackgroundIndex>? defaultValue,
]) {
  if (backgroundIndex == null) {
    return defaultValue ?? [];
  }

  return backgroundIndex
      .map((e) => backgroundIndexFromJson(e.toString()))
      .toList();
}