From 70dfe01a152c33556061ea3b8c2771aa363dbe10 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Fri, 15 Feb 2019 10:24:14 -0800 Subject: [PATCH] Sample code for Icon class (#27968) * Added sample code for a simple Icon, ref: #21136 * Removed duplicate line. * Fixed incoreect parameter. * Update icon.dart Removed empty prose and added better context for sample code. Changed sample code for better visibility in execution of default app themes. * Alas, Trailing space. Nixed trailing space in comments. --- packages/flutter/lib/src/widgets/icon.dart | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/flutter/lib/src/widgets/icon.dart b/packages/flutter/lib/src/widgets/icon.dart index 7ccb35ef27..459f922ada 100644 --- a/packages/flutter/lib/src/widgets/icon.dart +++ b/packages/flutter/lib/src/widgets/icon.dart @@ -21,6 +21,20 @@ import 'icon_theme_data.dart'; /// Typically this is introduced automatically by the [WidgetsApp] or /// [MaterialApp]. /// +/// {@tool sample} +/// +/// This example shows how to use [Icon] to create an addition icon, in the +/// color pink, and 30 pixels in size. +/// +/// ```dart +/// Icon( +/// Icons.add, +/// color: Colors.pink, +/// size: 30.0, +/// ) +/// ``` +/// {@end-tool} +/// /// See also: /// /// * [IconButton], for interactive icons.