hubCommandTypeListFromJson function

List<HubCommandType> hubCommandTypeListFromJson(
  1. List? hubCommandType, [
  2. List<HubCommandType>? defaultValue
])

Implementation

List<enums.HubCommandType> hubCommandTypeListFromJson(
  List? hubCommandType, [
  List<enums.HubCommandType>? defaultValue,
]) {
  if (hubCommandType == null) {
    return defaultValue ?? [];
  }

  return hubCommandType
      .map((e) => hubCommandTypeFromJson(e.toString()))
      .toList();
}