PIbd31_Teryokhin.A.S._PMU/lib/main.dart
2024-10-29 16:33:19 +03:00

34 lines
973 B
Dart

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:pmu_lab_1/data/repositories/cats_repository.dart';
import 'package:pmu_lab_1/presentation/home_page/bloc/bloc.dart';
import 'package:pmu_lab_1/presentation/home_page/home_page.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: RepositoryProvider<CatsRepository>(
lazy: true,
create: (_) => CatsRepository(),
child: BlocProvider<HomeBloc>(
lazy: false,
create: (context) => HomeBloc(context.read<CatsRepository>()),
child: const MyHomePage(title: 'PIbd31 Teryokhin'),
)
)
);
}
}