fnotes/lib/main.dart

32 lines
781 B
Dart
Raw Normal View History

2024-03-17 13:15:50 +00:00
import 'package:flutter/material.dart';
import 'package:fnotes/notes.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
2024-03-17 17:38:57 +00:00
import 'package:fnotes/persistence_bloc.dart';
2024-03-17 13:15:50 +00:00
import 'package:fnotes/theme_bloc.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
2024-03-17 17:38:57 +00:00
return MultiBlocProvider(
providers: [
BlocProvider(create: (context) => ThemeBloc()),
BlocProvider(create: (context) => PersistenceBloc())
],
2024-03-17 13:15:50 +00:00
child: BlocBuilder<ThemeBloc, ThemeState>(
builder: (context, state) {
return MaterialApp(
theme: state.theme,
home: const Notes(),
);
},
),
);
}
}