Unverified Commit 5bc93402 authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Put stretch indicator behind m3 flag (#100234)

parent e6bd2081
...@@ -730,7 +730,10 @@ class MaterialApp extends StatefulWidget { ...@@ -730,7 +730,10 @@ class MaterialApp extends StatefulWidget {
/// [MaterialScrollBehavior.androidOverscrollIndicator] specifies the /// [MaterialScrollBehavior.androidOverscrollIndicator] specifies the
/// overscroll indicator that is used on [TargetPlatform.android]. When null, /// overscroll indicator that is used on [TargetPlatform.android]. When null,
/// [ThemeData.androidOverscrollIndicator] is used. If also null, the default /// [ThemeData.androidOverscrollIndicator] is used. If also null, the default
/// overscroll indicator is the [GlowingOverscrollIndicator]. /// overscroll indicator is the [GlowingOverscrollIndicator]. These properties
/// are deprecated. In order to use the [StretchingOverscrollIndicator], use
/// the [ThemeData.useMaterial3] flag, or override
/// [ScrollBehavior.buildOverscrollIndicator].
/// ///
/// See also: /// See also:
/// ///
...@@ -745,6 +748,10 @@ class MaterialScrollBehavior extends ScrollBehavior { ...@@ -745,6 +748,10 @@ class MaterialScrollBehavior extends ScrollBehavior {
/// [ThemeData.androidOverscrollIndicator] is used. If also null, the default /// [ThemeData.androidOverscrollIndicator] is used. If also null, the default
/// overscroll indicator is the [GlowingOverscrollIndicator]. /// overscroll indicator is the [GlowingOverscrollIndicator].
const MaterialScrollBehavior({ const MaterialScrollBehavior({
@Deprecated(
'Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. '
'This feature was deprecated after v2.13.0-0.0.pre.'
)
AndroidOverscrollIndicator? androidOverscrollIndicator, AndroidOverscrollIndicator? androidOverscrollIndicator,
}) : _androidOverscrollIndicator = androidOverscrollIndicator, }) : _androidOverscrollIndicator = androidOverscrollIndicator,
super(androidOverscrollIndicator: androidOverscrollIndicator); super(androidOverscrollIndicator: androidOverscrollIndicator);
...@@ -782,9 +789,14 @@ class MaterialScrollBehavior extends ScrollBehavior { ...@@ -782,9 +789,14 @@ class MaterialScrollBehavior extends ScrollBehavior {
Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) { Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) {
// When modifying this function, consider modifying the implementation in // When modifying this function, consider modifying the implementation in
// the base class as well. // the base class as well.
final AndroidOverscrollIndicator indicator = _androidOverscrollIndicator late final AndroidOverscrollIndicator indicator;
if (Theme.of(context).useMaterial3) {
indicator = AndroidOverscrollIndicator.stretch;
} else {
indicator = _androidOverscrollIndicator
?? Theme.of(context).androidOverscrollIndicator ?? Theme.of(context).androidOverscrollIndicator
?? androidOverscrollIndicator; ?? androidOverscrollIndicator;
}
switch (getPlatform(context)) { switch (getPlatform(context)) {
case TargetPlatform.iOS: case TargetPlatform.iOS:
case TargetPlatform.linux: case TargetPlatform.linux:
......
...@@ -270,7 +270,6 @@ class ThemeData with Diagnosticable { ...@@ -270,7 +270,6 @@ class ThemeData with Diagnosticable {
/// * [ColorScheme.fromSeed], which is used to create a [ColorScheme] from a seed color. /// * [ColorScheme.fromSeed], which is used to create a [ColorScheme] from a seed color.
factory ThemeData({ factory ThemeData({
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
AndroidOverscrollIndicator? androidOverscrollIndicator,
bool? applyElevationOverlayColor, bool? applyElevationOverlayColor,
NoDefaultCupertinoThemeData? cupertinoOverrideTheme, NoDefaultCupertinoThemeData? cupertinoOverrideTheme,
Iterable<ThemeExtension<dynamic>>? extensions, Iterable<ThemeExtension<dynamic>>? extensions,
...@@ -418,6 +417,11 @@ class ThemeData with Diagnosticable { ...@@ -418,6 +417,11 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v2.6.0-11.0.pre.', 'This feature was deprecated after v2.6.0-11.0.pre.',
) )
Brightness? primaryColorBrightness, Brightness? primaryColorBrightness,
@Deprecated(
'Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. '
'This feature was deprecated after v2.13.0-0.0.pre.'
)
AndroidOverscrollIndicator? androidOverscrollIndicator,
}) { }) {
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault(); cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
...@@ -591,7 +595,6 @@ class ThemeData with Diagnosticable { ...@@ -591,7 +595,6 @@ class ThemeData with Diagnosticable {
return ThemeData.raw( return ThemeData.raw(
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
androidOverscrollIndicator: androidOverscrollIndicator,
applyElevationOverlayColor: applyElevationOverlayColor, applyElevationOverlayColor: applyElevationOverlayColor,
cupertinoOverrideTheme: cupertinoOverrideTheme, cupertinoOverrideTheme: cupertinoOverrideTheme,
extensions: _themeExtensionIterableToMap(extensions), extensions: _themeExtensionIterableToMap(extensions),
...@@ -680,6 +683,7 @@ class ThemeData with Diagnosticable { ...@@ -680,6 +683,7 @@ class ThemeData with Diagnosticable {
buttonColor: buttonColor, buttonColor: buttonColor,
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel, fixTextFieldOutlineLabel: fixTextFieldOutlineLabel,
primaryColorBrightness: primaryColorBrightness, primaryColorBrightness: primaryColorBrightness,
androidOverscrollIndicator: androidOverscrollIndicator,
); );
} }
...@@ -695,7 +699,6 @@ class ThemeData with Diagnosticable { ...@@ -695,7 +699,6 @@ class ThemeData with Diagnosticable {
// operator == and in the Object.hash method and in the order of fields // operator == and in the Object.hash method and in the order of fields
// in this class, and in the lerp() method. // in this class, and in the lerp() method.
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
required this.androidOverscrollIndicator,
required this.applyElevationOverlayColor, required this.applyElevationOverlayColor,
required this.cupertinoOverrideTheme, required this.cupertinoOverrideTheme,
required this.extensions, required this.extensions,
...@@ -839,6 +842,11 @@ class ThemeData with Diagnosticable { ...@@ -839,6 +842,11 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v2.6.0-11.0.pre.', 'This feature was deprecated after v2.6.0-11.0.pre.',
) )
required this.primaryColorBrightness, required this.primaryColorBrightness,
@Deprecated(
'Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. '
'This feature was deprecated after v2.13.0-0.0.pre.'
)
required this.androidOverscrollIndicator,
}) : // GENERAL CONFIGURATION }) : // GENERAL CONFIGURATION
assert(applyElevationOverlayColor != null), assert(applyElevationOverlayColor != null),
assert(extensions != null), assert(extensions != null),
...@@ -1031,12 +1039,19 @@ class ThemeData with Diagnosticable { ...@@ -1031,12 +1039,19 @@ class ThemeData with Diagnosticable {
/// [MaterialScrollBehavior.androidOverscrollIndicator] is /// [MaterialScrollBehavior.androidOverscrollIndicator] is
/// [AndroidOverscrollIndicator.glow]. /// [AndroidOverscrollIndicator.glow].
/// ///
/// This property is deprecated. Use the [useMaterial3] flag instead, or
/// override [ScrollBehavior.buildOverscrollIndicator].
///
/// See also: /// See also:
/// ///
/// * [StretchingOverscrollIndicator], a material design edge effect /// * [StretchingOverscrollIndicator], a material design edge effect
/// that transforms the contents of a scrollable when overscrolled. /// that transforms the contents of a scrollable when overscrolled.
/// * [GlowingOverscrollIndicator], an edge effect that paints a glow /// * [GlowingOverscrollIndicator], an edge effect that paints a glow
/// over the contents of a scrollable when overscrolled. /// over the contents of a scrollable when overscrolled.
@Deprecated(
'Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. '
'This feature was deprecated after v2.13.0-0.0.pre.'
)
final AndroidOverscrollIndicator? androidOverscrollIndicator; final AndroidOverscrollIndicator? androidOverscrollIndicator;
/// Apply a semi-transparent overlay color on Material surfaces to indicate /// Apply a semi-transparent overlay color on Material surfaces to indicate
...@@ -1239,6 +1254,8 @@ class ThemeData with Diagnosticable { ...@@ -1239,6 +1254,8 @@ class ThemeData with Diagnosticable {
/// * [Material] /// * [Material]
/// * [NavigationBar] /// * [NavigationBar]
/// * [NavigationRail] /// * [NavigationRail]
/// * [StretchingOverscrollIndicator], replacing the
/// [GlowingOverscrollIndicator]
/// ///
/// See also: /// See also:
/// ///
...@@ -1646,7 +1663,6 @@ class ThemeData with Diagnosticable { ...@@ -1646,7 +1663,6 @@ class ThemeData with Diagnosticable {
/// The [brightness] value is applied to the [colorScheme]. /// The [brightness] value is applied to the [colorScheme].
ThemeData copyWith({ ThemeData copyWith({
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
AndroidOverscrollIndicator? androidOverscrollIndicator,
bool? applyElevationOverlayColor, bool? applyElevationOverlayColor,
NoDefaultCupertinoThemeData? cupertinoOverrideTheme, NoDefaultCupertinoThemeData? cupertinoOverrideTheme,
Iterable<ThemeExtension<dynamic>>? extensions, Iterable<ThemeExtension<dynamic>>? extensions,
...@@ -1791,11 +1807,15 @@ class ThemeData with Diagnosticable { ...@@ -1791,11 +1807,15 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v2.6.0-11.0.pre.', 'This feature was deprecated after v2.6.0-11.0.pre.',
) )
Brightness? primaryColorBrightness, Brightness? primaryColorBrightness,
@Deprecated(
'Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. '
'This feature was deprecated after v2.13.0-0.0.pre.'
)
AndroidOverscrollIndicator? androidOverscrollIndicator,
}) { }) {
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault(); cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
return ThemeData.raw( return ThemeData.raw(
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
androidOverscrollIndicator: androidOverscrollIndicator ?? this.androidOverscrollIndicator,
applyElevationOverlayColor: applyElevationOverlayColor ?? this.applyElevationOverlayColor, applyElevationOverlayColor: applyElevationOverlayColor ?? this.applyElevationOverlayColor,
cupertinoOverrideTheme: cupertinoOverrideTheme ?? this.cupertinoOverrideTheme, cupertinoOverrideTheme: cupertinoOverrideTheme ?? this.cupertinoOverrideTheme,
extensions: (extensions != null) ? _themeExtensionIterableToMap(extensions) : this.extensions, extensions: (extensions != null) ? _themeExtensionIterableToMap(extensions) : this.extensions,
...@@ -1884,6 +1904,7 @@ class ThemeData with Diagnosticable { ...@@ -1884,6 +1904,7 @@ class ThemeData with Diagnosticable {
buttonColor: buttonColor ?? this.buttonColor, buttonColor: buttonColor ?? this.buttonColor,
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel ?? this.fixTextFieldOutlineLabel, fixTextFieldOutlineLabel: fixTextFieldOutlineLabel ?? this.fixTextFieldOutlineLabel,
primaryColorBrightness: primaryColorBrightness ?? this.primaryColorBrightness, primaryColorBrightness: primaryColorBrightness ?? this.primaryColorBrightness,
androidOverscrollIndicator: androidOverscrollIndicator ?? this.androidOverscrollIndicator,
); );
} }
...@@ -1994,7 +2015,6 @@ class ThemeData with Diagnosticable { ...@@ -1994,7 +2015,6 @@ class ThemeData with Diagnosticable {
// the class and in the lerp() method. // the class and in the lerp() method.
return ThemeData.raw( return ThemeData.raw(
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
androidOverscrollIndicator:t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator,
applyElevationOverlayColor:t < 0.5 ? a.applyElevationOverlayColor : b.applyElevationOverlayColor, applyElevationOverlayColor:t < 0.5 ? a.applyElevationOverlayColor : b.applyElevationOverlayColor,
cupertinoOverrideTheme:t < 0.5 ? a.cupertinoOverrideTheme : b.cupertinoOverrideTheme, cupertinoOverrideTheme:t < 0.5 ? a.cupertinoOverrideTheme : b.cupertinoOverrideTheme,
extensions: _lerpThemeExtensions(a, b, t), extensions: _lerpThemeExtensions(a, b, t),
...@@ -2083,6 +2103,7 @@ class ThemeData with Diagnosticable { ...@@ -2083,6 +2103,7 @@ class ThemeData with Diagnosticable {
buttonColor: Color.lerp(a.buttonColor, b.buttonColor, t)!, buttonColor: Color.lerp(a.buttonColor, b.buttonColor, t)!,
fixTextFieldOutlineLabel: t < 0.5 ? a.fixTextFieldOutlineLabel : b.fixTextFieldOutlineLabel, fixTextFieldOutlineLabel: t < 0.5 ? a.fixTextFieldOutlineLabel : b.fixTextFieldOutlineLabel,
primaryColorBrightness: t < 0.5 ? a.primaryColorBrightness : b.primaryColorBrightness, primaryColorBrightness: t < 0.5 ? a.primaryColorBrightness : b.primaryColorBrightness,
androidOverscrollIndicator:t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator,
); );
} }
...@@ -2095,7 +2116,6 @@ class ThemeData with Diagnosticable { ...@@ -2095,7 +2116,6 @@ class ThemeData with Diagnosticable {
// the class and in the lerp() method. // the class and in the lerp() method.
return other is ThemeData && return other is ThemeData &&
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
other.androidOverscrollIndicator == androidOverscrollIndicator &&
other.applyElevationOverlayColor == applyElevationOverlayColor && other.applyElevationOverlayColor == applyElevationOverlayColor &&
other.cupertinoOverrideTheme == cupertinoOverrideTheme && other.cupertinoOverrideTheme == cupertinoOverrideTheme &&
mapEquals(other.extensions, extensions) && mapEquals(other.extensions, extensions) &&
...@@ -2183,7 +2203,8 @@ class ThemeData with Diagnosticable { ...@@ -2183,7 +2203,8 @@ class ThemeData with Diagnosticable {
other.accentIconTheme == accentIconTheme && other.accentIconTheme == accentIconTheme &&
other.buttonColor == buttonColor && other.buttonColor == buttonColor &&
other.fixTextFieldOutlineLabel == fixTextFieldOutlineLabel && other.fixTextFieldOutlineLabel == fixTextFieldOutlineLabel &&
other.primaryColorBrightness == primaryColorBrightness; other.primaryColorBrightness == primaryColorBrightness &&
other.androidOverscrollIndicator == androidOverscrollIndicator;
} }
@override @override
...@@ -2193,7 +2214,6 @@ class ThemeData with Diagnosticable { ...@@ -2193,7 +2214,6 @@ class ThemeData with Diagnosticable {
// and in the order of fields in the class and in the lerp() method. // and in the order of fields in the class and in the lerp() method.
final List<Object?> values = <Object?>[ final List<Object?> values = <Object?>[
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
androidOverscrollIndicator,
applyElevationOverlayColor, applyElevationOverlayColor,
cupertinoOverrideTheme, cupertinoOverrideTheme,
hashList(extensions.keys), hashList(extensions.keys),
...@@ -2283,6 +2303,7 @@ class ThemeData with Diagnosticable { ...@@ -2283,6 +2303,7 @@ class ThemeData with Diagnosticable {
buttonColor, buttonColor,
fixTextFieldOutlineLabel, fixTextFieldOutlineLabel,
primaryColorBrightness, primaryColorBrightness,
androidOverscrollIndicator,
]; ];
return Object.hashAll(values); return Object.hashAll(values);
} }
...@@ -2292,7 +2313,6 @@ class ThemeData with Diagnosticable { ...@@ -2292,7 +2313,6 @@ class ThemeData with Diagnosticable {
super.debugFillProperties(properties); super.debugFillProperties(properties);
final ThemeData defaultData = ThemeData.fallback(); final ThemeData defaultData = ThemeData.fallback();
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
properties.add(EnumProperty<AndroidOverscrollIndicator>('androidOverscrollIndicator', androidOverscrollIndicator, defaultValue: null, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<bool>('applyElevationOverlayColor', applyElevationOverlayColor, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty<bool>('applyElevationOverlayColor', applyElevationOverlayColor, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<NoDefaultCupertinoThemeData>('cupertinoOverrideTheme', cupertinoOverrideTheme, defaultValue: defaultData.cupertinoOverrideTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty<NoDefaultCupertinoThemeData>('cupertinoOverrideTheme', cupertinoOverrideTheme, defaultValue: defaultData.cupertinoOverrideTheme, level: DiagnosticLevel.debug));
properties.add(IterableProperty<ThemeExtension<dynamic>>('extensions', extensions.values, defaultValue: defaultData.extensions.values, level: DiagnosticLevel.debug)); properties.add(IterableProperty<ThemeExtension<dynamic>>('extensions', extensions.values, defaultValue: defaultData.extensions.values, level: DiagnosticLevel.debug));
...@@ -2381,6 +2401,7 @@ class ThemeData with Diagnosticable { ...@@ -2381,6 +2401,7 @@ class ThemeData with Diagnosticable {
properties.add(ColorProperty('buttonColor', buttonColor, defaultValue: defaultData.buttonColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('buttonColor', buttonColor, defaultValue: defaultData.buttonColor, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<bool>('fixTextFieldOutlineLabel', fixTextFieldOutlineLabel, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty<bool>('fixTextFieldOutlineLabel', fixTextFieldOutlineLabel, level: DiagnosticLevel.debug));
properties.add(EnumProperty<Brightness>('primaryColorBrightness', primaryColorBrightness, defaultValue: defaultData.primaryColorBrightness, level: DiagnosticLevel.debug)); properties.add(EnumProperty<Brightness>('primaryColorBrightness', primaryColorBrightness, defaultValue: defaultData.primaryColorBrightness, level: DiagnosticLevel.debug));
properties.add(EnumProperty<AndroidOverscrollIndicator>('androidOverscrollIndicator', androidOverscrollIndicator, defaultValue: null, level: DiagnosticLevel.debug));
} }
} }
......
...@@ -623,6 +623,9 @@ class _GlowingOverscrollIndicatorPainter extends CustomPainter { ...@@ -623,6 +623,9 @@ class _GlowingOverscrollIndicatorPainter extends CustomPainter {
/// [ScrollBehavior.androidOverscrollIndicator] is /// [ScrollBehavior.androidOverscrollIndicator] is
/// [AndroidOverscrollIndicator.stretch]. Otherwise, the default /// [AndroidOverscrollIndicator.stretch]. Otherwise, the default
/// [GlowingOverscrollIndicator] is applied. /// [GlowingOverscrollIndicator] is applied.
/// [ScrollBehavior.androidOverscrollIndicator] is deprecated, use
/// [ThemeData.useMaterial3], or override
/// [ScrollBehavior.buildOverscrollIndicator] to choose the desired indicator.
/// ///
/// See also: /// See also:
/// ///
...@@ -669,6 +672,9 @@ class StretchingOverscrollIndicator extends StatefulWidget { ...@@ -669,6 +672,9 @@ class StretchingOverscrollIndicator extends StatefulWidget {
/// [ScrollBehavior.buildOverscrollIndicator] method when opted-in using the /// [ScrollBehavior.buildOverscrollIndicator] method when opted-in using the
/// [ScrollBehavior.androidOverscrollIndicator] flag. In this case /// [ScrollBehavior.androidOverscrollIndicator] flag. In this case
/// the child is usually the one provided as an argument to that method. /// the child is usually the one provided as an argument to that method.
/// [ScrollBehavior.androidOverscrollIndicator] is deprecated, use
/// [ThemeData.useMaterial3], or override
/// [ScrollBehavior.buildOverscrollIndicator] to choose the desired indicator.
final Widget? child; final Widget? child;
@override @override
......
...@@ -62,6 +62,10 @@ enum AndroidOverscrollIndicator { ...@@ -62,6 +62,10 @@ enum AndroidOverscrollIndicator {
class ScrollBehavior { class ScrollBehavior {
/// Creates a description of how [Scrollable] widgets should behave. /// Creates a description of how [Scrollable] widgets should behave.
const ScrollBehavior({ const ScrollBehavior({
@Deprecated(
'Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. '
'This feature was deprecated after v2.13.0-0.0.pre.'
)
AndroidOverscrollIndicator? androidOverscrollIndicator, AndroidOverscrollIndicator? androidOverscrollIndicator,
}): _androidOverscrollIndicator = androidOverscrollIndicator; }): _androidOverscrollIndicator = androidOverscrollIndicator;
...@@ -73,6 +77,10 @@ class ScrollBehavior { ...@@ -73,6 +77,10 @@ class ScrollBehavior {
/// ///
/// * [MaterialScrollBehavior], which supports setting this property /// * [MaterialScrollBehavior], which supports setting this property
/// using [ThemeData]. /// using [ThemeData].
@Deprecated(
'Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. '
'This feature was deprecated after v2.13.0-0.0.pre.'
)
AndroidOverscrollIndicator get androidOverscrollIndicator => _androidOverscrollIndicator ?? _kDefaultAndroidOverscrollIndicator; AndroidOverscrollIndicator get androidOverscrollIndicator => _androidOverscrollIndicator ?? _kDefaultAndroidOverscrollIndicator;
final AndroidOverscrollIndicator? _androidOverscrollIndicator; final AndroidOverscrollIndicator? _androidOverscrollIndicator;
...@@ -90,6 +98,10 @@ class ScrollBehavior { ...@@ -90,6 +98,10 @@ class ScrollBehavior {
Set<PointerDeviceKind>? dragDevices, Set<PointerDeviceKind>? dragDevices,
ScrollPhysics? physics, ScrollPhysics? physics,
TargetPlatform? platform, TargetPlatform? platform,
@Deprecated(
'Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. '
'This feature was deprecated after v2.13.0-0.0.pre.'
)
AndroidOverscrollIndicator? androidOverscrollIndicator, AndroidOverscrollIndicator? androidOverscrollIndicator,
}) { }) {
return _WrappedScrollBehavior( return _WrappedScrollBehavior(
......
...@@ -1103,6 +1103,24 @@ void main() { ...@@ -1103,6 +1103,24 @@ void main() {
expect(find.byType(GlowingOverscrollIndicator), findsNothing); expect(find.byType(GlowingOverscrollIndicator), findsNothing);
}, variant: TargetPlatformVariant.only(TargetPlatform.android)); }, variant: TargetPlatformVariant.only(TargetPlatform.android));
testWidgets('ScrollBehavior stretch android overscroll indicator via useMaterial3 flag', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(
theme: ThemeData(useMaterial3: true),
home: ListView(
children: const <Widget>[
SizedBox(
height: 1000.0,
width: 1000.0,
child: Text('Test'),
)
]
)
));
expect(find.byType(StretchingOverscrollIndicator), findsOneWidget);
expect(find.byType(GlowingOverscrollIndicator), findsNothing);
}, variant: TargetPlatformVariant.only(TargetPlatform.android));
testWidgets('Overscroll indicator can be set by theme', (WidgetTester tester) async { testWidgets('Overscroll indicator can be set by theme', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(MaterialApp(
// The current default is glowing, setting via the theme should override. // The current default is glowing, setting via the theme should override.
......
...@@ -999,7 +999,6 @@ void main() { ...@@ -999,7 +999,6 @@ void main() {
// List of properties must match the properties in ThemeData.hashCode() // List of properties must match the properties in ThemeData.hashCode()
final Set<String> expectedPropertyNames = <String>{ final Set<String> expectedPropertyNames = <String>{
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
'androidOverscrollIndicator',
'applyElevationOverlayColor', 'applyElevationOverlayColor',
'cupertinoOverrideTheme', 'cupertinoOverrideTheme',
'extensions', 'extensions',
...@@ -1088,6 +1087,7 @@ void main() { ...@@ -1088,6 +1087,7 @@ void main() {
'buttonColor', 'buttonColor',
'fixTextFieldOutlineLabel', 'fixTextFieldOutlineLabel',
'primaryColorBrightness', 'primaryColorBrightness',
'androidOverscrollIndicator',
}; };
final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder(); final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment