2024-09-09 20:19:01 +04:00
|
|
|
import 'package:flutter/material.dart';
|
2024-10-06 00:37:40 +04:00
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
2024-10-06 04:19:08 +04:00
|
|
|
import 'package:flutter_project/components/locale/l10n/app_localizations.dart';
|
2024-10-06 00:37:40 +04:00
|
|
|
import 'package:flutter_project/data/repositories/anime_repository.dart';
|
|
|
|
import 'package:flutter_project/views/home_page/bloc/bloc.dart';
|
2024-10-04 20:36:43 +04:00
|
|
|
import 'package:flutter_project/views/home_page/home_page.dart';
|
2024-09-09 20:19:01 +04:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
runApp(const MyApp());
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
const MyApp({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2024-10-06 00:37:40 +04:00
|
|
|
return RepositoryProvider<AnimeRepository>(
|
|
|
|
lazy: true,
|
|
|
|
create: (_) => AnimeRepository(),
|
|
|
|
child: BlocProvider<HomeBloc>(
|
|
|
|
lazy: false,
|
|
|
|
create: (context) => HomeBloc(context.read<AnimeRepository>()),
|
|
|
|
child: MaterialApp(
|
|
|
|
title: 'Flutter Demo',
|
2024-10-06 04:19:08 +04:00
|
|
|
localizationsDelegates: AppLocale.localizationsDelegates,
|
|
|
|
supportedLocales: AppLocale.supportedLocales,
|
2024-10-06 00:37:40 +04:00
|
|
|
theme: ThemeData(
|
|
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.lightGreen),
|
|
|
|
useMaterial3: true,
|
|
|
|
),
|
|
|
|
home: const HomePage(),
|
|
|
|
),
|
2024-09-09 20:19:01 +04:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|