Refactor buildOverscrollIndicator (#123246)

This commit is contained in:
Michael Goderbauer 2023-03-23 12:34:42 -07:00 committed by GitHub
parent 7f41ab25c9
commit fccca49373
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 15 deletions

View file

@ -865,14 +865,11 @@ class MaterialScrollBehavior extends ScrollBehavior {
child: child,
);
case AndroidOverscrollIndicator.glow:
return _buildGlowingOverscrollIndicator(context, details, child);
break;
}
case TargetPlatform.fuchsia:
return _buildGlowingOverscrollIndicator(context, details, child);
break;
}
}
GlowingOverscrollIndicator _buildGlowingOverscrollIndicator(BuildContext context, ScrollableDetails details, Widget child) {
return GlowingOverscrollIndicator(
axisDirection: details.direction,
color: Theme.of(context).colorScheme.secondary,

View file

@ -194,14 +194,11 @@ class ScrollBehavior {
child: child,
);
case AndroidOverscrollIndicator.glow:
return _buildGlowingOverscrollIndicator(details, child);
break;
}
case TargetPlatform.fuchsia:
return _buildGlowingOverscrollIndicator(details, child);
break;
}
}
GlowingOverscrollIndicator _buildGlowingOverscrollIndicator(ScrollableDetails details, Widget child) {
return GlowingOverscrollIndicator(
axisDirection: details.direction,
color: _kDefaultGlowColor,
@ -382,11 +379,6 @@ class _WrappedScrollBehavior implements ScrollBehavior {
@override
String toString() => objectRuntimeType(this, '_WrappedScrollBehavior');
@override
GlowingOverscrollIndicator _buildGlowingOverscrollIndicator(ScrollableDetails details, Widget child) {
return delegate._buildGlowingOverscrollIndicator(details, child);
}
}
/// Controls how [Scrollable] widgets behave in a subtree.