From 571834ea3ce225d452859e9cbc781968dd8cf3c6 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Sat, 28 Jan 2017 01:48:18 -0800 Subject: [PATCH] Indicate required fields in flutter_gallery demo. (#7717) --- .../lib/demo/text_field_demo.dart | 16 ++++++++++------ .../flutter/lib/src/material/data_table.dart | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/examples/flutter_gallery/lib/demo/text_field_demo.dart b/examples/flutter_gallery/lib/demo/text_field_demo.dart index cd99e11e49..2dee8b28bd 100644 --- a/examples/flutter_gallery/lib/demo/text_field_demo.dart +++ b/examples/flutter_gallery/lib/demo/text_field_demo.dart @@ -116,20 +116,20 @@ class TextFieldDemoState extends State { new TextField( icon: new Icon(Icons.person), hintText: 'What do people call you?', - labelText: 'Name', + labelText: 'Name *', onSaved: (InputValue val) { person.name = val.text; }, validator: _validateName, ), new TextField( icon: new Icon(Icons.phone), hintText: 'Where can we reach you?', - labelText: 'Phone Number', + labelText: 'Phone Number *', keyboardType: TextInputType.phone, onSaved: (InputValue val) { person.phoneNumber = val.text; }, validator: _validatePhoneNumber, ), new TextField( - hintText: 'Tell us about yourself (optional)', + hintText: 'Tell us about yourself', labelText: 'Life story', maxLines: 3, ), @@ -140,7 +140,7 @@ class TextFieldDemoState extends State { child: new TextField( key: _passwordFieldKey, hintText: 'How do you log in?', - labelText: 'New Password', + labelText: 'New Password *', obscureText: true, onSaved: (InputValue val) { person.password = val.text; } ) @@ -149,7 +149,7 @@ class TextFieldDemoState extends State { new Expanded( child: new TextField( hintText: 'How do you log in?', - labelText: 'Re-type Password', + labelText: 'Re-type Password *', obscureText: true, validator: _validatePassword, ) @@ -163,7 +163,11 @@ class TextFieldDemoState extends State { child: new Text('SUBMIT'), onPressed: _handleSubmitted, ), - ) + ), + new Container( + padding: const EdgeInsets.only(top: 20.0), + child: new Text('* indicates required field', style: Theme.of(context).textTheme.caption), + ), ] ) ) diff --git a/packages/flutter/lib/src/material/data_table.dart b/packages/flutter/lib/src/material/data_table.dart index 665598abcc..e6ac86a050 100644 --- a/packages/flutter/lib/src/material/data_table.dart +++ b/packages/flutter/lib/src/material/data_table.dart @@ -596,12 +596,12 @@ class DataTable extends StatelessWidget { /// Must have an ancestor [Material] widget in which to cause ink /// 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 /// otherwise transformed, it will not be able to describe the /// 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 -/// 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.) class TableRowInkWell extends InkResponse { /// Creates an ink well for a table row.