import 'dart:async'; import 'package:flutter/services.dart'; class SpeechPlugin { static const MethodChannel _channel = const MethodChannel('speech_plugin'); static final SpeechPlugin _instance = SpeechPlugin(); static SpeechPlugin get instance => _instance; static Future get platformVersion async { final String version = await _channel.invokeMethod('getPlatformVersion'); return version; } Future initSdk() { return _channel.invokeMethod("initSpeechSdk"); } Future evaluatorByAudio(String pathEvaluatorDecode, int index, String videoId, String recordPath, String en) { return _channel.invokeMethod("evaluatorByAudio", { "pathEvaluatorDecode": pathEvaluatorDecode, "index": index, "videoId": videoId, "recordPath": recordPath, "en": en }); } Future evaluatorByMp4(String pathEvaluatorDecode, int index, String videoId, String recordPath, String en) { return _channel.invokeMethod("evaluatorByMp4", { "pathEvaluatorDecode": pathEvaluatorDecode, "index": index, "videoId": videoId, "recordPath": recordPath, "en": en }); } }