Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fixing https://github.com/rustdesk/rustdesk/issues/15293

rustdeskbf206dc309fd
diff --git a/flutter/lib/mobile/widgets/dialog.dart b/flutter/lib/mobile/widgets/dialog.dart
index 8b645bb88..f1ff8550f 100644
--- a/flutter/lib/mobile/widgets/dialog.dart
+++ b/flutter/lib/mobile/widgets/dialog.dart
@@ -117,13 +117,13 @@ void showServerSettingsWithValue(
),
SizedBox(width: 8),
Expanded(
- child: TextFormField(
+ child: serverSettingsTextFormField(
+ label: label,
controller: controller,
- decoration: InputDecoration(
- errorText: errorMsg.isEmpty ? null : errorMsg,
- contentPadding:
- EdgeInsets.symmetric(horizontal: 8, vertical: 12),
- ),
+ errorMsg: errorMsg,
+ contentPadding:
+ EdgeInsets.symmetric(horizontal: 8, vertical: 12),
+ showLabelText: false,
validator: validator,
autofocus: autofocus,
).workaroundFreezeLinuxMint(),
@@ -132,12 +132,10 @@ void showServerSettingsWithValue(
);
}
- return TextFormField(
+ return serverSettingsTextFormField(
+ label: label,
controller: controller,
- decoration: InputDecoration(
- labelText: label,
- errorText: errorMsg.isEmpty ? null : errorMsg,
- ),
+ errorMsg: errorMsg,
validator: validator,
).workaroundFreezeLinuxMint();
}
@@ -209,6 +207,35 @@ void showServerSettingsWithValue(
});
}
+TextFormField serverSettingsTextFormField({
+ required String label,
+ required TextEditingController controller,
+ required String errorMsg,
+ String? Function(String?)? validator,
+ bool autofocus = false,
+ bool showLabelText = true,
+ EdgeInsetsGeometry? contentPadding,
+}) {
+ return TextFormField(
+ controller: controller,
+ decoration: InputDecoration(
+ labelText: showLabelText ? label : null,
+ errorText: errorMsg.isEmpty ? null : errorMsg,
+ contentPadding: contentPadding,
+ ),
+ validator: validator,
+ autofocus: autofocus,
+ keyboardType: TextInputType.visiblePassword,
+ textCapitalization: TextCapitalization.none,
+ autocorrect: false,
+ enableSuggestions: false,
+ smartDashesType: SmartDashesType.disabled,
+ smartQuotesType: SmartQuotesType.disabled,
+ enableIMEPersonalizedLearning: false,
+ spellCheckConfiguration: const SpellCheckConfiguration.disabled(),
+ );
+}
+
void setPrivacyModeDialog(
OverlayDialogManager dialogManager,
List<TToggleMenu> privacyModeList,