PIbd-31_MasenkinMS_PMU/lib/main.dart

35 lines
1013 B
Dart
Raw Permalink Normal View History

2024-09-10 01:32:13 +04:00
import 'package:flutter/material.dart';
2024-09-30 22:15:55 +04:00
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:pmu_labworks/data/repositories/potterdb_repository.dart';
import 'package:pmu_labworks/view/home_page/bloc/bloc.dart';
2024-09-30 02:09:26 +04:00
import 'package:pmu_labworks/view/home_page/home_page.dart';
2024-09-10 01:32:13 +04:00
void main() {
2024-09-13 00:51:36 +04:00
runApp(const MyApp());
2024-09-10 01:32:13 +04:00
}
class MyApp extends StatelessWidget {
2024-09-13 00:51:36 +04:00
const MyApp({super.key});
2024-09-10 01:32:13 +04:00
@override
Widget build(BuildContext context) {
return MaterialApp(
2024-09-13 00:51:36 +04:00
title: 'Comments App',
2024-09-10 02:00:11 +04:00
debugShowCheckedModeBanner: false,
2024-09-10 01:32:13 +04:00
theme: ThemeData(
2024-09-13 00:51:36 +04:00
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
useMaterial3: true,
),
2024-09-30 22:15:55 +04:00
home: RepositoryProvider<PotterDBRepository>(
lazy: true,
create: (_) => PotterDBRepository(),
child: BlocProvider<HomeBloc>(
lazy: false,
create: (context) => HomeBloc(context.read<PotterDBRepository>()),
child: const HomePage(title: 'Comments App'),
),
),
2024-09-10 01:32:13 +04:00
);
}
}