8f3966d7b5
Co-Authored-By: Claude Code <noreply@anthropic.com>
23 lines
679 B
Dart
23 lines
679 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import 'app/app.dart';
|
|
import 'app/locale_controller.dart';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
// 启动先读语言偏好再 runApp:首帧即正确语言(无「system 闪变」,
|
|
// P3 Task 10)。读取失败由 readPersisted 内部兜底为 system。
|
|
final localeChoice = await LocaleSettings.readPersisted();
|
|
runApp(
|
|
ProviderScope(
|
|
overrides: [
|
|
localeSettingsProvider.overrideWith(
|
|
() => LocaleSettings(initial: localeChoice),
|
|
),
|
|
],
|
|
child: const PhotoLiveApp(),
|
|
),
|
|
);
|
|
}
|