mirror of
https://github.com/flutter/flutter
synced 2024-08-27 12:00:58 +00:00
Refactor buildOverscrollIndicator (#123246)
This commit is contained in:
parent
7f41ab25c9
commit
fccca49373
|
@ -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,
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue