Mobile/lib/main.dart
2024-11-18 15:35:22 +04:00

34 lines
988 B
Dart

import 'package:first_project/data/repositories/anime_repository.dart';
import 'package:first_project/presentation/home_page/bloc/bloc.dart';
import 'package:first_project/presentation/home_page/home_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.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<AnimeRepository>(
lazy: true,
create: (_) => AnimeRepository(),
child: BlocProvider<HomeBloc>(
lazy: false,
create: (context) => HomeBloc(context.read<AnimeRepository>()),
child: const MyHomePage(title: 'Anime Nya >-<'),
),
),
);
}
}