import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'app.dart';
import 'core/navigation/host_app_channel.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // 从宿主 App 获取 baseUrl / sn / LoginId
  await HostAppChannel.initialize();

  // 立即设置状态栏样式，覆盖 Android 原生残留颜色
  SystemChrome.setSystemUIOverlayStyle(
    const SystemUiOverlayStyle(
      statusBarColor: Colors.transparent,
      statusBarIconBrightness: Brightness.dark,
      statusBarBrightness: Brightness.light,
    ),
  );

  runApp(const ProviderScope(child: App()));
}
