VesperSubtitleStyle.fromMap constructor

VesperSubtitleStyle.fromMap(
  1. Map<Object?, Object?> map
)

Implementation

factory VesperSubtitleStyle.fromMap(Map<Object?, Object?> map) {
  final fontScale = _decodeDouble(map, 'fontScale') ?? 1.0;
  if (!fontScale.isFinite || fontScale < 0.5 || fontScale > 3.0) {
    throw ArgumentError.value(
      fontScale,
      'fontScale',
      'must be finite and between 0.5 and 3.0',
    );
  }
  return VesperSubtitleStyle(
    fontScale: fontScale,
    visible: _decodeOptionalBool(map, 'visible') ?? true,
  );
}