Commit b7807ce8 authored by Kartik Sharma's avatar Kartik Sharma Committed by Hans Muller

Update an IconButton sample, add RaisedButton sample (#27169)

parent 4e8b732f
...@@ -47,11 +47,25 @@ const double _kMinButtonSize = 48.0; ...@@ -47,11 +47,25 @@ const double _kMinButtonSize = 48.0;
/// ``` /// ```
/// ///
/// ```dart /// ```dart
/// Widget build(BuildContext) { /// Widget build(BuildContext context) {
/// return IconButton( /// return Scaffold(
/// body: Center(
/// child: Column(
/// mainAxisSize: MainAxisSize.min,
/// children: <Widget>[
/// IconButton(
/// icon: Icon(Icons.volume_up), /// icon: Icon(Icons.volume_up),
/// tooltip: 'Increase volume by 10%', /// tooltip: 'Increase volume by 10',
/// onPressed: () { setState(() { _volume *= 1.1; }); }, /// onPressed: () {
/// setState(() {
/// _volume += 10;
/// });
/// },
/// ),
/// Text('Volume : $_volume')
/// ],
/// ),
/// ),
/// ); /// );
/// } /// }
/// ``` /// ```
......
...@@ -31,6 +31,46 @@ import 'theme_data.dart'; ...@@ -31,6 +31,46 @@ import 'theme_data.dart';
/// Raised buttons have a minimum size of 88.0 by 36.0 which can be overidden /// Raised buttons have a minimum size of 88.0 by 36.0 which can be overidden
/// with [ButtonTheme]. /// with [ButtonTheme].
/// ///
/// {@tool snippet --template=stateless_widget}
///
/// This sample shows how to render a disabled RaisedButton, an enabled RaisedButton
/// and lastly a RaisedButton with gradient background.
///
/// ```dart
/// Scaffold(
/// body: Center(
/// child: Column(
/// mainAxisSize: MainAxisSize.min,
/// children: <Widget>[
/// RaisedButton(
/// onPressed: null,
/// child: const Text('Disabled Button'),
/// ),
/// RaisedButton(
/// onPressed: () {},
/// child: const Text('Enabled Button'),
/// ),
/// RaisedButton(
/// onPressed: () {},
/// textColor: Colors.white,
/// padding: const EdgeInsets.all(0.0),
/// child: Container(
/// decoration: const BoxDecoration(
/// gradient: LinearGradient(
/// colors: <Color>[Colors.red, Colors.green, Colors.blue],
/// ),
/// ),
/// padding: const EdgeInsets.all(10.0),
/// child: Text('Gradient Button'),
/// ),
/// ),
/// ],
/// ),
/// ),
/// )
/// ```
/// {@end-tool}
///
/// See also: /// See also:
/// ///
/// * [FlatButton], a material design button without a shadow. /// * [FlatButton], a material design 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