From 9ca99183bfbae03122b2f3ad120a89792bcc0fec Mon Sep 17 00:00:00 2001 From: rustdesk Date: Wed, 17 Jun 2026 21:34:59 +0800 Subject: [PATCH] remove literalInput --- flutter/lib/common/widgets/dialog.dart | 14 +--------- flutter/test/dialog_text_field_test.dart | 35 ------------------------ 2 files changed, 1 insertion(+), 48 deletions(-) delete mode 100644 flutter/test/dialog_text_field_test.dart diff --git a/flutter/lib/common/widgets/dialog.dart b/flutter/lib/common/widgets/dialog.dart index 631b61078..7534fb2a1 100644 --- a/flutter/lib/common/widgets/dialog.dart +++ b/flutter/lib/common/widgets/dialog.dart @@ -393,7 +393,6 @@ class DialogTextField extends StatelessWidget { final TextInputType? keyboardType; final List? inputFormatters; final int? maxLength; - final bool literalInput; static const kUsernameTitle = 'Username'; static const kUsernameIcon = Icon(Icons.account_circle_outlined); @@ -412,7 +411,6 @@ class DialogTextField extends StatelessWidget { this.keyboardType, this.inputFormatters, this.maxLength, - this.literalInput = false, required this.title, required this.controller}) : super(key: key); @@ -437,17 +435,7 @@ class DialogTextField extends StatelessWidget { focusNode: focusNode, autofocus: true, obscureText: obscureText, - 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, + keyboardType: keyboardType, inputFormatters: inputFormatters, maxLength: maxLength, ), diff --git a/flutter/test/dialog_text_field_test.dart b/flutter/test/dialog_text_field_test.dart deleted file mode 100644 index 40ebd770f..000000000 --- a/flutter/test/dialog_text_field_test.dart +++ /dev/null @@ -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(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(), - ); - }); -}