0

I updated Provider package. Now it's not wroking.

 ProxyProvider<CategoriesRepository, CategoryBloc>(
              update: (context, categoryRepo, categoryBloc) =>//builder:
                  CategoryBloc(categoryRepository: categoryRepo),
              dispose: (context, categoryBloc) => categoryBloc.dispose(),
            ).didChangeDependencies(context, categoryBloc).deleteEntry();

Full Error

lib/screens/home/widgets/drawer.dart:297:15: Error: The method 'didChangeDependencies' isn't defined for the class 'ProxyProvider'. - 'ProxyProvider' is from 'package:provider/src/proxy_provider.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/provider-4.0.0/lib/src/proxy_provider.dart'). - 'CategoriesRepository' is from 'package:yellochat/repository/category_repository.dart' ('lib/repository/category_repository.dart'). - 'CategoryBloc' is from 'package:yellochat/screens/categories/category_bloc.dart' ('lib/screens/categories/category_bloc.dart'). Try correcting the name to the name of an existing method, or defining a method named 'didChangeDependencies'. ).didChangeDependencies(context, categoryBloc).deleteEntry();

BIS Tech
  • 17,000
  • 12
  • 99
  • 148

1 Answers1

0

Doing that was never supported and is anti pattern.

Just call your method directly inside update

BIS Tech
  • 17,000
  • 12
  • 99
  • 148