2025-08-12 13:36:42 +08:00
|
|
|
import 'package:ai_chat_assistant/themes/AppTheme.dart';
|
2025-06-18 11:28:37 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2025-08-12 13:36:42 +08:00
|
|
|
import 'services/command_service.dart';
|
|
|
|
|
import 'screens/main_screen.dart';
|
2025-06-18 11:28:37 +08:00
|
|
|
|
2025-08-12 13:36:42 +08:00
|
|
|
class ChatAssistantApp extends StatelessWidget {
|
|
|
|
|
const ChatAssistantApp({super.key});
|
|
|
|
|
|
|
|
|
|
/// 初始化聊天助手
|
|
|
|
|
///
|
|
|
|
|
/// [commandCallback] 接收来自AI的车控命令并执行
|
|
|
|
|
static void initialize({required CommandCallback commandCallback}) {
|
|
|
|
|
CommandService.registerCallback(commandCallback);
|
|
|
|
|
}
|
2025-06-18 11:28:37 +08:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return MaterialApp(
|
2025-08-12 13:36:42 +08:00
|
|
|
title: 'ai_chat_assistant',
|
2025-06-18 11:28:37 +08:00
|
|
|
theme: AppTheme.lightTheme,
|
|
|
|
|
darkTheme: AppTheme.darkTheme,
|
|
|
|
|
themeMode: ThemeMode.system,
|
2025-08-12 13:36:42 +08:00
|
|
|
home: const MainScreen(),
|
2025-06-18 11:28:37 +08:00
|
|
|
);
|
|
|
|
|
}
|
2025-08-12 13:36:42 +08:00
|
|
|
}
|