Unverified Commit 1c7f038d authored by Abhishek Ghaskata's avatar Abhishek Ghaskata Committed by GitHub

Added ElevatedButton code sample (#76221)

parent e301aca0
......@@ -47,6 +47,38 @@ import 'theme_data.dart';
/// If [onPressed] and [onLongPress] callbacks are null, then the
/// button will be disabled.
///
/// {@tool dartpad --template=stateful_widget_scaffold}
///
/// This sample produces an enabled and a disabled ElevatedButton.
///
/// ```dart
/// Widget build(BuildContext context) {
/// final ButtonStyle style =
/// ElevatedButton.styleFrom(textStyle: TextStyle(fontSize: 20));
///
/// return Center(
/// child: Column(
/// mainAxisSize: MainAxisSize.min,
/// children: <Widget>[
/// ElevatedButton(
/// style: style,
/// onPressed: null,
/// child: const Text('Disabled'),
/// ),
/// const SizedBox(height: 30),
/// ElevatedButton(
/// style: style,
/// onPressed: () {},
/// child: const Text('Enabled'),
/// ),
/// ],
/// ),
/// );
/// }
///
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [TextButton], a simple flat button without a shadow.
......
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