improve doh ui
This commit is contained in:
@@ -145,14 +145,16 @@ class DohSettingsScreen extends HookConsumerWidget {
|
|||||||
child: RadioListTile(
|
child: RadioListTile(
|
||||||
value: true,
|
value: true,
|
||||||
enabled: false,
|
enabled: false,
|
||||||
title: Column(
|
title: Form(
|
||||||
children: [
|
|
||||||
const Text('Custom'),
|
|
||||||
Form(
|
|
||||||
key: formKey,
|
key: formKey,
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: customProviderController,
|
controller: customProviderController,
|
||||||
keyboardType: TextInputType.url,
|
keyboardType: TextInputType.url,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
label: Text('Custom Resolver URL'),
|
||||||
|
hintText: 'https://example.com/dns-query',
|
||||||
|
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||||
|
),
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
return validateUrl(
|
return validateUrl(
|
||||||
value,
|
value,
|
||||||
@@ -163,9 +165,7 @@ class DohSettingsScreen extends HookConsumerWidget {
|
|||||||
onSaved: (newProvider) async {
|
onSaved: (newProvider) async {
|
||||||
if (newProvider != null) {
|
if (newProvider != null) {
|
||||||
await ref
|
await ref
|
||||||
.read(
|
.read(saveEngineSettingsControllerProvider.notifier)
|
||||||
saveEngineSettingsControllerProvider.notifier,
|
|
||||||
)
|
|
||||||
.save(
|
.save(
|
||||||
(currentSettings) => currentSettings.copyWith
|
(currentSettings) => currentSettings.copyWith
|
||||||
.dohProviderUrl(newProvider),
|
.dohProviderUrl(newProvider),
|
||||||
@@ -179,8 +179,6 @@ class DohSettingsScreen extends HookConsumerWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user