Why I can't use any extension methods of Provider (context.select, context.read and context.listen)?
I get a static error like this.
The method 'select' isn't defined for the type 'BuildContext'.Try correcting the name to the name of an existing method, or defining a method named 'select'..
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
// Following line causes the problem
var isFavorite = context.select<FavModel, bool>(
(fav) => fav.items.contains(item),
);
return OtherWidget(...);
}
}