import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
// import 'package:logging/logging.dart';
import 'screens/main_screen.dart';
import 'services/log_service.dart';
import 'services/config_service.dart';
import 'providers/client_provider.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  
  // 初始化日志系统
  final logService = LogService();
  await logService.initialize();
  
  runApp(const CloudClientApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (_) => ClientProvider()),
        Provider(create: (_) => LogService()),
        Provider(create: (_) => ConfigService()),
      ],
      child: MaterialApp(
        title: '云算力平台客户端',
        theme: ThemeData(
          primarySwatch: Colors.blue,
          useMaterial3: true,
        ),
        home: const MainScreen(),
        debugShowCheckedModeBanner: false,
      ),
    );
  }
}
