When trying to use ProxyProvider using the example syntax given in https://pub.dev/packages/provider
Widget build(BuildContext context) {
return MultiProvider(
providers: [
ChangeNotifierProvider(create: (_) => Counter()),
ProxyProvider<Counter, Translations>(
create: (_, counter, __) => Translations(counter.value),
),
],
child: Foo(),
);
}
class Translations {
const Translations(this._value);
final int _value;
String get title => 'You clicked $_value times';
}
I end up having following error in create function every time:
The argument type 'Translation Function(BuildContext, dynamic, dynamic)' can't be assigned to the parameter type 'Translation Function(BuildContext)'.dart(argument_type_not_assignable)
what I am doing wrong?