import 'package:flutter/services.dart'; class TtsUtil { static const MethodChannel _channel = MethodChannel('com.example.ai_chat_assistant/ali_sdk'); static Future execute(String method, [Map? arguments]) { return _channel.invokeMethod(method, arguments); } static Future start(bool isChinese) async { return await execute('startTts', {'isChinese': isChinese}); } static Future send(String text) async { await execute('sendTts', {'text': text}); } static Future complete() async { await execute('completeTts'); } static Future stop() async { await execute('stopTts'); } }