FAB Snippet for API Docs (#28752)
* Added code snippets for FloatingActionButton Class. ref:#21136
* Extraneous white spaces.
Co-Authored-By: Piinks <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: Piinks <katelovett@google.com>
diff --git a/packages/flutter/lib/src/material/floating_action_button.dart b/packages/flutter/lib/src/material/floating_action_button.dart
index 5e06ca4..4367980 100644
--- a/packages/flutter/lib/src/material/floating_action_button.dart
+++ b/packages/flutter/lib/src/material/floating_action_button.dart
@@ -53,6 +53,58 @@
/// 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.