listFromResult static method

List<LiveCommandSchema> listFromResult(
  1. Object? result
)

Parses the commands list of an ext.nylo.commands.list result.

Implementation

static List<LiveCommandSchema> listFromResult(Object? result) {
  final Object? commands = result is Map ? result['commands'] : null;
  if (commands is! List) return const [];
  return commands
      .map(LiveCommandSchema.fromJson)
      .whereType<LiveCommandSchema>()
      .toList();
}