Skip to content

Commit ff5e27f

Browse files
authored
Remove deprecated FlatButton (flutter#98545)
1 parent 9b6e4f0 commit ff5e27f

File tree

13 files changed

+71
-1463
lines changed

13 files changed

+71
-1463
lines changed

dev/integration_tests/ios_host_app/flutterapp/lib/main

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class _MyHomePageState extends State<MyHomePage> {
166166
style: const TextStyle(fontSize: 17.0),
167167
),
168168
),
169-
const FlatButton(
169+
const TextButton(
170170
child: Text('POP'),
171171
onPressed: SystemNavigator.pop,
172172
),

dev/integration_tests/ios_host_app/flutterapp/lib/marquee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class MarqueeState extends State<Marquee> with SingleTickerProviderStateMixin {
6565
child: _MarqueeText(animation: animation),
6666
alignment: Alignment.centerLeft,
6767
),
68-
const FlatButton(child: Text('POP'), onPressed: SystemNavigator.pop),
68+
const TextButton(child: Text('POP'), onPressed: SystemNavigator.pop),
6969
],
7070
),
7171
),

packages/flutter/lib/material.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export 'src/material/expansion_panel.dart';
7474
export 'src/material/expansion_tile.dart';
7575
export 'src/material/expansion_tile_theme.dart';
7676
export 'src/material/feedback.dart';
77-
export 'src/material/flat_button.dart';
7877
export 'src/material/flexible_space_bar.dart';
7978
export 'src/material/floating_action_button.dart';
8079
export 'src/material/floating_action_button_location.dart';

packages/flutter/lib/src/material/button.dart

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,20 @@ import 'theme_data.dart';
2020
/// Creates a button based on [Semantics], [Material], and [InkWell]
2121
/// widgets.
2222
///
23-
/// ### This class is obsolete.
24-
///
25-
/// Custom button classes can be created by configuring the
26-
/// [ButtonStyle] of a [TextButton], [ElevatedButton] or an
27-
/// [OutlinedButton].
28-
///
29-
/// FlatButton has been replaced by TextButton and ButtonTheme has been
30-
/// replaced by TextButtonTheme. Please migrate code that uses them.
31-
/// There's a detailed migration guide for the new button and button
32-
/// theme classes in
33-
/// [flutter.dev/go/material-button-migration-guide](https://flutter.dev/go/material-button-migration-guide).
34-
///
3523
/// This class does not use the current [Theme] or [ButtonTheme] to
3624
/// compute default values for unspecified parameters. It's intended to
3725
/// be used for custom Material buttons that optionally incorporate defaults
3826
/// from the themes or from app-specific sources.
27+
///
28+
/// This class is planned to be deprecated in a future release, see
29+
/// [ButtonStyleButton], the base class of [TextButton], [ElevatedButton], and
30+
/// [OutlinedButton].
31+
///
32+
/// See also:
33+
///
34+
/// * [TextButton], a simple flat button without a shadow.
35+
/// * [ElevatedButton], a filled button whose material elevates when pressed.
36+
/// * [OutlinedButton], a [TextButton] with a border outline.
3937
@Category(<String>['Material', 'Button'])
4038
class RawMaterialButton extends StatefulWidget {
4139
/// Create a button based on [Semantics], [Material], and [InkWell] widgets.

0 commit comments

Comments
 (0)