Unverified Commit 0967a40f authored by J-P Nurmi's avatar J-P Nurmi Committed by GitHub

Add TextInputType.none (#83974)

parent 0825f49e
......@@ -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})');
......
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