Hey guys, playing with extensions of dart 2.6, I was thinking on a nice one:
extension ProviderExtensions<T> on BuildContext {
T provide<T>() => Provider.of<T>(this);
}
Then you could use it like:
var person = context.provide<Person>();
Would be a nice addition after the extensions functions hit stable :)
What you think?
Hello!
I'd personally wait to see what Flutter does with extensions, to make sure that provider follows the same prototype/naming convention used by the SDK.
The implementation is easy enough that anybody can copy-paste it on their project, and the gain is minimalist anyway.
So that can definitely wait a bit IMO.
cc @felangel
Most helpful comment
Hello!
I'd personally wait to see what Flutter does with extensions, to make sure that
providerfollows the same prototype/naming convention used by the SDK.The implementation is easy enough that anybody can copy-paste it on their project, and the gain is minimalist anyway.
So that can definitely wait a bit IMO.
cc @felangel