import 'package:flutter/cupertino.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:webrtc_controller_flutter/l10n/app_localizations.dart';

import 'router/app_router.dart';
import 'theme/app_theme.dart';

/// 应用根组件：CupertinoApp + GoRouter。
class WebrtcControllerApp extends StatelessWidget {
  const WebrtcControllerApp({super.key});

  @override
  Widget build(BuildContext context) {
    return CupertinoApp.router(
      title: 'WebRTC 控制端',
      theme: AppTheme.light,
      localizationsDelegates: const [
        AppLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],
      supportedLocales: const [
        Locale('zh'),
        Locale('en'),
      ],
      routerConfig: appRouter,
    );
  }
}
