import 'package:ai_chat_assistant/themes/AppTheme.dart';
import 'package:flutter/material.dart';
import 'services/command_service.dart';
import 'screens/main_screen.dart';

class ChatAssistantApp extends StatelessWidget {
  const ChatAssistantApp({super.key});

  /// 初始化聊天助手
  /// 
  /// [commandCallback] 接收来自AI的车控命令并执行
  static void initialize({required CommandCallback commandCallback}) {
    CommandService.registerCallback(commandCallback);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'ai_chat_assistant',
      theme: AppTheme.lightTheme,
      darkTheme: AppTheme.darkTheme,
      themeMode: ThemeMode.system,
      home: const MainScreen(),
    );
  }
}
