UI: Improve align of endpoints selection elements
This commit is contained in:
parent
a7d2e9a5d2
commit
10eeeba601
|
@ -107,33 +107,41 @@ class SettingsScreen extends StatelessWidget {
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text('currencyNode'.tr(args: [currencyName])),
|
SizedBox(
|
||||||
|
width: 100,
|
||||||
|
child: Text(
|
||||||
|
'currencyNode'.tr(args: [currencyName]),
|
||||||
|
),
|
||||||
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
Icon(_sub.nodeConnected && !_sub.isLoadingEndpoint
|
Icon(_sub.nodeConnected && !_sub.isLoadingEndpoint
|
||||||
? Icons.check
|
? Icons.check
|
||||||
: Icons.close),
|
: Icons.close),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
Consumer<SettingsProvider>(builder: (context, _set, _) {
|
SizedBox(
|
||||||
return DropdownButtonHideUnderline(
|
width: 265,
|
||||||
child: DropdownButton(
|
child: Consumer<SettingsProvider>(builder: (context, _set, _) {
|
||||||
// alignment: AlignmentDirectional.topStart,
|
return DropdownButtonHideUnderline(
|
||||||
value: selectedDuniterEndpoint,
|
child: DropdownButton(
|
||||||
icon: const Icon(Icons.keyboard_arrow_down),
|
// alignment: AlignmentDirectional.topStart,
|
||||||
items: duniterBootstrapNodes
|
value: selectedDuniterEndpoint,
|
||||||
.map((NetworkParams _endpointParams) {
|
icon: const Icon(Icons.keyboard_arrow_down),
|
||||||
return DropdownMenuItem(
|
items: duniterBootstrapNodes
|
||||||
value: _endpointParams.endpoint,
|
.map((NetworkParams _endpointParams) {
|
||||||
child: Text(_endpointParams.endpoint!),
|
return DropdownMenuItem(
|
||||||
);
|
value: _endpointParams.endpoint,
|
||||||
}).toList(),
|
child: Text(_endpointParams.endpoint!),
|
||||||
onChanged: (String? _newEndpoint) {
|
);
|
||||||
log.d(_newEndpoint!);
|
}).toList(),
|
||||||
selectedDuniterEndpoint = _newEndpoint;
|
onChanged: (String? _newEndpoint) {
|
||||||
_set.reload();
|
log.d(_newEndpoint!);
|
||||||
},
|
selectedDuniterEndpoint = _newEndpoint;
|
||||||
),
|
_set.reload();
|
||||||
);
|
},
|
||||||
}),
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
const Spacer(flex: 5),
|
const Spacer(flex: 5),
|
||||||
_sub.isLoadingEndpoint
|
_sub.isLoadingEndpoint
|
||||||
? CircularProgressIndicator(color: orangeC)
|
? CircularProgressIndicator(color: orangeC)
|
||||||
|
@ -235,31 +243,37 @@ class SettingsScreen extends StatelessWidget {
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
const Text('Indexer : '),
|
const SizedBox(
|
||||||
|
width: 100,
|
||||||
|
child: Text('Indexer : '),
|
||||||
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
Icon(indexerEndpoint != '' ? Icons.check : Icons.close),
|
Icon(indexerEndpoint != '' ? Icons.check : Icons.close),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
Consumer<SettingsProvider>(builder: (context, _set, _) {
|
SizedBox(
|
||||||
return DropdownButtonHideUnderline(
|
width: 265,
|
||||||
child: DropdownButton(
|
child: Consumer<SettingsProvider>(builder: (context, _set, _) {
|
||||||
// alignment: AlignmentDirectional.topStart,
|
return DropdownButtonHideUnderline(
|
||||||
value: selectedIndexerEndpoint,
|
child: DropdownButton(
|
||||||
icon: const Icon(Icons.keyboard_arrow_down),
|
// alignment: AlignmentDirectional.topStart,
|
||||||
items:
|
value: selectedIndexerEndpoint,
|
||||||
_indexer.listIndexerEndpoints.map((_indexerEndpoint) {
|
icon: const Icon(Icons.keyboard_arrow_down),
|
||||||
return DropdownMenuItem(
|
items:
|
||||||
value: _indexerEndpoint,
|
_indexer.listIndexerEndpoints.map((_indexerEndpoint) {
|
||||||
child: Text(_indexerEndpoint),
|
return DropdownMenuItem(
|
||||||
);
|
value: _indexerEndpoint,
|
||||||
}).toList(),
|
child: Text(_indexerEndpoint),
|
||||||
onChanged: (_newEndpoint) {
|
);
|
||||||
log.d(_newEndpoint!);
|
}).toList(),
|
||||||
selectedIndexerEndpoint = _newEndpoint.toString();
|
onChanged: (_newEndpoint) {
|
||||||
_set.reload();
|
log.d(_newEndpoint!);
|
||||||
},
|
selectedIndexerEndpoint = _newEndpoint.toString();
|
||||||
),
|
_set.reload();
|
||||||
);
|
},
|
||||||
}),
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
const Spacer(flex: 5),
|
const Spacer(flex: 5),
|
||||||
_indexer.isLoadingIndexer
|
_indexer.isLoadingIndexer
|
||||||
? CircularProgressIndicator(color: orangeC)
|
? CircularProgressIndicator(color: orangeC)
|
||||||
|
|
Loading…
Reference in New Issue