From ec003dcd4bab4039dfea6b4fd3e1778b3feee93a Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 10 Sep 2025 09:32:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E4=B8=BARecordingButton=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E5=92=8C=E5=9B=BE=E6=A0=87=E5=A4=A7=E5=B0=8F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 idleIcon 参数支持自定义空闲状态图标 - 添加 recordingIcon 参数支持自定义录音状态图标 - 添加 iconSize 参数支持自定义图标大小 - 保持向后兼容性,使用默认图标和大小 - 更新组件文档注释 --- lib/src/widgets/recording_button.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/widgets/recording_button.dart b/lib/src/widgets/recording_button.dart index 17113cf..534a384 100644 --- a/lib/src/widgets/recording_button.dart +++ b/lib/src/widgets/recording_button.dart @@ -52,6 +52,9 @@ class RecordingButton extends StatefulWidget { /// 录音状态时显示的图标 final IconData? recordingIcon; + /// 按钮图标大小 + final double iconSize; + const RecordingButton({ super.key, this.speechService, @@ -68,6 +71,7 @@ class RecordingButton extends StatefulWidget { this.tooltip, this.idleIcon, this.recordingIcon, + this.iconSize = 40.0, }); @override @@ -236,7 +240,7 @@ class _RecordingButtonState extends State _isListening ? (widget.recordingIcon ?? Icons.stop_rounded) : (widget.idleIcon ?? Icons.mic_rounded), - size: widget.size * 0.55, + size: widget.iconSize, color: iconColor, ), ), From 7ed4511643102ae0f3137b4f22a9c26bab76e142 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 10 Sep 2025 09:33:21 +0800 Subject: [PATCH 2/2] feat: update version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index eaf2ee3..0ade8ab 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: yx_asr description: 基于 sherpa_onnx 的 Flutter 语音识别插件,提供完全离线的实时语音转文字功能。 -version: 1.0.1 +version: 1.0.2 homepage: https://github.com/yuanxuan/yx_asr environment: