diff --git a/packages/flutter/lib/fix_data/fix_material/fix_expansion_tile.yaml b/packages/flutter/lib/fix_data/fix_material/fix_expansion_tile.yaml new file mode 100644 index 0000000000..619b4824f7 --- /dev/null +++ b/packages/flutter/lib/fix_data/fix_material/fix_expansion_tile.yaml @@ -0,0 +1,40 @@ +# Copyright 2014 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# For details regarding the *Flutter Fix* feature, see +# https://flutter.dev/to/flutter-fix + +# Please add new fixes to the top of the file, separated by one blank line +# from other fixes. In a comment, include a link to the PR where the change +# requiring the fix was made. + +# Every fix must be tested. See the flutter/packages/flutter/test_fixes/README.md +# file for instructions on testing these data driven fixes. + +# For documentation about this file format, see +# https://dart.dev/go/data-driven-fixes. + +# * Fixes in this file are for ExpansionTile from the Material library. * +# For fixes to +# * AppBarTheme: fix_app_bar_theme.yaml +# * AppBar: fix_app_bar.yaml +# * ButtonBar: fix_button_bar.yaml +# * ColorScheme: fix_color_scheme.yaml +# * Material (general): fix_material.yaml +# * SliverAppBar: fix_sliver_app_bar.yaml +# * TextTheme: fix_text_theme.yaml +# * ThemeData: fix_theme_data.yaml +version: 1 +transforms: + # Changes made in https://github.com/flutter/flutter/pull/ + - title: "Migrate to 'ExpansibleController'" + date: 2025-04-01 + element: + uris: [ 'material.dart', 'widgets.dart' ] + class: 'ExpansionTileController' + changes: + - kind: 'rename' + newName: 'ExpansibleController' + +# Before adding a new fix: read instructions at the top of this file. diff --git a/packages/flutter/lib/src/material/expansion_tile.dart b/packages/flutter/lib/src/material/expansion_tile.dart index 8f9d2278b0..e5d438f8c0 100644 --- a/packages/flutter/lib/src/material/expansion_tile.dart +++ b/packages/flutter/lib/src/material/expansion_tile.dart @@ -62,6 +62,10 @@ const Duration _kExpand = Duration(milliseconds: 200); /// /// Remember to dispose of the [ExpansionTileController] when it is no longer /// needed. This will ensure we discard any resources used by the object. +@Deprecated( + 'Use ExpansibleController instead. ' + 'This feature was deprecated after v3.31.0-0.1.pre.', +) typedef ExpansionTileController = ExpansibleController; /// A single-line [ListTile] with an expansion arrow icon that expands or collapses diff --git a/packages/flutter/test_fixes/material/expansion_tile.dart b/packages/flutter/test_fixes/material/expansion_tile.dart new file mode 100644 index 0000000000..adfb3c4778 --- /dev/null +++ b/packages/flutter/test_fixes/material/expansion_tile.dart @@ -0,0 +1,10 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; + +void main() { + // Changes made in https://github.com/flutter/flutter/pull/166368 + ExpansionTileController(); +} diff --git a/packages/flutter/test_fixes/material/expansion_tile.dart.expect b/packages/flutter/test_fixes/material/expansion_tile.dart.expect new file mode 100644 index 0000000000..437dd5429e --- /dev/null +++ b/packages/flutter/test_fixes/material/expansion_tile.dart.expect @@ -0,0 +1,10 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; + +void main() { + // Changes made in https://github.com/flutter/flutter/pull/166368 + ExpansibleController(); +}