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
0967a40f
Unverified
Commit
0967a40f
authored
Jun 29, 2021
by
J-P Nurmi
Committed by
GitHub
Jun 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add TextInputType.none (#83974)
parent
0825f49e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
text_input.dart
packages/flutter/lib/src/services/text_input.dart
+5
-2
text_input_test.dart
packages/flutter/test/services/text_input_test.dart
+2
-0
No files found.
packages/flutter/lib/src/services/text_input.dart
View file @
0967a40f
...
...
@@ -174,14 +174,17 @@ class TextInputType {
/// [TYPE_TEXT_VARIATION_POSTAL_ADDRESS](https://developer.android.com/reference/android/text/InputType#TYPE_TEXT_VARIATION_POSTAL_ADDRESS).
static
const
TextInputType
streetAddress
=
TextInputType
.
_
(
9
);
/// Prevent the OS from showing the on-screen virtual keyboard.
static
const
TextInputType
none
=
TextInputType
.
_
(
10
);
/// All possible enum values.
static
const
List
<
TextInputType
>
values
=
<
TextInputType
>[
text
,
multiline
,
number
,
phone
,
datetime
,
emailAddress
,
url
,
visiblePassword
,
name
,
streetAddress
,
text
,
multiline
,
number
,
phone
,
datetime
,
emailAddress
,
url
,
visiblePassword
,
name
,
streetAddress
,
none
,
];
// Corresponding string name for each of the [values].
static
const
List
<
String
>
_names
=
<
String
>[
'text'
,
'multiline'
,
'number'
,
'phone'
,
'datetime'
,
'emailAddress'
,
'url'
,
'visiblePassword'
,
'name'
,
'address'
,
'text'
,
'multiline'
,
'number'
,
'phone'
,
'datetime'
,
'emailAddress'
,
'url'
,
'visiblePassword'
,
'name'
,
'address'
,
'none'
,
];
// Enum value name, this is what enum.toString() would normally return.
...
...
packages/flutter/test/services/text_input_test.dart
View file @
0967a40f
...
...
@@ -154,6 +154,7 @@ void main() {
expect
(
TextInputType
.
visiblePassword
.
toString
(),
'TextInputType(name: TextInputType.visiblePassword, signed: null, decimal: null)'
);
expect
(
TextInputType
.
name
.
toString
(),
'TextInputType(name: TextInputType.name, signed: null, decimal: null)'
);
expect
(
TextInputType
.
streetAddress
.
toString
(),
'TextInputType(name: TextInputType.address, signed: null, decimal: null)'
);
expect
(
TextInputType
.
none
.
toString
(),
'TextInputType(name: TextInputType.none, signed: null, decimal: null)'
);
expect
(
text
==
number
,
false
);
expect
(
number
==
number2
,
true
);
...
...
@@ -181,6 +182,7 @@ void main() {
expect
(
TextInputType
.
visiblePassword
.
index
,
7
);
expect
(
TextInputType
.
name
.
index
,
8
);
expect
(
TextInputType
.
streetAddress
.
index
,
9
);
expect
(
TextInputType
.
none
.
index
,
10
);
expect
(
TextEditingValue
.
empty
.
toString
(),
'TextEditingValue(text:
\
u2524
\
u251C, selection:
${const TextSelection.collapsed(offset: -1)}
, composing:
${TextRange.empty}
)'
);
...
...
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