mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Add TextInputType.none (#83974)
This commit is contained in:
parent
0825f49ed4
commit
0967a40fca
@ -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.
|
||||
|
@ -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})');
|
||||
|
Loading…
Reference in New Issue
Block a user