Unverified Commit 013fd211 authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

FAB Snippet for API Docs (#28752)

* Added code snippets for FloatingActionButton Class. ref:#21136

* Extraneous white spaces.
Co-Authored-By: 's avatarPiinks <katelovett@google.com>

* Alignment correction.

* The analyze result wasn't showing on github interface. Checked through Cirrus and it's all-green.
Co-Authored-By: 's avatarPiinks <katelovett@google.com>
parent e8b87203
......@@ -53,6 +53,58 @@ class _DefaultHeroTag {
/// disabled. Consider changing the [backgroundColor] if disabling the floating
/// action button.
///
/// {@tool snippet --template=stateless_widget_material}
/// This example shows how to make a simple [FloatingActionButton] in a
/// [Scaffold], with a pink [backgroundColor] and a thumbs up [Icon].
///
/// ```dart
/// Widget build(BuildContext context) {
/// return Scaffold(
/// appBar: AppBar(
/// title: Text('Floating Action Button Sample'),
/// ),
/// body: Center(
/// child: Text('Press the button below!')
/// ),
/// floatingActionButton: FloatingActionButton(
/// onPressed: () {
/// // Add your onPressed code here!
/// },
/// child: Icon(Icons.thumb_up),
/// backgroundColor: Colors.pink,
/// ),
/// );
/// }
/// ```
/// {@end-tool}
///
/// {@tool snippet --template=stateless_widget_material}
/// This example shows how to make an extended [FloatingActionButton] in a
/// [Scaffold], with a pink [backgroundColor] and a thumbs up [Icon] and a
/// [Text] label.
///
/// ```dart
/// Widget build(BuildContext context) {
/// return Scaffold(
/// appBar: AppBar(
/// title: Text('Floating Action Button Sample'),
/// ),
/// body: Center(
/// child: Text('Press the extended button below!'),
/// ),
/// floatingActionButton: FloatingActionButton.extended(
/// onPressed: () {
/// // Add your onPressed code here!
/// },
/// label: Text('Approve'),
/// icon: Icon(Icons.thumb_up),
/// backgroundColor: Colors.pink,
/// ),
/// );
/// }
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [Scaffold], in which floating action buttons typically live.
......
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