basic_intl 修改为 t_basic_intl
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user