32 lines
781 B
Dart
32 lines
781 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:fnotes/notes.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:fnotes/persistence_bloc.dart';
|
|
import 'package:fnotes/theme_bloc.dart';
|
|
|
|
void main() {
|
|
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<ThemeBloc, ThemeState>(
|
|
builder: (context, state) {
|
|
return MaterialApp(
|
|
theme: state.theme,
|
|
home: const Notes(),
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|