From 0392fc0c847e7af425d25d4bf9976d5f6af9012c Mon Sep 17 00:00:00 2001
From: grummbeer <kde@streber24.de>
Date: Sat, 4 Mar 2023 23:23:10 +0100
Subject: [PATCH] fix. Mobile style of input on "changeId" dialog

---
 flutter/lib/common/widgets/dialog.dart | 52 +++++++++++++-------------
 1 file changed, 27 insertions(+), 25 deletions(-)

diff --git a/flutter/lib/common/widgets/dialog.dart b/flutter/lib/common/widgets/dialog.dart
index cdce6f12a..4e4b24519 100644
--- a/flutter/lib/common/widgets/dialog.dart
+++ b/flutter/lib/common/widgets/dialog.dart
@@ -63,8 +63,9 @@ void changeIdDialog() {
       final Iterable violations = rules.where((r) => !r.validate(newId));
       if (violations.isNotEmpty) {
         setState(() {
-          msg =
-              '${translate('Prompt')}: ${violations.map((r) => r.name).join(', ')}';
+          msg = isDesktop
+              ? '${translate('Prompt')}:  ${violations.map((r) => r.name).join(', ')}'
+              : violations.map((r) => r.name).join(', ');
         });
         return;
       }
@@ -87,7 +88,9 @@ void changeIdDialog() {
       }
       setState(() {
         isInProgress = false;
-        msg = '${translate('Prompt')}: ${translate(status)}';
+        msg = isDesktop
+            ? '${translate('Prompt')}: ${translate(status)}'
+            : translate(status);
       });
     }
 
@@ -103,7 +106,7 @@ void changeIdDialog() {
           TextField(
             decoration: InputDecoration(
                 labelText: translate('Your new ID'),
-                border: const OutlineInputBorder(),
+                border: isDesktop ? const OutlineInputBorder() : null,
                 errorText: msg.isEmpty ? null : translate(msg),
                 suffixText: '${rxId.value.length}/16',
                 suffixStyle: const TextStyle(fontSize: 12, color: Colors.grey)),
@@ -123,27 +126,26 @@ void changeIdDialog() {
           const SizedBox(
             height: 8.0,
           ),
-          Obx(() => Wrap(
-                runSpacing: 8,
-                spacing: 4,
-                children: rules.map((e) {
-                  var checked = e.validate(rxId.value);
-                  return Chip(
-                      label: Text(
-                        e.name,
-                        style: TextStyle(
-                            color: checked
-                                ? const Color(0xFF0A9471)
-                                : Color.fromARGB(255, 198, 86, 157)),
-                      ),
-                      backgroundColor: checked
-                          ? const Color(0xFFD0F7ED)
-                          : Color.fromARGB(255, 247, 205, 232));
-                }).toList(),
-              )),
-          const SizedBox(
-            height: 8.0,
-          ),
+          isDesktop
+              ? Obx(() => Wrap(
+                    runSpacing: 8,
+                    spacing: 4,
+                    children: rules.map((e) {
+                      var checked = e.validate(rxId.value);
+                      return Chip(
+                          label: Text(
+                            e.name,
+                            style: TextStyle(
+                                color: checked
+                                    ? const Color(0xFF0A9471)
+                                    : Color.fromARGB(255, 198, 86, 157)),
+                          ),
+                          backgroundColor: checked
+                              ? const Color(0xFFD0F7ED)
+                              : Color.fromARGB(255, 247, 205, 232));
+                    }).toList(),
+                  )).marginOnly(bottom: 8)
+              : SizedBox.shrink(),
           Offstage(
               offstage: !isInProgress, child: const LinearProgressIndicator())
         ],