diff --git a/packages/flutter/lib/src/material/flat_button.dart b/packages/flutter/lib/src/material/flat_button.dart index fd56a273bd..70377b516c 100644 --- a/packages/flutter/lib/src/material/flat_button.dart +++ b/packages/flutter/lib/src/material/flat_button.dart @@ -40,6 +40,48 @@ import 'theme_data.dart'; /// /// The [clipBehavior] argument must not be null. /// +/// {@tool sample} +/// +/// This example shows a simple [FlatButton]. +/// +/// ```dart +/// FlatButton( +/// onPressed: () { +/// /*...*/ +/// }, +/// child: Text( +/// "Flat Button", +/// ), +/// ) +/// ``` +/// {@end-tool} +/// +/// {@tool sample} +/// +/// This example shows a [FlatButton] that is normally white-on-blue, +/// with splashes rendered in a different shade of blue. +/// It turns black-on-grey when disabled. +/// The button has 8px of padding on each side, and the text is 20px high. +/// +/// ```dart +/// FlatButton( +/// color: Colors.blue, +/// textColor: Colors.white, +/// disabledColor: Colors.grey, +/// disabledTextColor: Colors.black, +/// padding: EdgeInsets.all(8.0), +/// splashColor: Colors.blueAccent, +/// onPressed: () { +/// /*...*/ +/// }, +/// child: Text( +/// "Flat Button", +/// style: TextStyle(fontSize: 20.0), +/// ), +/// ) +/// ``` +/// {@end-tool} +/// /// See also: /// /// * [RaisedButton], a filled button whose material elevates when pressed.