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