mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08: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…
x
Reference in New Issue
Block a user