mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-15 14:32:48 +00:00
Added refresh button on dns settings
This commit is contained in:
parent
42495c8bab
commit
39fa5298f8
1 changed files with 10 additions and 2 deletions
|
@ -43,8 +43,8 @@ class DnsSettingsWidget extends StatefulWidget {
|
||||||
|
|
||||||
class _DnsSettingsWidgetState extends State<DnsSettingsWidget> {
|
class _DnsSettingsWidgetState extends State<DnsSettingsWidget> {
|
||||||
|
|
||||||
void fetchData() async {
|
void fetchData({bool? showRefreshIndicator}) async {
|
||||||
widget.serversProvider.setDnsInfoLoadStatus(0, false);
|
widget.serversProvider.setDnsInfoLoadStatus(0, showRefreshIndicator ?? false);
|
||||||
|
|
||||||
final result = await getDnsInfo(server: widget.serversProvider.selectedServer!);
|
final result = await getDnsInfo(server: widget.serversProvider.selectedServer!);
|
||||||
|
|
||||||
|
@ -182,6 +182,14 @@ class _DnsSettingsWidgetState extends State<DnsSettingsWidget> {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(AppLocalizations.of(context)!.dnsSettings),
|
title: Text(AppLocalizations.of(context)!.dnsSettings),
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () => fetchData(showRefreshIndicator: true),
|
||||||
|
icon: const Icon(Icons.refresh_rounded),
|
||||||
|
tooltip: AppLocalizations.of(context)!.refresh,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
body: generateBody(),
|
body: generateBody(),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue