From 8539dea1ef0a269d63fb4f2a6ed928391ff18dd8 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Wed, 27 Feb 2019 14:59:31 -0800 Subject: [PATCH] TextField Snippet for API Docs (#28598) * Added code snippet for TextField class. ref:#21136 * Errant semicolon --- .../flutter/lib/src/material/text_field.dart | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/flutter/lib/src/material/text_field.dart b/packages/flutter/lib/src/material/text_field.dart index 928e664cbe..8a1f9d165d 100644 --- a/packages/flutter/lib/src/material/text_field.dart +++ b/packages/flutter/lib/src/material/text_field.dart @@ -65,6 +65,22 @@ typedef InputCounterWidgetBuilder = Widget Function( /// To integrate the [TextField] into a [Form] with other [FormField] widgets, /// consider using [TextFormField]. /// +/// {@tool sample} +/// This example shows how to create a [TextField] that will obscure input. The +/// [InputDecoration] surrounds the field in a border using [OutlineInputBorder] +/// and adds a label. +/// +/// ```dart +/// TextField( +/// obscureText: true, +/// decoration: InputDecoration( +/// border: OutlineInputBorder(), +/// labelText: 'Password', +/// ), +/// ) +/// ``` +/// {@end-tool} +/// /// See also: /// /// *