diff --git a/packages/flutter/lib/src/material/elevated_button.dart b/packages/flutter/lib/src/material/elevated_button.dart index dfd24a15a6..d9780843cf 100644 --- a/packages/flutter/lib/src/material/elevated_button.dart +++ b/packages/flutter/lib/src/material/elevated_button.dart @@ -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: [ +/// 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.