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: /// /// *