Skip to content

Commit

Permalink
Ignore depreciations notices
Browse files Browse the repository at this point in the history
  • Loading branch information
rrousselGit committed Oct 22, 2024
1 parent e38b9d3 commit 1944682
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ abstract class RefInvocation extends RiverpodAst
final functionOwner = function.staticElement
.cast<MethodElement>()
?.declaration
// ignore: deprecated_member_use, necessary to support older versions of analyzer
.enclosingElement;

if (functionOwner == null ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ abstract class WidgetRefInvocation extends RiverpodAst
final functionOwner = function.staticElement
.cast<MethodElement>()
?.declaration
// ignore: deprecated_member_use, necessary to support older versions of analyzer
.enclosingElement;

if (functionOwner == null ||
Expand Down
5 changes: 4 additions & 1 deletion packages/riverpod_graph/lib/src/analyze.dart
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,10 @@ class _ProviderName {
/// Returns the name of the provider.
_ProviderName _displayNameForProvider(VariableElement provider) {
final providerName = provider.name;
final enclosingElementName = provider.enclosingElement?.displayName;
final enclosingElementName = provider
// ignore: deprecated_member_use, necessary to support older versions of analyzer
.enclosingElement
?.displayName;
return _ProviderName(
providerName: providerName,
enclosingElementName: enclosingElementName ?? '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ class _ReplacementEditBuilder extends RecursiveAstVisitor<void> {
}
final element = node.staticElement;
if (element is ExecutableElement &&
element.enclosingElement == widgetClassElement &&
element
// ignore: deprecated_member_use, necessary to support older versions of analyzer
.enclosingElement ==
widgetClassElement &&
!elementsToMove.contains(element)) {
final offset = node.offset;
final qualifier =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,10 @@ class _ReplacementEditBuilder extends RecursiveAstVisitor<void> {
}
final element = node.staticElement;
if (element is ExecutableElement &&
element.enclosingElement == widgetClassElement &&
element
// ignore: deprecated_member_use, necessary to support older versions of analyzer
.enclosingElement ==
widgetClassElement &&
!elementsToMove.contains(element)) {
final parent = node.parent;
if (parent is PrefixedIdentifier) {
Expand Down
10 changes: 7 additions & 3 deletions packages/riverpod_lint/lib/src/lints/provider_parameters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ class ProviderParameters extends RiverpodLintRule {
final instantiatedObject = value.constructorName.staticElement
?.applyRedirectedConstructors();

final operatorEqual =
instantiatedObject?.enclosingElement.recursiveGetMethod('==');
final operatorEqual = instantiatedObject
// ignore: deprecated_member_use, necessary to support older versions of analyzer
?.enclosingElement
.recursiveGetMethod('==');

final isEqualFromObjectMethod = operatorEqual?.enclosingElement
final isEqualFromObjectMethod = operatorEqual
// ignore: deprecated_member_use, necessary to support older versions of analyzer
?.enclosingElement
.safeCast<ClassElement>()
?.thisType
.isDartCoreObject;
Expand Down

0 comments on commit 1944682

Please sign in to comment.