Commit 571834ea authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Indicate required fields in flutter_gallery demo. (#7717)

parent c234d405
...@@ -116,20 +116,20 @@ class TextFieldDemoState extends State<TextFieldDemo> { ...@@ -116,20 +116,20 @@ class TextFieldDemoState extends State<TextFieldDemo> {
new TextField( new TextField(
icon: new Icon(Icons.person), icon: new Icon(Icons.person),
hintText: 'What do people call you?', hintText: 'What do people call you?',
labelText: 'Name', labelText: 'Name *',
onSaved: (InputValue val) { person.name = val.text; }, onSaved: (InputValue val) { person.name = val.text; },
validator: _validateName, validator: _validateName,
), ),
new TextField( new TextField(
icon: new Icon(Icons.phone), icon: new Icon(Icons.phone),
hintText: 'Where can we reach you?', hintText: 'Where can we reach you?',
labelText: 'Phone Number', labelText: 'Phone Number *',
keyboardType: TextInputType.phone, keyboardType: TextInputType.phone,
onSaved: (InputValue val) { person.phoneNumber = val.text; }, onSaved: (InputValue val) { person.phoneNumber = val.text; },
validator: _validatePhoneNumber, validator: _validatePhoneNumber,
), ),
new TextField( new TextField(
hintText: 'Tell us about yourself (optional)', hintText: 'Tell us about yourself',
labelText: 'Life story', labelText: 'Life story',
maxLines: 3, maxLines: 3,
), ),
...@@ -140,7 +140,7 @@ class TextFieldDemoState extends State<TextFieldDemo> { ...@@ -140,7 +140,7 @@ class TextFieldDemoState extends State<TextFieldDemo> {
child: new TextField( child: new TextField(
key: _passwordFieldKey, key: _passwordFieldKey,
hintText: 'How do you log in?', hintText: 'How do you log in?',
labelText: 'New Password', labelText: 'New Password *',
obscureText: true, obscureText: true,
onSaved: (InputValue val) { person.password = val.text; } onSaved: (InputValue val) { person.password = val.text; }
) )
...@@ -149,7 +149,7 @@ class TextFieldDemoState extends State<TextFieldDemo> { ...@@ -149,7 +149,7 @@ class TextFieldDemoState extends State<TextFieldDemo> {
new Expanded( new Expanded(
child: new TextField( child: new TextField(
hintText: 'How do you log in?', hintText: 'How do you log in?',
labelText: 'Re-type Password', labelText: 'Re-type Password *',
obscureText: true, obscureText: true,
validator: _validatePassword, validator: _validatePassword,
) )
...@@ -163,7 +163,11 @@ class TextFieldDemoState extends State<TextFieldDemo> { ...@@ -163,7 +163,11 @@ class TextFieldDemoState extends State<TextFieldDemo> {
child: new Text('SUBMIT'), child: new Text('SUBMIT'),
onPressed: _handleSubmitted, onPressed: _handleSubmitted,
), ),
) ),
new Container(
padding: const EdgeInsets.only(top: 20.0),
child: new Text('* indicates required field', style: Theme.of(context).textTheme.caption),
),
] ]
) )
) )
......
...@@ -596,12 +596,12 @@ class DataTable extends StatelessWidget { ...@@ -596,12 +596,12 @@ class DataTable extends StatelessWidget {
/// Must have an ancestor [Material] widget in which to cause ink /// Must have an ancestor [Material] widget in which to cause ink
/// reactions and an ancestor [Table] widget to establish a row. /// reactions and an ancestor [Table] widget to establish a row.
/// ///
/// The TableRowInkWell must be in the same coordinate space (modulo /// The [TableRowInkWell] must be in the same coordinate space (modulo
/// translations) as the [Table]. If it's rotated or scaled or /// translations) as the [Table]. If it's rotated or scaled or
/// otherwise transformed, it will not be able to describe the /// otherwise transformed, it will not be able to describe the
/// rectangle of the row in its own coordinate system as a [Rect], and /// rectangle of the row in its own coordinate system as a [Rect], and
/// thus the splash will not occur. (In general, this is easy to /// thus the splash will not occur. (In general, this is easy to
/// achieve: just put the TableRowInkWell as the direct child of the /// achieve: just put the [TableRowInkWell] as the direct child of the
/// [Table], and put the other contents of the cell inside it.) /// [Table], and put the other contents of the cell inside it.)
class TableRowInkWell extends InkResponse { class TableRowInkWell extends InkResponse {
/// Creates an ink well for a table row. /// Creates an ink well for a table row.
......
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