вернула апи потера
This commit is contained in:
parent
6129789048
commit
89b3891506
@ -35,15 +35,15 @@ class MyApp extends StatelessWidget {
|
|||||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
),
|
),
|
||||||
home: RepositoryProvider<PokeRepository>(
|
home: RepositoryProvider<PotterRepository>(
|
||||||
lazy: true,
|
lazy: true,
|
||||||
create: (_) => PokeRepository(),
|
create: (_) => PotterRepository(),
|
||||||
child: BlocProvider<LikeBloc>(
|
child: BlocProvider<LikeBloc>(
|
||||||
lazy: false,
|
lazy: false,
|
||||||
create: (context) => LikeBloc(),
|
create: (context) => LikeBloc(),
|
||||||
child: BlocProvider<HomeBloc>(
|
child: BlocProvider<HomeBloc>(
|
||||||
lazy: false,
|
lazy: false,
|
||||||
create: (context) => HomeBloc(context.read<PokeRepository>()),
|
create: (context) => HomeBloc(context.read<PotterRepository>()),
|
||||||
child: const MyHomePage(title: 'Чубыкина Полина Павловна'),
|
child: const MyHomePage(title: 'Чубыкина Полина Павловна'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -6,8 +6,8 @@ import 'package:mobilki_lab1/presentation/home_page/bloc/state.dart';
|
|||||||
import '../../../data/repositories/pokemon_repository.dart';
|
import '../../../data/repositories/pokemon_repository.dart';
|
||||||
|
|
||||||
class HomeBloc extends Bloc<HomeEvent, HomeState> {
|
class HomeBloc extends Bloc<HomeEvent, HomeState> {
|
||||||
// final PotterRepository repo;
|
final PotterRepository repo;
|
||||||
final PokeRepository repo;
|
// final PokeRepository repo;
|
||||||
|
|
||||||
HomeBloc(this.repo) : super(const HomeState()) {
|
HomeBloc(this.repo) : super(const HomeState()) {
|
||||||
on<HomeLoadDataEvent>(_onLoadData);
|
on<HomeLoadDataEvent>(_onLoadData);
|
||||||
|
Loading…
Reference in New Issue
Block a user