From f6506526d122170acf015d34795931d3272f9673 Mon Sep 17 00:00:00 2001 From: Luke <61923182+lukee1234@users.noreply.github.com> Date: Wed, 24 Feb 2021 23:03:34 +0100 Subject: [PATCH] Update resolver.dart Deprecated warning, please fix this, maybe test the correction a bit more. It will also increase your pub.dev package score. --- lib/src/resolver.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/resolver.dart b/lib/src/resolver.dart index c5557f9..adc0660 100644 --- a/lib/src/resolver.dart +++ b/lib/src/resolver.dart @@ -55,7 +55,10 @@ class Resolver extends StatefulWidget { static T of(BuildContext context) { final type = typeOf<_ResolverInherited>(); _ResolverInherited resolver = - context.ancestorInheritedElementForWidgetOfExactType(type)?.widget; + context.getElementForInheritedWidgetOfExactType(type)?.widget; +// context.ancestorInheritedElementForWidgetOfExactType(type)?.widget; +// INFO: 'ancestorInheritedElementForWidgetOfExactType' is deprecated and shouldn't be used. +// Use getElementForInheritedWidgetOfExactType instead. This feature was deprecated after v1.12.1. assert(resolver != null, "no Resolver<$type> found in the widget tree"); return resolver.instance; }