consume<T> function
Implementation
T? consume<T>(BuildContext context, [void exec(T value)?]) {
try {
final t = Provider.of<T>(context, listen: false);
exec?.call(t);
return t;
} on ProviderNotFoundException {
return null;
}
}