Files
flux/lib/main.dart
Mark M2 Macbook c6c61f1a31 Enhance theme management and UI settings
- Updated AppThemeMode enum to include icons and added fromValue method for easier theme retrieval.
- Modified ThemeBloc to manage currentTheme instead of themeMode.
- Enhanced ThemeState to reflect currentTheme and updated copyWith method.
- Added ThemeSettingsView for user-friendly theme selection in settings.
- Improved fluxLightTheme and fluxDarkTheme with new listTileTheme and color settings.
- Updated settings view to navigate to ThemeSettingsView.
- Added entitlements for network client permissions in Debug and Release profiles.
- Introduced Podfile.lock for dependency management.
- Added devtools_options.yaml for Dart & Flutter DevTools configuration.
2026-04-06 08:48:10 +02:00

44 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flux/theme/theme.dart';
import 'package:flux/theme/theme_bloc.dart';
import 'package:flux/ui/home_screen.dart';
import 'package:flux/ui/settings/settings.dart';
import 'package:get_it/get_it.dart';
import 'package:shared_preferences/shared_preferences.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final GetIt getIt = GetIt.instance;
getIt.registerSingleton<SharedPreferences>(
await SharedPreferences.getInstance(),
);
getIt.registerSingleton<AppSettings>(AppSettings());
runApp(
BlocProvider(
create: (context) => ThemeBloc()..add(LoadThemeEvent()),
child: const FluxApp(),
),
);
}
class FluxApp extends StatelessWidget {
const FluxApp({super.key});
@override
Widget build(BuildContext context) {
return BlocBuilder<ThemeBloc, ThemeState>(
builder: (context, state) {
return MaterialApp(
title: 'FLUX Gestionale',
debugShowCheckedModeBanner: false,
theme: fluxLightTheme,
darkTheme: fluxDarkTheme,
themeMode: state.currentTheme.themeMode, // Applica il tema FLUX
home: const HomeScreen(),
);
},
);
}
}