import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'bootstrap.dart'; import 'i18n/strings.g.dart'; import 'ui/restart_widget.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); // Draw behind the system bars (edge-to-edge) with transparent bars, so the app // fills the screen on Android 15+ (where edge-to-edge is enforced) and stays // consistent elsewhere. Scaffolds use SafeArea to keep content off the insets. SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); SystemChrome.setSystemUIOverlayStyle( const SystemUiOverlayStyle( statusBarColor: Color(0x00000000), systemNavigationBarColor: Color(0x00000000), ), ); // Start from the device language, then let an explicit in-app choice win — // it's the only reliable way to reach languages the OS picker doesn't offer // (e.g. Asturian). The saved choice is restored inside [Bootstrap], after DI. LocaleSettings.useDeviceLocaleSync(); // Paint immediately: [Bootstrap] shows a splash and runs the heavy init off // the first frame. Wrapped in [RestartWidget] so switching the social identity // (which re-registers the social singletons) can rebuild the whole tree — // Bootstrap re-reads its dependencies from the locator on each rebuild. runApp( RestartWidget( builder: () => TranslationProvider(child: const Bootstrap()), ), ); }