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 聊天助手 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) 文件了解详情。
|
||||
@@ -529,6 +519,5 @@ void main() {
|
||||
- 🎵 改进语音识别和TTS服务
|
||||
|
||||
#### 技术栈更新
|
||||
- 📦 Flutter SDK 升级到 ^3.5.0
|
||||
- 🔧 添加 Meta 注解支持
|
||||
- 🌐 保持与 basic_intl 国际化包的兼容
|
||||
|
||||
@@ -80,13 +80,6 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
basic_intl:
|
||||
dependency: transitive
|
||||
description:
|
||||
path: "../packages/basic_intl"
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.2.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -539,6 +532,13 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 '../enums/message_status.dart';
|
||||
import '../widgets/chat_box.dart';
|
||||
|
||||
@@ -37,8 +37,7 @@ class _MainScreenState extends State<MainScreen> {
|
||||
),
|
||||
),
|
||||
// FloatingIcon(),
|
||||
ChatPopup(
|
||||
)
|
||||
ChatPopup()
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'dart:convert';
|
||||
import 'package:basic_intl/intl.dart';
|
||||
import 'package:t_basic_intl/intl.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class LocationService {
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'dart:async';
|
||||
import 'package:ai_chat_assistant/ai_chat_assistant.dart';
|
||||
import 'package:ai_chat_assistant/utils/common_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/services.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';
|
||||
|
||||
class AppTheme {
|
||||
|
||||
@@ -13,8 +13,11 @@ class ChatWindowContent extends StatefulWidget {
|
||||
final double? maxHeight;
|
||||
final double? chatWidth;
|
||||
|
||||
final VoidCallback? onCloseWindow;
|
||||
|
||||
const ChatWindowContent({
|
||||
super.key,
|
||||
this.onCloseWindow,
|
||||
this.animationController,
|
||||
this.minHeight,
|
||||
this.maxHeight,
|
||||
@@ -55,6 +58,9 @@ class _ChatWindowContentState extends State<ChatWindowContent> {
|
||||
}
|
||||
|
||||
void _openFullScreen() async {
|
||||
if (widget.onCloseWindow != null) {
|
||||
widget.onCloseWindow!();
|
||||
}
|
||||
final messageService = context.read<MessageService>();
|
||||
|
||||
Navigator.of(context).push(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:ai_chat_assistant/utils/common_util.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_markdown/flutter_markdown.dart';
|
||||
import '../enums/message_status.dart';
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:provider/provider.dart';
|
||||
import '../services/message_service.dart';
|
||||
import '../pages/full_screen.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';
|
||||
|
||||
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/services.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 '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
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider.value(
|
||||
@@ -89,16 +103,17 @@ class _ChatPopupState extends State<ChatPopup> with SingleTickerProviderStateMix
|
||||
|
||||
Widget _buildPopupBackground() {
|
||||
return Positioned.fill(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
final messageService = MessageService.instance;
|
||||
_removeOverlay();
|
||||
messageService.abortReply();
|
||||
messageService.initializeEmpty();
|
||||
},
|
||||
child: SizedBox.expand()
|
||||
),
|
||||
);
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
final messageService = MessageService.instance;
|
||||
_removeOverlay();
|
||||
messageService.abortReply();
|
||||
messageService.initializeEmpty();
|
||||
},
|
||||
child: SizedBox.expand(
|
||||
child: Container(
|
||||
color: Colors.black45.withValues(alpha: 0.1),
|
||||
))));
|
||||
}
|
||||
|
||||
Widget _buildPopupContent(BoxConstraints constraints) {
|
||||
@@ -112,6 +127,7 @@ class _ChatPopupState extends State<ChatPopup> with SingleTickerProviderStateMix
|
||||
right: position.right,
|
||||
bottom: position.bottom,
|
||||
child: ChatWindowContent(
|
||||
onCloseWindow: _removeOverlay,
|
||||
animationController: _partScreenAnimationController,
|
||||
minHeight: minHeight,
|
||||
maxHeight: maxHeight,
|
||||
@@ -131,20 +147,9 @@ class _ChatPopupState extends State<ChatPopup> with SingleTickerProviderStateMix
|
||||
// 先执行外部传入的 onTap(如果有)
|
||||
if (widget.child!.onTap != null) {
|
||||
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 {
|
||||
debugPrint('⏳ FloatingIcon onLongPress triggered! (using child properties)');
|
||||
@@ -195,17 +200,7 @@ class _ChatPopupState extends State<ChatPopup> with SingleTickerProviderStateMix
|
||||
icon: widget.icon,
|
||||
onTap: () async {
|
||||
debugPrint('🖱️ FloatingIcon onTap triggered!');
|
||||
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 {
|
||||
debugPrint('⏳ FloatingIcon onLongPress triggered!');
|
||||
|
||||
@@ -5,7 +5,7 @@ import '../pages/full_screen.dart';
|
||||
import '../screens/part_screen.dart';
|
||||
import 'floating_icon_with_wave.dart';
|
||||
import 'dart:async';
|
||||
import 'package:basic_intl/intl.dart';
|
||||
import 'package:t_basic_intl/intl.dart';
|
||||
import '../utils/assets_util.dart';
|
||||
|
||||
class FloatingIcon extends StatefulWidget {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: basic_intl
|
||||
name: t_basic_intl
|
||||
description: Basic internationalization utilities for ai_chat_assistant
|
||||
version: 0.2.0
|
||||
|
||||
|
||||
14
pubspec.lock
14
pubspec.lock
@@ -73,13 +73,6 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
basic_intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "packages/basic_intl"
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.2.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -447,6 +440,13 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -19,7 +19,7 @@ dependencies:
|
||||
provider: ^6.1.5
|
||||
flutter_tts: ^4.2.0
|
||||
# basic_intl: 0.2.0
|
||||
basic_intl:
|
||||
t_basic_intl:
|
||||
path: packages/basic_intl
|
||||
# flutter_ingeek_carkey: 1.4.7
|
||||
# app_car:
|
||||
|
||||
Reference in New Issue
Block a user