basic_intl 修改为 t_basic_intl
This commit is contained in:
13
README.md
13
README.md
@@ -1,6 +1,6 @@
|
|||||||
# AI Chat Assistant Flutter Plugin
|
# AI Chat Assistant Flutter Plugin
|
||||||
|
|
||||||
一个功能丰富的 AI 聊天助手 Flutter 插件,专为车载系统设计,支持语音识别、AI 对话、车控命令执行、语音合成等功能。
|
一个功能丰富的 AI 聊天助手 Flutter 插件,支持语音识别、AI 对话、车控命令执行、语音合成等功能。
|
||||||
|
|
||||||
## 📱 功能特性
|
## 📱 功能特性
|
||||||
|
|
||||||
@@ -489,16 +489,6 @@ void main() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🤝 贡献指南
|
|
||||||
|
|
||||||
欢迎提交 Issue 和 Pull Request!
|
|
||||||
|
|
||||||
1. Fork 本仓库
|
|
||||||
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
|
|
||||||
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
|
|
||||||
4. 推送到分支 (`git push origin feature/AmazingFeature`)
|
|
||||||
5. 打开 Pull Request
|
|
||||||
|
|
||||||
## 📄 许可证
|
## 📄 许可证
|
||||||
|
|
||||||
本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。
|
本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。
|
||||||
@@ -529,6 +519,5 @@ void main() {
|
|||||||
- 🎵 改进语音识别和TTS服务
|
- 🎵 改进语音识别和TTS服务
|
||||||
|
|
||||||
#### 技术栈更新
|
#### 技术栈更新
|
||||||
- 📦 Flutter SDK 升级到 ^3.5.0
|
|
||||||
- 🔧 添加 Meta 注解支持
|
- 🔧 添加 Meta 注解支持
|
||||||
- 🌐 保持与 basic_intl 国际化包的兼容
|
- 🌐 保持与 basic_intl 国际化包的兼容
|
||||||
|
|||||||
@@ -80,13 +80,6 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.0"
|
version: "3.1.0"
|
||||||
basic_intl:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
path: "../packages/basic_intl"
|
|
||||||
relative: true
|
|
||||||
source: path
|
|
||||||
version: "0.2.0"
|
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -539,6 +532,13 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.3.0+3"
|
version: "3.3.0+3"
|
||||||
|
t_basic_intl:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
path: "../packages/basic_intl"
|
||||||
|
relative: true
|
||||||
|
source: path
|
||||||
|
version: "0.2.0"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:ai_chat_assistant/models/chat_message.dart';
|
import 'package:ai_chat_assistant/models/chat_message.dart';
|
||||||
import 'package:basic_intl/intl.dart';
|
import 'package:t_basic_intl/intl.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../enums/message_status.dart';
|
import '../enums/message_status.dart';
|
||||||
import '../widgets/chat_box.dart';
|
import '../widgets/chat_box.dart';
|
||||||
|
|||||||
@@ -37,8 +37,7 @@ class _MainScreenState extends State<MainScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
// FloatingIcon(),
|
// FloatingIcon(),
|
||||||
ChatPopup(
|
ChatPopup()
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:basic_intl/intl.dart';
|
import 'package:t_basic_intl/intl.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
|
||||||
class LocationService {
|
class LocationService {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import 'dart:async';
|
|||||||
import 'package:ai_chat_assistant/ai_chat_assistant.dart';
|
import 'package:ai_chat_assistant/ai_chat_assistant.dart';
|
||||||
import 'package:ai_chat_assistant/utils/common_util.dart';
|
import 'package:ai_chat_assistant/utils/common_util.dart';
|
||||||
import 'package:ai_chat_assistant/utils/tts_util.dart';
|
import 'package:ai_chat_assistant/utils/tts_util.dart';
|
||||||
import 'package:basic_intl/intl.dart';
|
import 'package:t_basic_intl/intl.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'package:basic_intl/intl.dart';
|
import 'package:t_basic_intl/intl.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class AppTheme {
|
class AppTheme {
|
||||||
|
|||||||
@@ -13,8 +13,11 @@ class ChatWindowContent extends StatefulWidget {
|
|||||||
final double? maxHeight;
|
final double? maxHeight;
|
||||||
final double? chatWidth;
|
final double? chatWidth;
|
||||||
|
|
||||||
|
final VoidCallback? onCloseWindow;
|
||||||
|
|
||||||
const ChatWindowContent({
|
const ChatWindowContent({
|
||||||
super.key,
|
super.key,
|
||||||
|
this.onCloseWindow,
|
||||||
this.animationController,
|
this.animationController,
|
||||||
this.minHeight,
|
this.minHeight,
|
||||||
this.maxHeight,
|
this.maxHeight,
|
||||||
@@ -55,6 +58,9 @@ class _ChatWindowContentState extends State<ChatWindowContent> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _openFullScreen() async {
|
void _openFullScreen() async {
|
||||||
|
if (widget.onCloseWindow != null) {
|
||||||
|
widget.onCloseWindow!();
|
||||||
|
}
|
||||||
final messageService = context.read<MessageService>();
|
final messageService = context.read<MessageService>();
|
||||||
|
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'package:ai_chat_assistant/utils/common_util.dart';
|
import 'package:ai_chat_assistant/utils/common_util.dart';
|
||||||
import 'package:ai_chat_assistant/widgets/rotating_image.dart';
|
import 'package:ai_chat_assistant/widgets/rotating_image.dart';
|
||||||
import 'package:basic_intl/intl.dart';
|
import 'package:t_basic_intl/intl.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
import '../enums/message_status.dart';
|
import '../enums/message_status.dart';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import 'package:provider/provider.dart';
|
|||||||
import '../services/message_service.dart';
|
import '../services/message_service.dart';
|
||||||
import '../pages/full_screen.dart';
|
import '../pages/full_screen.dart';
|
||||||
import 'floating_icon_with_wave.dart';
|
import 'floating_icon_with_wave.dart';
|
||||||
import 'package:basic_intl/intl.dart';
|
import 'package:t_basic_intl/intl.dart';
|
||||||
import '../utils/assets_util.dart';
|
import '../utils/assets_util.dart';
|
||||||
|
|
||||||
class ChatFloatingIcon extends StatefulWidget {
|
class ChatFloatingIcon extends StatefulWidget {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'package:basic_intl/intl.dart';
|
import 'package:t_basic_intl/intl.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import 'package:basic_intl/intl.dart';
|
import 'package:t_basic_intl/intl.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'assistant_avatar.dart';
|
import 'assistant_avatar.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,20 @@ class _ChatPopupState extends State<ChatPopup> with SingleTickerProviderStateMix
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_openFullScreenPage() async {
|
||||||
|
final messageService = MessageService.instance;
|
||||||
|
_removeOverlay();
|
||||||
|
|
||||||
|
await Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => ChangeNotifierProvider.value(
|
||||||
|
value: messageService, // 传递同一个单例实例
|
||||||
|
child: const FullScreenPage(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ChangeNotifierProvider.value(
|
return ChangeNotifierProvider.value(
|
||||||
@@ -89,16 +103,17 @@ class _ChatPopupState extends State<ChatPopup> with SingleTickerProviderStateMix
|
|||||||
|
|
||||||
Widget _buildPopupBackground() {
|
Widget _buildPopupBackground() {
|
||||||
return Positioned.fill(
|
return Positioned.fill(
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
final messageService = MessageService.instance;
|
final messageService = MessageService.instance;
|
||||||
_removeOverlay();
|
_removeOverlay();
|
||||||
messageService.abortReply();
|
messageService.abortReply();
|
||||||
messageService.initializeEmpty();
|
messageService.initializeEmpty();
|
||||||
},
|
},
|
||||||
child: SizedBox.expand()
|
child: SizedBox.expand(
|
||||||
),
|
child: Container(
|
||||||
);
|
color: Colors.black45.withValues(alpha: 0.1),
|
||||||
|
))));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildPopupContent(BoxConstraints constraints) {
|
Widget _buildPopupContent(BoxConstraints constraints) {
|
||||||
@@ -112,6 +127,7 @@ class _ChatPopupState extends State<ChatPopup> with SingleTickerProviderStateMix
|
|||||||
right: position.right,
|
right: position.right,
|
||||||
bottom: position.bottom,
|
bottom: position.bottom,
|
||||||
child: ChatWindowContent(
|
child: ChatWindowContent(
|
||||||
|
onCloseWindow: _removeOverlay,
|
||||||
animationController: _partScreenAnimationController,
|
animationController: _partScreenAnimationController,
|
||||||
minHeight: minHeight,
|
minHeight: minHeight,
|
||||||
maxHeight: maxHeight,
|
maxHeight: maxHeight,
|
||||||
@@ -131,20 +147,9 @@ class _ChatPopupState extends State<ChatPopup> with SingleTickerProviderStateMix
|
|||||||
// 先执行外部传入的 onTap(如果有)
|
// 先执行外部传入的 onTap(如果有)
|
||||||
if (widget.child!.onTap != null) {
|
if (widget.child!.onTap != null) {
|
||||||
widget.child!.onTap!();
|
widget.child!.onTap!();
|
||||||
} else {
|
|
||||||
// 默认行为:关闭弹窗并打开全屏
|
|
||||||
final messageService = context.read<MessageService>();
|
|
||||||
_removeOverlay();
|
|
||||||
|
|
||||||
await Navigator.of(context).push(
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) => ChangeNotifierProvider.value(
|
|
||||||
value: messageService,
|
|
||||||
child: const FullScreenPage(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
// 默认行为:关闭弹窗并打开全屏
|
||||||
|
await _openFullScreenPage();
|
||||||
},
|
},
|
||||||
onLongPress: () async {
|
onLongPress: () async {
|
||||||
debugPrint('⏳ FloatingIcon onLongPress triggered! (using child properties)');
|
debugPrint('⏳ FloatingIcon onLongPress triggered! (using child properties)');
|
||||||
@@ -195,17 +200,7 @@ class _ChatPopupState extends State<ChatPopup> with SingleTickerProviderStateMix
|
|||||||
icon: widget.icon,
|
icon: widget.icon,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
debugPrint('🖱️ FloatingIcon onTap triggered!');
|
debugPrint('🖱️ FloatingIcon onTap triggered!');
|
||||||
final messageService = context.read<MessageService>();
|
await _openFullScreenPage();
|
||||||
_removeOverlay();
|
|
||||||
|
|
||||||
await Navigator.of(context).push(
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) => ChangeNotifierProvider.value(
|
|
||||||
value: messageService, // 传递同一个单例实例
|
|
||||||
child: const FullScreenPage(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
onLongPress: () async {
|
onLongPress: () async {
|
||||||
debugPrint('⏳ FloatingIcon onLongPress triggered!');
|
debugPrint('⏳ FloatingIcon onLongPress triggered!');
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import '../pages/full_screen.dart';
|
|||||||
import '../screens/part_screen.dart';
|
import '../screens/part_screen.dart';
|
||||||
import 'floating_icon_with_wave.dart';
|
import 'floating_icon_with_wave.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:basic_intl/intl.dart';
|
import 'package:t_basic_intl/intl.dart';
|
||||||
import '../utils/assets_util.dart';
|
import '../utils/assets_util.dart';
|
||||||
|
|
||||||
class FloatingIcon extends StatefulWidget {
|
class FloatingIcon extends StatefulWidget {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name: basic_intl
|
name: t_basic_intl
|
||||||
description: Basic internationalization utilities for ai_chat_assistant
|
description: Basic internationalization utilities for ai_chat_assistant
|
||||||
version: 0.2.0
|
version: 0.2.0
|
||||||
|
|
||||||
|
|||||||
14
pubspec.lock
14
pubspec.lock
@@ -73,13 +73,6 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.0"
|
version: "3.1.0"
|
||||||
basic_intl:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
path: "packages/basic_intl"
|
|
||||||
relative: true
|
|
||||||
source: path
|
|
||||||
version: "0.2.0"
|
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -447,6 +440,13 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.3.0+3"
|
version: "3.3.0+3"
|
||||||
|
t_basic_intl:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
path: "packages/basic_intl"
|
||||||
|
relative: true
|
||||||
|
source: path
|
||||||
|
version: "0.2.0"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ dependencies:
|
|||||||
provider: ^6.1.5
|
provider: ^6.1.5
|
||||||
flutter_tts: ^4.2.0
|
flutter_tts: ^4.2.0
|
||||||
# basic_intl: 0.2.0
|
# basic_intl: 0.2.0
|
||||||
basic_intl:
|
t_basic_intl:
|
||||||
path: packages/basic_intl
|
path: packages/basic_intl
|
||||||
# flutter_ingeek_carkey: 1.4.7
|
# flutter_ingeek_carkey: 1.4.7
|
||||||
# app_car:
|
# app_car:
|
||||||
|
|||||||
Reference in New Issue
Block a user