diff --git a/android/src/main/java/com/lilplugins/xf_speech_plugin/XfSpeechPlugin.java b/android/src/main/java/com/lilplugins/xf_speech_plugin/XfSpeechPlugin.java
index 217abde..8098097 100644
--- a/android/src/main/java/com/lilplugins/xf_speech_plugin/XfSpeechPlugin.java
+++ b/android/src/main/java/com/lilplugins/xf_speech_plugin/XfSpeechPlugin.java
@@ -1,35 +1,94 @@
package com.lilplugins.xf_speech_plugin;
+import android.util.Log;
+import android.app.Activity;
+
+import androidx.annotation.NonNull;
+
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
-import io.flutter.plugin.common.PluginRegistry.Registrar;
-import android.util.Log;
+
import io.flutter.plugin.common.PluginRegistry;
+import io.flutter.plugin.common.PluginRegistry.Registrar;;
-public class XfSpeechPlugin implements MethodCallHandler{
+import io.flutter.embedding.engine.plugins.FlutterPlugin;
+import io.flutter.embedding.engine.plugins.activity.ActivityAware;
+import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
+import io.flutter.plugin.common.BinaryMessenger;
+
+
+public class XfSpeechPlugin implements FlutterPlugin, MethodCallHandler, ActivityAware{
private static String TAG = XfSpeechPlugin.class.getSimpleName();
private static final String CHANNEL = "lilplugins.com/xf_speech_plugin";
+
PluginRegistry.Registrar registrar;
XfSpeechDelegate delegate;
+ private MethodChannel channel;
+ private Activity mActivity;
+
+ /*
+ XfSpeechPlugin() {
+ }
+
XfSpeechPlugin(final PluginRegistry.Registrar registrar, final XfSpeechDelegate delegate) {
this.registrar = registrar;
this.delegate = delegate;
}
-
+ */
+
public static void registerWith(Registrar registrar) {
- if (registrar.activity() == null) {
- return;
- }
+ final XfSpeechPlugin instance = new XfSpeechPlugin();
final MethodChannel channel = new MethodChannel(registrar.messenger(), CHANNEL);
final XfSpeechDelegate delegate = new XfSpeechDelegate(registrar.activity(),channel);
registrar.addRequestPermissionsResultListener(delegate);
- final XfSpeechPlugin instance = new XfSpeechPlugin(registrar, delegate);
+
+ instance.registrar = registrar;
+ instance.delegate = delegate;
channel.setMethodCallHandler(instance);
}
+
+ @Override
+ public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
+ channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), CHANNEL);
+ channel.setMethodCallHandler(this);
+ }
+
+ @Override
+ public void onAttachedToActivity(ActivityPluginBinding binding) {
+ onAttachedToActivity(binding.getActivity());
+ binding.addRequestPermissionsResultListener(this.delegate);
+ }
+
+ private void onAttachedToActivity(Activity activity) {
+ this.mActivity = activity;
+ this.delegate = new XfSpeechDelegate(activity, this.channel);
+ }
+
+ @Override
+ public void onDetachedFromActivityForConfigChanges() {
+
+ }
+
+ @Override
+ public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) {
+ onAttachedToActivity(binding);
+ binding.addRequestPermissionsResultListener(this.delegate);
+ }
+
+ @Override
+ public void onDetachedFromActivity() {
+ this.mActivity = null;
+ }
+
+ @Override
+ public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
+ channel.setMethodCallHandler(null);
+ }
+
static final String METHOD_CALL_INITWITHAPPID = "initWithAppId";
static final String METHOD_CALL_SETPARAMETER = "setParameter";
diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies
deleted file mode 100644
index 8326cde..0000000
--- a/example/.flutter-plugins-dependencies
+++ /dev/null
@@ -1 +0,0 @@
-{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"xf_speech_plugin","path":"/Users/chenli/Documents/GitHub/xfspeech_plugin/","dependencies":[]}],"android":[{"name":"xf_speech_plugin","path":"/Users/chenli/Documents/GitHub/xfspeech_plugin/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"xf_speech_plugin","dependencies":[]}],"date_created":"2020-03-20 14:25:16.710361","version":"1.15.21"}
\ No newline at end of file
diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml
index 68b56b3..91daf4b 100644
--- a/example/android/app/src/main/AndroidManifest.xml
+++ b/example/android/app/src/main/AndroidManifest.xml
@@ -7,27 +7,34 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
-
+
+ android:name="io.flutter.embedding.android.NormalTheme"
+ android:resource="@style/NormalTheme"
+ />
+
+
diff --git a/example/android/app/src/main/java/com/lilplugins/xf_speech_plugin_example/EmbeddingV1Activity.java b/example/android/app/src/main/java/com/lilplugins/xf_speech_plugin_example/EmbeddingV1Activity.java
new file mode 100644
index 0000000..4831b6b
--- /dev/null
+++ b/example/android/app/src/main/java/com/lilplugins/xf_speech_plugin_example/EmbeddingV1Activity.java
@@ -0,0 +1,18 @@
+package com.lilplugins.xf_speech_plugin_example;
+
+import android.os.Bundle;
+
+import io.flutter.app.FlutterActivity;
+import io.flutter.plugins.GeneratedPluginRegistrant;
+
+/**
+ * EmbeddingV1 兼容测试类
+ */
+public class EmbeddingV1Activity extends FlutterActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ }
+}
+
diff --git a/example/android/app/src/main/java/com/lilplugins/xf_speech_plugin_example/MainActivity.java b/example/android/app/src/main/java/com/lilplugins/xf_speech_plugin_example/MainActivity.java
index be15ed4..b912728 100644
--- a/example/android/app/src/main/java/com/lilplugins/xf_speech_plugin_example/MainActivity.java
+++ b/example/android/app/src/main/java/com/lilplugins/xf_speech_plugin_example/MainActivity.java
@@ -1,13 +1,14 @@
package com.lilplugins.xf_speech_plugin_example;
import android.os.Bundle;
-import io.flutter.app.FlutterActivity;
+
import io.flutter.plugins.GeneratedPluginRegistrant;
+/*
+ * v1
+ *import io.flutter.app.FlutterActivity;
+ */
+import io.flutter.embedding.android.FlutterActivity;
+
public class MainActivity extends FlutterActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- GeneratedPluginRegistrant.registerWith(this);
- }
}
diff --git a/example/android/app/src/main/res/values-night/styles.xml b/example/android/app/src/main/res/values-night/styles.xml
new file mode 100644
index 0000000..3db14bb
--- /dev/null
+++ b/example/android/app/src/main/res/values-night/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml
index 00fa441..d460d1e 100644
--- a/example/android/app/src/main/res/values/styles.xml
+++ b/example/android/app/src/main/res/values/styles.xml
@@ -1,8 +1,18 @@
-
+
+
diff --git a/example/pubspec.lock b/example/pubspec.lock
index 0227b85..8bccb85 100644
--- a/example/pubspec.lock
+++ b/example/pubspec.lock
@@ -1,69 +1,62 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
- archive:
- dependency: transitive
- description:
- name: archive
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.11"
- args:
- dependency: transitive
- description:
- name: args
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.5.2"
async:
dependency: transitive
description:
name: async
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.4.0"
+ version: "2.8.2"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.0.5"
- charcode:
+ version: "2.1.0"
+ characters:
dependency: transitive
description:
- name: charcode
- url: "https://pub.dartlang.org"
+ name: characters
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.1.2"
- collection:
+ version: "1.2.0"
+ charcode:
dependency: transitive
description:
- name: collection
- url: "https://pub.dartlang.org"
+ name: charcode
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.14.11"
- convert:
+ version: "1.3.1"
+ clock:
dependency: transitive
description:
- name: convert
- url: "https://pub.dartlang.org"
+ name: clock
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.1.1"
- crypto:
+ version: "1.1.0"
+ collection:
dependency: transitive
description:
- name: crypto
- url: "https://pub.dartlang.org"
+ name: collection
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.1.3"
+ version: "1.16.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
+ source: hosted
+ version: "0.1.3"
+ fake_async:
+ dependency: transitive
+ description:
+ name: fake_async
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "0.1.2"
+ version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
@@ -74,48 +67,34 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
- image:
+ matcher:
dependency: transitive
description:
- name: image
- url: "https://pub.dartlang.org"
+ name: matcher
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.1.4"
- matcher:
+ version: "0.12.11"
+ material_color_utilities:
dependency: transitive
description:
- name: matcher
- url: "https://pub.dartlang.org"
+ name: material_color_utilities
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "0.12.6"
+ version: "0.1.4"
meta:
dependency: transitive
description:
name: meta
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.1.8"
+ version: "1.7.0"
path:
dependency: transitive
description:
name: path
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.6.4"
- petitparser:
- dependency: transitive
- description:
- name: petitparser
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.4.0"
- quiver:
- dependency: transitive
- description:
- name: quiver
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.0.5"
+ version: "1.8.1"
sky_engine:
dependency: transitive
description: flutter
@@ -125,58 +104,51 @@ packages:
dependency: transitive
description:
name: source_span
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.5.5"
+ version: "1.8.2"
stack_trace:
dependency: transitive
description:
name: stack_trace
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.9.3"
+ version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.0.0"
+ version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.0.5"
+ version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.1.0"
+ version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "0.2.15"
- typed_data:
- dependency: transitive
- description:
- name: typed_data
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.1.6"
+ version: "0.4.9"
vector_math:
dependency: transitive
description:
name: vector_math
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.0.8"
+ version: "2.1.2"
xf_speech_plugin:
dependency: "direct dev"
description:
@@ -184,12 +156,5 @@ packages:
relative: true
source: path
version: "0.0.1"
- xml:
- dependency: transitive
- description:
- name: xml
- url: "https://pub.dartlang.org"
- source: hosted
- version: "3.5.0"
sdks:
- dart: ">=2.4.0 <3.0.0"
+ dart: ">=2.17.0-0 <3.0.0"
diff --git a/lib/xf_speech_plugin.dart b/lib/xf_speech_plugin.dart
index 25b1073..d440261 100644
--- a/lib/xf_speech_plugin.dart
+++ b/lib/xf_speech_plugin.dart
@@ -5,11 +5,11 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
class XfSpeechPlugin {
-
static final XfSpeechPlugin instance = XfSpeechPlugin._();
XfSpeechPlugin._();
- static const MethodChannel _channel = const MethodChannel('lilplugins.com/xf_speech_plugin');
+ static const MethodChannel _channel =
+ const MethodChannel('lilplugins.com/xf_speech_plugin');
// the following three methods would be called to change for both SpeechRecognizer & SpeechSynthesizer
static const String _METHOD_INITWITHAPPID = 'initWithAppId';
@@ -28,98 +28,104 @@ class XfSpeechPlugin {
static const String _METHOD_STOP_SPEAKING = 'stopSpeaking';
static const String _METHOD_IS_SPEAKING = 'isSpeaking';
- Future initWithAppId({@required String iosAppID, @required String androidAppID}) async {
+ Future initWithAppId(
+ {required String iosAppID, required String androidAppID}) async {
assert(iosAppID != null && iosAppID.isNotEmpty);
assert(androidAppID != null && androidAppID.isNotEmpty);
return _channel.invokeMethod(
- _METHOD_INITWITHAPPID, Platform.isIOS ? iosAppID : androidAppID,
+ _METHOD_INITWITHAPPID,
+ Platform.isIOS ? iosAppID : androidAppID,
);
}
Future setParameter(Map param) async {
- _channel.invokeMethod(_METHOD_SETPARAMETER, param);
+ _channel.invokeMethod(_METHOD_SETPARAMETER, param);
}
Future dispose() async {
- _channel.invokeMethod(_METHOD_DISPOSE);
+ _channel.invokeMethod(_METHOD_DISPOSE);
}
- Future startListening({XfSpeechListener listener}) async {
+ Future startListening({XfSpeechListener? listener}) async {
_channel.setMethodCallHandler((MethodCall call) async {
-
- if (call.method == 'onBeginOfSpeech' && listener?.onBeginOfSpeech != null) {
- listener.onBeginOfSpeech();
+ if (call.method == 'onBeginOfSpeech' &&
+ listener?.onBeginOfSpeech != null) {
+ listener!.onBeginOfSpeech!();
}
if (call.method == 'onCancel' && listener?.onCancel != null) {
- listener.onCancel();
+ listener!.onCancel!();
}
if (call.method == 'onEndOfSpeech' && listener?.onEndOfSpeech != null) {
- listener.onEndOfSpeech();
+ listener!.onEndOfSpeech!();
}
if (call.method == 'onCompleted' && listener?.onCompleted != null) {
- listener.onCompleted(call.arguments[0], call.arguments[1]);
+ listener!.onCompleted!(call.arguments[0], call.arguments[1]);
}
if (call.method == 'onResults' && listener?.onResults != null) {
- listener.onResults(call.arguments[0], call.arguments[1]);
+ listener!.onResults!(call.arguments[0], call.arguments[1]);
}
- if (call.method == 'onVolumeChanged' && listener?.onVolumeChanged != null) {
- listener.onVolumeChanged(call.arguments);
+ if (call.method == 'onVolumeChanged' &&
+ listener?.onVolumeChanged != null) {
+ listener!.onVolumeChanged!(call.arguments);
}
-
});
- _channel.invokeMethod(_METHOD_STARTLISTENING);
+ _channel.invokeMethod(_METHOD_STARTLISTENING);
}
-
Future stopListening() async {
- _channel.invokeMethod(_METHOD_STOPLISTENING);
+ _channel.invokeMethod(_METHOD_STOPLISTENING);
}
Future cancelListenning() async {
- _channel.invokeMethod(_METHOD_CANCELLISTENING);
+ _channel.invokeMethod(_METHOD_CANCELLISTENING);
}
- Future startSpeaking({@required String string, XfSpeechListener listener}) async{
-
- _channel.setMethodCallHandler((MethodCall call) async{
- if (call.method == 'onSpeakBegin' && listener?.onSpeakBegin != null) {
- listener.onSpeakBegin();
+ Future startSpeaking(
+ {required String string, XfSpeechListener? listener}) async {
+ _channel.setMethodCallHandler((MethodCall call) async {
+ if (call.method == 'onSpeakBegin' && listener!.onSpeakBegin != null) {
+ listener.onSpeakBegin!();
}
- if (call.method == 'onBufferProgress' && listener?.onBufferProgress != null) {
- listener.onBufferProgress(call.arguments[0],call.arguments[1],call.arguments[2],call.arguments[3]);
+ if (call.method == 'onBufferProgress' &&
+ listener?.onBufferProgress != null) {
+ listener!.onBufferProgress!(call.arguments[0], call.arguments[1],
+ call.arguments[2], call.arguments[3]);
}
- if (call.method == 'onSpeakProgress' && listener?.onSpeakProgress != null) {
- listener.onSpeakProgress(call.arguments[0],call.arguments[1],call.arguments[2]);
+ if (call.method == 'onSpeakProgress' &&
+ listener?.onSpeakProgress != null) {
+ listener!.onSpeakProgress!(
+ call.arguments[0], call.arguments[1], call.arguments[2]);
}
- if (call.method == 'onVolumeChanged' && listener?.onVolumeChanged != null) {
- listener.onVolumeChanged(call.arguments);
+ if (call.method == 'onVolumeChanged' &&
+ listener?.onVolumeChanged != null) {
+ listener!.onVolumeChanged!(call.arguments);
}
if (call.method == 'onSpeakPaused' && listener?.onSpeakPaused != null) {
- listener.onSpeakPaused();
+ listener!.onSpeakPaused!();
}
if (call.method == 'onCompleted' && listener?.onCompleted != null) {
- listener.onCompleted(call.arguments[0],call.arguments[1]);
+ listener!.onCompleted!(call.arguments[0], call.arguments[1]);
}
if (call.method == 'onSpeakResumed' && listener?.onSpeakResumed != null) {
- listener.onSpeakResumed();
+ listener!.onSpeakResumed!();
}
});
- _channel.invokeMethod(_METHOD_START_SPEAKING, string);
+ _channel.invokeMethod(_METHOD_START_SPEAKING, string);
}
Future pauseSpeaking() async {
- _channel.invokeMethod(_METHOD_PAUSE_SPEAKING);
+ _channel.invokeMethod(_METHOD_PAUSE_SPEAKING);
}
Future resumeSpeaking() async {
- _channel.invokeMethod(_METHOD_RESUME_SPEAKING);
+ _channel.invokeMethod(_METHOD_RESUME_SPEAKING);
}
Future stopSpeaking() async {
- _channel.invokeMethod(_METHOD_STOP_SPEAKING);
+ _channel.invokeMethod(_METHOD_STOP_SPEAKING);
}
- Future isSpeaking() async {
+ Future isSpeaking() async {
return _channel.invokeMethod(_METHOD_IS_SPEAKING);
}
@@ -128,81 +134,79 @@ class XfSpeechPlugin {
}
}
-class XfSpeechListener{
- VoidCallback onBeginOfSpeech;
- VoidCallback onEndOfSpeech;
- VoidCallback onCancel;
+class XfSpeechListener {
+ VoidCallback? onBeginOfSpeech;
+ VoidCallback? onEndOfSpeech;
+ VoidCallback? onCancel;
- void Function(Map error, String filePath) onCompleted;
- void Function(String result, bool isLast) onResults;
- void Function(int volume) onVolumeChanged;
+ void Function(Map error, String filePath)? onCompleted;
+ void Function(String result, bool isLast)? onResults;
+ void Function(int volume)? onVolumeChanged;
- VoidCallback onSpeakResumed;
- VoidCallback onSpeakPaused;
- VoidCallback onSpeakBegin;
- void Function(int p, int b, int e, String a) onBufferProgress;
- void Function(int p, int b, int e) onSpeakProgress;
+ VoidCallback? onSpeakResumed;
+ VoidCallback? onSpeakPaused;
+ VoidCallback? onSpeakBegin;
+ void Function(int p, int b, int e, String a)? onBufferProgress;
+ void Function(int p, int b, int e)? onSpeakProgress;
- XfSpeechListener({
- this.onBeginOfSpeech,
- this.onResults,
- this.onVolumeChanged,
- this.onEndOfSpeech,
- this.onCompleted,
- this.onCancel,
-
- this.onSpeakResumed,
- this.onSpeakBegin,
- this.onSpeakPaused,
- this.onBufferProgress,
- this.onSpeakProgress
- });
+ XfSpeechListener(
+ {this.onBeginOfSpeech,
+ this.onResults,
+ this.onVolumeChanged,
+ this.onEndOfSpeech,
+ this.onCompleted,
+ this.onCancel,
+ this.onSpeakResumed,
+ this.onSpeakBegin,
+ this.onSpeakPaused,
+ this.onBufferProgress,
+ this.onSpeakProgress});
}
class XFVoiceParam {
- String speech_timeout;
- String domain;
- String result_type;
- String timeout;
- String power_cycle;
- String sample_rate;
- String engine_type;
- String local;
- String cloud;
- String mix;
- String auto;
- String text_encoding;
- String result_encoding;
- String player_init;
- String player_deactive;
- String recorder_init;
- String recorder_deactive;
- String speed;
- String pitch;
- String tts_audio_path;
- String vad_enable;
- String vad_bos;
- String vad_eos;
- String voice_name;
- String voice_id;
- String voice_lang;
- String volume;
- String tts_buffer_time;
- String tts_data_notify;
- String next_text;
- String mpplayinginfocenter;
- String audio_source;
- String asr_audio_path;
- String asr_sch;
- String asr_ptt;
- String local_grammar;
- String cloud_grammar;
- String grammar_type;
- String grammar_content;
- String lexicon_content;
- String lexicon_name;
- String grammar_list;
- String nlp_version;
+ String? speech_timeout;
+ String? domain;
+ String? result_type;
+ String? timeout;
+ String? power_cycle;
+ String? sample_rate;
+ String? engine_type;
+ String? local;
+ String? cloud;
+ String? mix;
+ String? auto;
+ String? text_encoding;
+ String? result_encoding;
+ String? player_init;
+ String? player_deactive;
+ String? recorder_init;
+ String? recorder_deactive;
+ String? speed;
+ String? pitch;
+ String? tts_audio_path;
+ String? vad_enable;
+ String? vad_bos;
+ String? vad_eos;
+ String? voice_name;
+ String? voice_id;
+ String? voice_lang;
+ String? volume;
+ String? tts_buffer_time;
+ String? tts_data_notify;
+ String? next_text;
+ String? mpplayinginfocenter;
+ String? audio_source;
+ String? asr_audio_path;
+ String? asr_sch;
+ String? asr_ptt;
+ String? local_grammar;
+ String? cloud_grammar;
+ String? grammar_type;
+ String? grammar_content;
+ String? lexicon_content;
+ String? lexicon_name;
+ String? grammar_list;
+ String? nlp_version;
Map toMap() {
Map param = {
@@ -256,4 +260,4 @@ class XFVoiceParam {
param.removeWhere(isNull);
return param;
}
-}
\ No newline at end of file
+}
diff --git a/pubspec.lock b/pubspec.lock
index 8cc5355..c807c42 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -1,62 +1,55 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
- archive:
- dependency: transitive
- description:
- name: archive
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.11"
- args:
- dependency: transitive
- description:
- name: args
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.5.2"
async:
dependency: transitive
description:
name: async
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.4.0"
+ version: "2.8.2"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
+ source: hosted
+ version: "2.1.0"
+ characters:
+ dependency: transitive
+ description:
+ name: characters
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.0.5"
+ version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.1.2"
- collection:
+ version: "1.3.1"
+ clock:
dependency: transitive
description:
- name: collection
- url: "https://pub.dartlang.org"
+ name: clock
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.14.11"
- convert:
+ version: "1.1.0"
+ collection:
dependency: transitive
description:
- name: convert
- url: "https://pub.dartlang.org"
+ name: collection
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.1.1"
- crypto:
+ version: "1.16.0"
+ fake_async:
dependency: transitive
description:
- name: crypto
- url: "https://pub.dartlang.org"
+ name: fake_async
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.1.3"
+ version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
@@ -67,48 +60,34 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
- image:
+ matcher:
dependency: transitive
description:
- name: image
- url: "https://pub.dartlang.org"
+ name: matcher
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.1.4"
- matcher:
+ version: "0.12.11"
+ material_color_utilities:
dependency: transitive
description:
- name: matcher
- url: "https://pub.dartlang.org"
+ name: material_color_utilities
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "0.12.6"
+ version: "0.1.4"
meta:
dependency: transitive
description:
name: meta
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.1.8"
+ version: "1.7.0"
path:
dependency: transitive
description:
name: path
- url: "https://pub.dartlang.org"
- source: hosted
- version: "1.6.4"
- petitparser:
- dependency: transitive
- description:
- name: petitparser
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.4.0"
- quiver:
- dependency: transitive
- description:
- name: quiver
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.0.5"
+ version: "1.8.1"
sky_engine:
dependency: transitive
description: flutter
@@ -118,64 +97,50 @@ packages:
dependency: transitive
description:
name: source_span
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.5.5"
+ version: "1.8.2"
stack_trace:
dependency: transitive
description:
name: stack_trace
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.9.3"
+ version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "2.0.0"
+ version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.0.5"
+ version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.1.0"
+ version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
- url: "https://pub.dartlang.org"
- source: hosted
- version: "0.2.15"
- typed_data:
- dependency: transitive
- description:
- name: typed_data
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "1.1.6"
+ version: "0.4.9"
vector_math:
dependency: transitive
description:
name: vector_math
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.8"
- xml:
- dependency: transitive
- description:
- name: xml
- url: "https://pub.dartlang.org"
+ url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/"
source: hosted
- version: "3.5.0"
+ version: "2.1.2"
sdks:
- dart: ">=2.4.0 <3.0.0"
+ dart: ">=2.17.0-0 <3.0.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index f186142..6b86927 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -5,7 +5,7 @@ author:
homepage:
environment:
- sdk: ">=2.1.0 <3.0.0"
+ sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter: