From 24bc993ea2098b80d363685438fe3ff492be3a5b Mon Sep 17 00:00:00 2001 From: figengungor Date: Fri, 7 Oct 2022 01:25:52 +0300 Subject: [PATCH] Remove init checks for locales --- .../kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt | 2 +- speech_to_text/lib/speech_to_text.dart | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/speech_to_text/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt b/speech_to_text/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt index b6e74bfb..f9af178c 100644 --- a/speech_to_text/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt +++ b/speech_to_text/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt @@ -367,7 +367,7 @@ public class SpeechToTextPlugin : } private fun locales(result: Result) { - if (sdkVersionTooLow() || isNotInitialized()) { + if (sdkVersionTooLow()) { result.success(false) return } diff --git a/speech_to_text/lib/speech_to_text.dart b/speech_to_text/lib/speech_to_text.dart index f1d1f3de..4c9c40d0 100644 --- a/speech_to_text/lib/speech_to_text.dart +++ b/speech_to_text/lib/speech_to_text.dart @@ -507,9 +507,6 @@ class SpeechToText { /// display. The name is localized for the system locale on /// the device. Future> locales() async { - if (!_initWorked) { - throw SpeechToTextNotInitializedException(); - } final locales = await SpeechToTextPlatform.instance.locales(); var filteredLocales = locales .map((locale) {