2024-09-24 00:30:31 +04:00
|
|
|
|
import 'package:flutter/material.dart';
|
2024-10-18 20:52:48 +04:00
|
|
|
|
import 'package:labs_petrushin/Presentation/home_page/bloc/bloc.dart';
|
|
|
|
|
import 'package:labs_petrushin/repositories/food_repository.dart';
|
2024-09-24 00:30:31 +04:00
|
|
|
|
import 'home_page/home_page.dart';
|
2024-10-18 20:52:48 +04:00
|
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
2024-09-24 00:30:31 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
|
runApp(const MyApp());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
|
const MyApp({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return MaterialApp(
|
|
|
|
|
title: 'Petrushin demo',
|
|
|
|
|
theme: ThemeData(
|
|
|
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.red),
|
|
|
|
|
useMaterial3: true,
|
|
|
|
|
),
|
2024-10-18 20:52:48 +04:00
|
|
|
|
home: RepositoryProvider<FoodRepository>(
|
|
|
|
|
lazy: true,
|
|
|
|
|
create: (_) => FoodRepository(),
|
|
|
|
|
child: BlocProvider<HomeBloc>(
|
|
|
|
|
lazy: false,
|
|
|
|
|
create: (context) => HomeBloc(context.read<FoodRepository>()),
|
|
|
|
|
child: const MyHomePage(title: 'Петрушин Егор Александрович',),
|
|
|
|
|
)
|
|
|
|
|
)
|
2024-09-24 00:30:31 +04:00
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|