diff --git a/packages/flutter/lib/fix_data.yaml b/packages/flutter/lib/fix_data.yaml index d44f715815..b908da8525 100644 --- a/packages/flutter/lib/fix_data.yaml +++ b/packages/flutter/lib/fix_data.yaml @@ -17,6 +17,64 @@ version: 1 transforms: + # Changes made in https://github.com/flutter/flutter/pull/111706 + - title: "Migrate to 'trackVisibility'" + date: 2022-09-15 + element: + uris: [ 'material.dart' ] + field: 'showTrackOnHover' + inClass: 'Scrollbar' + changes: + - kind: 'rename' + newName: 'trackVisibility' + + # Changes made in https://github.com/flutter/flutter/pull/111706 + - title: "Migrate to 'trackVisibility'" + date: 2022-09-15 + element: + uris: [ 'material.dart' ] + constructor: '' + inClass: 'Scrollbar' + changes: + - kind: 'renameParameter' + oldName: 'showTrackOnHover' + newName: 'trackVisibility' + + # Changes made in https://github.com/flutter/flutter/pull/111706 + - title: "Migrate to 'trackVisibility'" + date: 2022-09-15 + element: + uris: [ 'material.dart' ] + field: 'showTrackOnHover' + inClass: 'ScrollbarThemeData' + changes: + - kind: 'rename' + newName: 'trackVisibility' + + # Changes made in https://github.com/flutter/flutter/pull/111706 + - title: "Migrate to 'thumbVisibility'" + date: 2022-09-15 + element: + uris: [ 'material.dart' ] + constructor: '' + inClass: 'ScrollbarThemeData' + changes: + - kind: 'renameParameter' + oldName: 'showTrackOnHover' + newName: 'trackVisibility' + + # Changes made in https://github.com/flutter/flutter/pull/111706 + - title: "Migrate to 'trackVisibility'" + date: 2022-09-15 + element: + uris: [ 'material.dart' ] + method: 'copyWith' + inClass: 'ScrollbarThemeData' + changes: + - kind: 'renameParameter' + oldName: 'showTrackOnHover' + newName: 'trackVisibility' + # Changes made in https://github.com/flutter/flutter/pull/111080 - title: "Migrate to 'BottomAppBarTheme.color'" date: 2022-09-07 diff --git a/packages/flutter/lib/src/material/scrollbar.dart b/packages/flutter/lib/src/material/scrollbar.dart index d0ee9db3bf..ff5919ec80 100644 --- a/packages/flutter/lib/src/material/scrollbar.dart +++ b/packages/flutter/lib/src/material/scrollbar.dart @@ -102,7 +102,7 @@ class Scrollbar extends StatelessWidget { this.isAlwaysShown, @Deprecated( 'Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. ' - 'This feature was deprecated after v2.9.0-1.0.pre.', + 'This feature was deprecated after v3.4.0-19.0.pre.', ) this.showTrackOnHover, @Deprecated( @@ -168,7 +168,7 @@ class Scrollbar extends StatelessWidget { /// should be used instead. @Deprecated( 'Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. ' - 'This feature was deprecated after v2.9.0-1.0.pre.', + 'This feature was deprecated after v3.4.0-19.0.pre.', ) final bool? showTrackOnHover; diff --git a/packages/flutter/lib/src/material/scrollbar_theme.dart b/packages/flutter/lib/src/material/scrollbar_theme.dart index 38574e2c8d..19b132e6d4 100644 --- a/packages/flutter/lib/src/material/scrollbar_theme.dart +++ b/packages/flutter/lib/src/material/scrollbar_theme.dart @@ -52,7 +52,7 @@ class ScrollbarThemeData with Diagnosticable { this.isAlwaysShown, @Deprecated( 'Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. ' - 'This feature was deprecated after v2.9.0-1.0.pre.', + 'This feature was deprecated after v3.4.0-19.0.pre.', ) this.showTrackOnHover, }) : assert( @@ -82,7 +82,7 @@ class ScrollbarThemeData with Diagnosticable { /// descendant [Scrollbar] widgets. @Deprecated( 'Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. ' - 'This feature was deprecated after v2.9.0-1.0.pre.', + 'This feature was deprecated after v3.4.0-19.0.pre.', ) final bool? showTrackOnHover; @@ -161,7 +161,6 @@ class ScrollbarThemeData with Diagnosticable { MaterialStateProperty? thumbVisibility, MaterialStateProperty? thickness, MaterialStateProperty? trackVisibility, - bool? showTrackOnHover, bool? interactive, Radius? radius, MaterialStateProperty? thumbColor, @@ -175,6 +174,12 @@ class ScrollbarThemeData with Diagnosticable { 'This feature was deprecated after v2.9.0-1.0.pre.', ) bool? isAlwaysShown, + + @Deprecated( + 'Use ScrollbarThemeData.trackVisibility to resolve based on the current state instead. ' + 'This feature was deprecated after v3.4.0-19.0.pre.', + ) + bool? showTrackOnHover, }) { return ScrollbarThemeData( thumbVisibility: thumbVisibility ?? this.thumbVisibility, diff --git a/packages/flutter/test_fixes/material.dart b/packages/flutter/test_fixes/material.dart index 40f9545c43..c0660ec0bb 100644 --- a/packages/flutter/test_fixes/material.dart +++ b/packages/flutter/test_fixes/material.dart @@ -694,4 +694,11 @@ void main() { themeData = ThemeData(bottomAppBarColor: Colors.green); themeData = ThemeData.raw(bottomAppBarColor: Colors.green); themeData = ThemeData.copyWith(bottomAppBarColor: Colors.green); + + // Changes made in https://github.com/flutter/flutter/pull/111706 + Scrollbar scrollbar = Scrollbar(showTrackOnHover: true); + bool nowShowing = scrollbar.showTrackOnHover; + ScrollbarThemeData scrollbarTheme = ScrollbarThemeData(showTrackOnHover: nowShowing); + scrollbarTheme.copyWith(showTrackOnHover: nowShowing); + scrollbarTheme.showTrackOnHover; } diff --git a/packages/flutter/test_fixes/material.dart.expect b/packages/flutter/test_fixes/material.dart.expect index 7f8763a324..445f6540da 100644 --- a/packages/flutter/test_fixes/material.dart.expect +++ b/packages/flutter/test_fixes/material.dart.expect @@ -898,4 +898,11 @@ void main() { themeData = ThemeData(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green)); themeData = ThemeData.raw(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green)); themeData = ThemeData.copyWith(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green)); + + // Changes made in https://github.com/flutter/flutter/pull/111706 + Scrollbar scrollbar = Scrollbar(trackVisibility: true); + bool nowShowing = scrollbar.trackVisibility; + ScrollbarThemeData scrollbarTheme = ScrollbarThemeData(trackVisibility: nowShowing); + scrollbarTheme.copyWith(trackVisibility: nowShowing); + scrollbarTheme.trackVisibility; }