getSpeechRateValidRange property

Future<SpeechRateValidRange> getSpeechRateValidRange

Implementation

Future<SpeechRateValidRange> get getSpeechRateValidRange async {
  final validRange = await _channel.invokeMethod('getSpeechRateValidRange')
  as Map<dynamic, dynamic>;
  final min = double.parse(validRange['min'].toString());
  final normal = double.parse(validRange['normal'].toString());
  final max = double.parse(validRange['max'].toString());
  final platformStr = validRange['platform'].toString();
  final platform = TextToSpeechPlatform.values
      .firstWhere((e) => describeEnum(e) == platformStr);

  return SpeechRateValidRange(min, normal, max, platform);
}