From fbdece77c146bf1785e60e6acc4a9c8b9c65dd86 Mon Sep 17 00:00:00 2001 From: miyoyo Date: Sun, 10 Nov 2019 20:14:34 +0100 Subject: [PATCH] Remove the `setValue` methods Dart possesses powerful [getter and setter syntax](https://dart.dev/guides/language/language-tour#getters-and-setter), this change makes the code more inline with the general dart style, and avoids pointless repetition of code that will be generated by the compiler anyway. --- lib/speech_recognition.dart | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/lib/speech_recognition.dart b/lib/speech_recognition.dart index 827c5dc..bdce1a8 100644 --- a/lib/speech_recognition.dart +++ b/lib/speech_recognition.dart @@ -68,25 +68,4 @@ class SpeechRecognition { print('Unknowm method ${call.method} '); } } - - // define a method to handle availability / permission result - void setAvailabilityHandler(AvailabilityHandler handler) => - availabilityHandler = handler; - - // define a method to handle recognition result - void setRecognitionResultHandler(StringResultHandler handler) => - recognitionResultHandler = handler; - - // define a method to handle native call - void setRecognitionStartedHandler(VoidCallback handler) => - recognitionStartedHandler = handler; - - // define a method to handle native call - void setRecognitionCompleteHandler(StringResultHandler handler) => - recognitionCompleteHandler = handler; - - void setCurrentLocaleHandler(StringResultHandler handler) => - currentLocaleHandler = handler; - - void setErrorHandler(VoidCallback handler) => errorHandler = handler; }