From 55825f166e4e4d5e397633a1e61dae42992effd5 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Thu, 20 Apr 2023 13:09:12 -0700 Subject: [PATCH] Remove dynamic calls (#125238) I don't know what I was thinking when I wrote this code back in 2017 but this is so trivially fixable... --- .../lib/src/widgets/overscroll_indicator.dart | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/flutter/lib/src/widgets/overscroll_indicator.dart b/packages/flutter/lib/src/widgets/overscroll_indicator.dart index decfccb758..c2843d267f 100644 --- a/packages/flutter/lib/src/widgets/overscroll_indicator.dart +++ b/packages/flutter/lib/src/widgets/overscroll_indicator.dart @@ -261,14 +261,10 @@ class _GlowingOverscrollIndicatorState extends State } } } - } else if (notification is ScrollEndNotification || notification is ScrollUpdateNotification) { - // Using dynamic here to avoid layer violations of importing - // drag_details.dart from gestures. - // ignore: avoid_dynamic_calls - if ((notification as dynamic).dragDetails != null) { - _leadingController!.scrollEnd(); - _trailingController!.scrollEnd(); - } + } else if ((notification is ScrollEndNotification && notification.dragDetails != null) || + (notification is ScrollUpdateNotification && notification.dragDetails != null)) { + _leadingController!.scrollEnd(); + _trailingController!.scrollEnd(); } _lastNotificationType = notification.runtimeType; return false;