From 10eeeba601f595774872ec094797c1c31be6126f Mon Sep 17 00:00:00 2001
From: poka <poka@p2p.legal>
Date: Fri, 22 Jul 2022 22:24:42 +0200
Subject: [PATCH] UI: Improve align of endpoints selection elements

---
 lib/screens/settings.dart | 102 ++++++++++++++++++++++----------------
 1 file changed, 58 insertions(+), 44 deletions(-)

diff --git a/lib/screens/settings.dart b/lib/screens/settings.dart
index 09e0e3db..b817c14e 100644
--- a/lib/screens/settings.dart
+++ b/lib/screens/settings.dart
@@ -107,33 +107,41 @@ class SettingsScreen extends StatelessWidget {
           return Expanded(
             child: Row(children: [
               const SizedBox(width: 10),
-              Text('currencyNode'.tr(args: [currencyName])),
+              SizedBox(
+                width: 100,
+                child: Text(
+                  'currencyNode'.tr(args: [currencyName]),
+                ),
+              ),
               const Spacer(),
               Icon(_sub.nodeConnected && !_sub.isLoadingEndpoint
                   ? Icons.check
                   : Icons.close),
               const Spacer(),
-              Consumer<SettingsProvider>(builder: (context, _set, _) {
-                return DropdownButtonHideUnderline(
-                  child: DropdownButton(
-                    // alignment: AlignmentDirectional.topStart,
-                    value: selectedDuniterEndpoint,
-                    icon: const Icon(Icons.keyboard_arrow_down),
-                    items: duniterBootstrapNodes
-                        .map((NetworkParams _endpointParams) {
-                      return DropdownMenuItem(
-                        value: _endpointParams.endpoint,
-                        child: Text(_endpointParams.endpoint!),
-                      );
-                    }).toList(),
-                    onChanged: (String? _newEndpoint) {
-                      log.d(_newEndpoint!);
-                      selectedDuniterEndpoint = _newEndpoint;
-                      _set.reload();
-                    },
-                  ),
-                );
-              }),
+              SizedBox(
+                width: 265,
+                child: Consumer<SettingsProvider>(builder: (context, _set, _) {
+                  return DropdownButtonHideUnderline(
+                    child: DropdownButton(
+                      // alignment: AlignmentDirectional.topStart,
+                      value: selectedDuniterEndpoint,
+                      icon: const Icon(Icons.keyboard_arrow_down),
+                      items: duniterBootstrapNodes
+                          .map((NetworkParams _endpointParams) {
+                        return DropdownMenuItem(
+                          value: _endpointParams.endpoint,
+                          child: Text(_endpointParams.endpoint!),
+                        );
+                      }).toList(),
+                      onChanged: (String? _newEndpoint) {
+                        log.d(_newEndpoint!);
+                        selectedDuniterEndpoint = _newEndpoint;
+                        _set.reload();
+                      },
+                    ),
+                  );
+                }),
+              ),
               const Spacer(flex: 5),
               _sub.isLoadingEndpoint
                   ? CircularProgressIndicator(color: orangeC)
@@ -235,31 +243,37 @@ class SettingsScreen extends StatelessWidget {
           return Expanded(
             child: Row(children: [
               const SizedBox(width: 10),
-              const Text('Indexer : '),
+              const SizedBox(
+                width: 100,
+                child: Text('Indexer : '),
+              ),
               const Spacer(),
               Icon(indexerEndpoint != '' ? Icons.check : Icons.close),
               const Spacer(),
-              Consumer<SettingsProvider>(builder: (context, _set, _) {
-                return DropdownButtonHideUnderline(
-                  child: DropdownButton(
-                    // alignment: AlignmentDirectional.topStart,
-                    value: selectedIndexerEndpoint,
-                    icon: const Icon(Icons.keyboard_arrow_down),
-                    items:
-                        _indexer.listIndexerEndpoints.map((_indexerEndpoint) {
-                      return DropdownMenuItem(
-                        value: _indexerEndpoint,
-                        child: Text(_indexerEndpoint),
-                      );
-                    }).toList(),
-                    onChanged: (_newEndpoint) {
-                      log.d(_newEndpoint!);
-                      selectedIndexerEndpoint = _newEndpoint.toString();
-                      _set.reload();
-                    },
-                  ),
-                );
-              }),
+              SizedBox(
+                width: 265,
+                child: Consumer<SettingsProvider>(builder: (context, _set, _) {
+                  return DropdownButtonHideUnderline(
+                    child: DropdownButton(
+                      // alignment: AlignmentDirectional.topStart,
+                      value: selectedIndexerEndpoint,
+                      icon: const Icon(Icons.keyboard_arrow_down),
+                      items:
+                          _indexer.listIndexerEndpoints.map((_indexerEndpoint) {
+                        return DropdownMenuItem(
+                          value: _indexerEndpoint,
+                          child: Text(_indexerEndpoint),
+                        );
+                      }).toList(),
+                      onChanged: (_newEndpoint) {
+                        log.d(_newEndpoint!);
+                        selectedIndexerEndpoint = _newEndpoint.toString();
+                        _set.reload();
+                      },
+                    ),
+                  );
+                }),
+              ),
               const Spacer(flex: 5),
               _indexer.isLoadingIndexer
                   ? CircularProgressIndicator(color: orangeC)
-- 
GitLab