parse static method

ScalabilityMode parse(
  1. String? scalabilityMode
)

Implementation

static ScalabilityMode parse(String? scalabilityMode) {
  List<RegExpMatch> match =
      scalabilityModeRegex.allMatches(scalabilityMode ?? '').toList();

  if (match.isNotEmpty) {
    return ScalabilityMode(
      spatialLayers: int.parse(match[0].group(1)!),
      temporalLayers: int.parse(match[0].group(2)!),
    );
  } else {
    return const ScalabilityMode(
      spatialLayers: 1,
      temporalLayers: 1,
    );
  }
}