PrimaryDeviceAttributesEvent.fromParams constructor

PrimaryDeviceAttributesEvent.fromParams(
  1. List<String> params
)

Constructs a new instance of PrimaryDeviceAttributesEvent with the given params.

Implementation

factory PrimaryDeviceAttributesEvent.fromParams(List<String> params) {
  return switch (params) {
    ['1', '0'] => const PrimaryDeviceAttributesEvent(DeviceAttributeType.vt101WithNoOptions, []),
    ['6'] => const PrimaryDeviceAttributesEvent(DeviceAttributeType.vt102, []),
    ['1', '2'] => const PrimaryDeviceAttributesEvent(DeviceAttributeType.vt100WithAdvancedVideoOption, []),
    ['62', ...] => PrimaryDeviceAttributesEvent(DeviceAttributeType.vt220, _genParams(params.sublist(1))),
    ['63', ...] => PrimaryDeviceAttributesEvent(DeviceAttributeType.vt320, _genParams(params.sublist(1))),
    ['64', ...] => PrimaryDeviceAttributesEvent(DeviceAttributeType.vt420, _genParams(params.sublist(1))),
    ['65', ...] => PrimaryDeviceAttributesEvent(DeviceAttributeType.vt500, _genParams(params.sublist(1))),
    _ => const PrimaryDeviceAttributesEvent(DeviceAttributeType.unknown, [])
  };
}