Skip to content

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

make errorText of DialogTextField selectable (#11013)

21pages171d178b09ce
diff --git a/flutter/lib/common/widgets/dialog.dart b/flutter/lib/common/widgets/dialog.dart
index 135d28c1d..345a140ad 100644
--- a/flutter/lib/common/widgets/dialog.dart
+++ b/flutter/lib/common/widgets/dialog.dart
@@ -412,24 +412,38 @@ class DialogTextField extends StatelessWidget {
return Row(
children: [
Expanded(
- child: TextField(
- decoration: InputDecoration(
- labelText: title,
- hintText: hintText,
- prefixIcon: prefixIcon,
- suffixIcon: suffixIcon,
- helperText: helperText,
- helperMaxLines: 8,
- errorText: errorText,
- errorMaxLines: 8,
- ),
- controller: controller,
- focusNode: focusNode,
- autofocus: true,
- obscureText: obscureText,
- keyboardType: keyboardType,
- inputFormatters: inputFormatters,
- maxLength: maxLength,
+ child: Column(
+ children: [
+ TextField(
+ decoration: InputDecoration(
+ labelText: title,
+ hintText: hintText,
+ prefixIcon: prefixIcon,
+ suffixIcon: suffixIcon,
+ helperText: helperText,
+ helperMaxLines: 8,
+ ),
+ controller: controller,
+ focusNode: focusNode,
+ autofocus: true,
+ obscureText: obscureText,
+ keyboardType: keyboardType,
+ inputFormatters: inputFormatters,
+ maxLength: maxLength,
+ ),
+ if (errorText != null)
+ Align(
+ alignment: Alignment.centerLeft,
+ child: SelectableText(
+ errorText!,
+ style: TextStyle(
+ color: Theme.of(context).colorScheme.error,
+ fontSize: 12,
+ ),
+ textAlign: TextAlign.left,
+ ).paddingOnly(top: 8, left: 12),
+ ),
+ ],
).workaroundFreezeLinuxMint(),
),
],