import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:fnotes/notes_app.dart'; import 'package:fnotes/persistence_bloc.dart'; import 'package:fnotes/theme_bloc.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); //for drift runApp(const MainApp()); } class MainApp extends StatelessWidget { const MainApp({super.key}); @override Widget build(BuildContext context) { return MultiBlocProvider( providers: [ BlocProvider(create: (context) => ThemeBloc()), BlocProvider(create: (context) => PersistenceBloc()) ], child: BlocBuilder( builder: (context, state) { return MaterialApp( theme: state.theme, home: const NotesApp(), ); }, ), ); } }