diff --git a/lib/pages/connection_page.dart b/lib/pages/connection_page.dart index 3ed69dabc..a38618c3b 100644 --- a/lib/pages/connection_page.dart +++ b/lib/pages/connection_page.dart @@ -24,7 +24,7 @@ class ConnectionPage extends StatefulWidget implements PageShape { PopupMenuButton(itemBuilder: (context) { return [ PopupMenuItem( - child: Text(translate('ID Server')), + child: Text(translate('ID/Relay Server')), value: "server", ), PopupMenuItem( diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index 8773726df..93d4f6420 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -25,7 +25,7 @@ class SettingsPage extends StatelessWidget implements PageShape { title: Text("Common"), tiles: [ SettingsTile.navigation( - title: Text(translate('ID Server')), + title: Text(translate('ID/Relay Server')), leading: Icon(Icons.cloud), onPressed: (context) { showServer(); @@ -71,43 +71,49 @@ void showServer() { var key = ''; DialogManager.show((setState, close) { return CustomAlertDialog( - title: Text(translate('ID Server')), + title: Text(translate('ID/Relay Server')), content: Form( key: formKey, - child: Column(mainAxisSize: MainAxisSize.min, children: [ - TextFormField( - initialValue: id0, - decoration: InputDecoration( - labelText: translate('ID Server'), - ), - validator: validate, - onSaved: (String? value) { - if (value != null) id = value.trim(); - }, - ), - /* - TextFormField( - initialValue: relay0, - decoration: InputDecoration( - labelText: translate('Relay Server'), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + TextFormField( + initialValue: id0, + decoration: InputDecoration( + labelText: translate('ID Server'), + ), + validator: validate, + onSaved: (String? value) { + if (value != null) id = value.trim(); + }, + ) + ] + + (isAndroid + ? [ + TextFormField( + initialValue: relay0, + decoration: InputDecoration( + labelText: translate('Relay Server'), + ), + validator: validate, + onSaved: (String? value) { + if (value != null) relay = value.trim(); + }, + ) + ] + : []) + + [ + TextFormField( + initialValue: key0, + decoration: InputDecoration( + labelText: 'Key', + ), + validator: null, + onSaved: (String? value) { + if (value != null) key = value.trim(); + }, ), - validator: validate, - onSaved: (String value) { - relay = value.trim(); - }, - ), - */ - TextFormField( - initialValue: key0, - decoration: InputDecoration( - labelText: 'Key', - ), - validator: null, - onSaved: (String? value) { - if (value != null) key = value.trim(); - }, - ), - ])), + ])), actions: [ TextButton( style: flatButtonStyle,