import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'core/config/env.dart'; import 'core/region/region_repository.dart'; import 'l10n/app_localizations.dart'; void main() { runApp(const ProviderScope(child: NuvolariApp())); } class NuvolariApp extends StatelessWidget { const NuvolariApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( onGenerateTitle: (context) => AppLocalizations.of(context).appTitle, localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF1F6FB2)), ), home: const HomeScreen(), ); } } /// Placeholder shell for milestone 1. /// /// It exists to prove the pieces are wired: localisation resolves, the region /// config parses out of the asset bundle, and demo mode is visible. The radar /// map replaces it in milestone 2. class HomeScreen extends ConsumerWidget { const HomeScreen({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { final l10n = AppLocalizations.of(context); final region = ref.watch(regionConfigProvider); return Scaffold( appBar: AppBar(title: Text(l10n.appTitle)), body: Column( children: [ if (Env.isDemoMode) MaterialBanner( content: Text(l10n.demoModeBanner), actions: const [SizedBox.shrink()], ), Expanded( child: Center( child: switch (region) { AsyncData(:final value) => Text( value.displayName, style: Theme.of(context).textTheme.headlineMedium, ), AsyncError(:final error) => Padding( padding: const EdgeInsets.all(24), child: Text('${l10n.dataUnavailable}\n$error'), ), _ => Text(l10n.loading), }, ), ), ], ), ); } }