Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
24c62662
Unverified
Commit
24c62662
authored
Nov 05, 2020
by
LongCatIsLooong
Committed by
GitHub
Nov 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adaptive constructor / TextInputAction docs (#69346)
parent
cfcb9887
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
72 deletions
+34
-72
text_field.dart
packages/flutter/lib/src/cupertino/text_field.dart
+3
-3
slider.dart
packages/flutter/lib/src/material/slider.dart
+4
-0
switch.dart
packages/flutter/lib/src/material/switch.dart
+10
-4
switch_list_tile.dart
packages/flutter/lib/src/material/switch_list_tile.dart
+7
-3
text_field.dart
packages/flutter/lib/src/material/text_field.dart
+3
-3
text_input.dart
packages/flutter/lib/src/services/text_input.dart
+7
-2
editable_text.dart
packages/flutter/lib/src/widgets/editable_text.dart
+0
-57
No files found.
packages/flutter/lib/src/cupertino/text_field.dart
View file @
24c62662
...
...
@@ -506,9 +506,9 @@ class CupertinoTextField extends StatefulWidget {
///
/// See also:
///
/// * [
EditableText.onSubmitted] for an example of how to handle moving to
///
the next/previous field when using [TextInputAction.next] and
///
[TextInputAction.previous] for [textInputAction]
.
/// * [
TextInputAction.next] and [TextInputAction.previous], which
///
automatically shift the focus to the next/previous focusable item when
///
the user is done editing
.
final
ValueChanged
<
String
>?
onSubmitted
;
/// {@macro flutter.widgets.editableText.inputFormatters}
...
...
packages/flutter/lib/src/material/slider.dart
View file @
24c62662
...
...
@@ -167,6 +167,10 @@ class Slider extends StatefulWidget {
assert
(
divisions
==
null
||
divisions
>
0
),
super
(
key:
key
);
/// Creates an adaptive [Slider] based on the target platform, following
/// Material design's
/// [Cross-platform guidelines](https://material.io/design/platform-guidance/cross-platform-adaptation.html).
///
/// Creates a [CupertinoSlider] if the target platform is iOS, creates a
/// Material Design slider otherwise.
///
...
...
packages/flutter/lib/src/material/switch.dart
View file @
24c62662
...
...
@@ -90,11 +90,17 @@ class Switch extends StatefulWidget {
assert
(
inactiveThumbImage
!=
null
||
onInactiveThumbImageError
==
null
),
super
(
key:
key
);
/// Creates a [CupertinoSwitch] if the target platform is iOS, creates a
/// material design switch otherwise.
/// Creates an adaptive [Switch] based on whether the target platform is iOS
/// or macOS, following Material design's
/// [Cross-platform guidelines](https://material.io/design/platform-guidance/cross-platform-adaptation.html).
///
/// If a [CupertinoSwitch] is created, the following parameters are
/// ignored: [activeTrackColor], [inactiveThumbColor], [inactiveTrackColor],
/// On iOS and macOS, this constructor creates a [CupertinoSwitch], which has
/// matching functionality and presentation as Material switches, and are the
/// graphics expected on iOS. On other platforms, this creates a Material
/// design [Switch].
///
/// If a [CupertinoSwitch] is created, the following parameters are ignored:
/// [activeTrackColor], [inactiveThumbColor], [inactiveTrackColor],
/// [activeThumbImage], [onActiveThumbImageError], [inactiveThumbImage],
/// [onInactiveThumbImageError], [materialTapTargetSize].
///
...
...
packages/flutter/lib/src/material/switch_list_tile.dart
View file @
24c62662
...
...
@@ -284,10 +284,14 @@ class SwitchListTile extends StatelessWidget {
assert
(
autofocus
!=
null
),
super
(
key:
key
);
/// Creates the wrapped switch with [Switch.adaptive].
/// Creates a Material [ListTile] with an adaptive [Switch], following
/// Material design's
/// [Cross-platform guidelines](https://material.io/design/platform-guidance/cross-platform-adaptation.html).
///
/// Creates a [CupertinoSwitch] if the target platform is iOS, creates a
/// material design switch otherwise.
/// This widget uses [Switch.adaptive] to change the graphics of the switch
/// component based on the ambient [ThemeData.platform]. On iOS and macOS, a
/// [CupertinoSwitch] will be used. On other platforms a Material design
/// [Switch] will be used.
///
/// If a [CupertinoSwitch] is created, the following parameters are
/// ignored: [activeTrackColor], [inactiveThumbColor], [inactiveTrackColor],
...
...
packages/flutter/lib/src/material/text_field.dart
View file @
24c62662
...
...
@@ -613,9 +613,9 @@ class TextField extends StatefulWidget {
///
/// See also:
///
/// * [
EditableText.onSubmitted] for an example of how to handle moving to
///
the next/previous field when using [TextInputAction.next] and
///
[TextInputAction.previous] for [textInputAction]
.
/// * [
TextInputAction.next] and [TextInputAction.previous], which
///
automatically shift the focus to the next/previous focusable item when
///
the user is done editing
.
final
ValueChanged
<
String
>?
onSubmitted
;
/// {@macro flutter.widgets.editableText.onAppPrivateCommand}
...
...
packages/flutter/lib/src/services/text_input.dart
View file @
24c62662
...
...
@@ -225,8 +225,9 @@ class TextInputType {
///
/// Despite the logical meaning of each action, choosing a particular
/// [TextInputAction] does not necessarily cause any specific behavior to
/// happen. It is up to the developer to ensure that the behavior that occurs
/// when an action button is pressed is appropriate for the action button chosen.
/// happen, other than changing the focus when approapriate. It is up to the
/// developer to ensure that the behavior that occurs when an action button is
/// pressed is appropriate for the action button chosen.
///
/// For example: If the user presses the keyboard action button on iOS when it
/// reads "Emergency Call", the result should not be a focus change to the next
...
...
@@ -314,6 +315,8 @@ enum TextInputAction {
/// Logical meaning: The user is done with the current input source and wants
/// to move to the next one.
///
/// Moves the focus to the next focusable item in the same [FocusScope].
///
/// Android: Corresponds to Android's "IME_ACTION_NEXT". The OS displays a
/// button that represents moving forward, e.g., a right-facing arrow button.
///
...
...
@@ -324,6 +327,8 @@ enum TextInputAction {
/// Logical meaning: The user wishes to return to the previous input source
/// in the group, e.g., a form with multiple [TextField]s.
///
/// Moves the focus to the previous focusable item in the same [FocusScope].
///
/// Android: Corresponds to Android's "IME_ACTION_PREVIOUS". The OS displays a
/// button that represents moving backward, e.g., a left-facing arrow button.
///
...
...
packages/flutter/lib/src/widgets/editable_text.dart
View file @
24c62662
...
...
@@ -1021,63 +1021,6 @@ class EditableText extends StatefulWidget {
/// Called when the user indicates that they are done editing the text in the
/// field.
/// {@endtemplate}
///
/// {@tool dartpad --template=stateful_widget_material}
/// When a non-completion action is pressed, such as "next" or "previous", it
/// is often desirable to move the focus to the next or previous field. To do
/// this, handle it as in this example, by calling [FocusNode.nextFocus] in
/// the `onFieldSubmitted` callback of [TextFormField]. ([TextFormField] wraps
/// [EditableText] internally, and uses the value of `onFieldSubmitted` as its
/// [onSubmitted]).
///
/// ```dart
/// FocusScopeNode _focusScopeNode = FocusScopeNode();
/// final _controller1 = TextEditingController();
/// final _controller2 = TextEditingController();
///
/// void dispose() {
/// _focusScopeNode.dispose();
/// _controller1.dispose();
/// _controller2.dispose();
/// super.dispose();
/// }
///
/// void _handleSubmitted(String value) {
/// _focusScopeNode.nextFocus();
/// }
///
/// Widget build(BuildContext context) {
/// return Scaffold(
/// body: FocusScope(
/// node: _focusScopeNode,
/// child: Column(
/// mainAxisAlignment: MainAxisAlignment.center,
/// children: <Widget>[
/// Padding(
/// padding: const EdgeInsets.all(8.0),
/// child: TextFormField(
/// textInputAction: TextInputAction.next,
/// onFieldSubmitted: _handleSubmitted,
/// controller: _controller1,
/// decoration: InputDecoration(border: OutlineInputBorder()),
/// ),
/// ),
/// Padding(
/// padding: const EdgeInsets.all(8.0),
/// child: TextFormField(
/// textInputAction: TextInputAction.next,
/// onFieldSubmitted: _handleSubmitted,
/// controller: _controller2,
/// decoration: InputDecoration(border: OutlineInputBorder()),
/// ),
/// ),
/// ],
/// ),
/// ),
/// );
/// }
/// ```
/// {@end-tool}
final
ValueChanged
<
String
>?
onSubmitted
;
/// {@template flutter.widgets.editableText.onAppPrivateCommand}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment