mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-07-05 23:04:59 +03:00
remove literalInput
This commit is contained in:
@@ -393,7 +393,6 @@ class DialogTextField extends StatelessWidget {
|
|||||||
final TextInputType? keyboardType;
|
final TextInputType? keyboardType;
|
||||||
final List<TextInputFormatter>? inputFormatters;
|
final List<TextInputFormatter>? inputFormatters;
|
||||||
final int? maxLength;
|
final int? maxLength;
|
||||||
final bool literalInput;
|
|
||||||
|
|
||||||
static const kUsernameTitle = 'Username';
|
static const kUsernameTitle = 'Username';
|
||||||
static const kUsernameIcon = Icon(Icons.account_circle_outlined);
|
static const kUsernameIcon = Icon(Icons.account_circle_outlined);
|
||||||
@@ -412,7 +411,6 @@ class DialogTextField extends StatelessWidget {
|
|||||||
this.keyboardType,
|
this.keyboardType,
|
||||||
this.inputFormatters,
|
this.inputFormatters,
|
||||||
this.maxLength,
|
this.maxLength,
|
||||||
this.literalInput = false,
|
|
||||||
required this.title,
|
required this.title,
|
||||||
required this.controller})
|
required this.controller})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
@@ -437,17 +435,7 @@ class DialogTextField extends StatelessWidget {
|
|||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
obscureText: obscureText,
|
obscureText: obscureText,
|
||||||
keyboardType: keyboardType ??
|
keyboardType: keyboardType,
|
||||||
(literalInput ? TextInputType.visiblePassword : null),
|
|
||||||
textCapitalization: TextCapitalization.none,
|
|
||||||
autocorrect: !literalInput,
|
|
||||||
enableSuggestions: !literalInput,
|
|
||||||
smartDashesType: literalInput ? SmartDashesType.disabled : null,
|
|
||||||
smartQuotesType: literalInput ? SmartQuotesType.disabled : null,
|
|
||||||
enableIMEPersonalizedLearning: !literalInput,
|
|
||||||
spellCheckConfiguration: literalInput
|
|
||||||
? const SpellCheckConfiguration.disabled()
|
|
||||||
: null,
|
|
||||||
inputFormatters: inputFormatters,
|
inputFormatters: inputFormatters,
|
||||||
maxLength: maxLength,
|
maxLength: maxLength,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
|
||||||
import 'package:flutter_hbb/common/widgets/dialog.dart';
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
testWidgets('DialogTextField can preserve literal input', (tester) async {
|
|
||||||
final controller = TextEditingController(text: 'P@ss1c1E=');
|
|
||||||
addTearDown(controller.dispose);
|
|
||||||
|
|
||||||
await tester.pumpWidget(MaterialApp(
|
|
||||||
home: Scaffold(
|
|
||||||
body: DialogTextField(
|
|
||||||
title: 'Password',
|
|
||||||
controller: controller,
|
|
||||||
literalInput: true,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
));
|
|
||||||
|
|
||||||
final textField = tester.widget<TextField>(find.byType(TextField));
|
|
||||||
|
|
||||||
expect(textField.controller, controller);
|
|
||||||
expect(textField.keyboardType, TextInputType.visiblePassword);
|
|
||||||
expect(textField.textCapitalization, TextCapitalization.none);
|
|
||||||
expect(textField.autocorrect, isFalse);
|
|
||||||
expect(textField.enableSuggestions, isFalse);
|
|
||||||
expect(textField.smartDashesType, SmartDashesType.disabled);
|
|
||||||
expect(textField.smartQuotesType, SmartQuotesType.disabled);
|
|
||||||
expect(textField.enableIMEPersonalizedLearning, isFalse);
|
|
||||||
expect(
|
|
||||||
textField.spellCheckConfiguration,
|
|
||||||
const SpellCheckConfiguration.disabled(),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user