mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-27 09:16:07 +00:00
Fixed scrolling issue on some screens
This commit is contained in:
parent
df4564e975
commit
9aa79806a9
2 changed files with 128 additions and 162 deletions
|
@ -294,35 +294,25 @@ class LogDetailsScreen extends StatelessWidget {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: NestedScrollView(
|
appBar: AppBar(
|
||||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
centerTitle: false,
|
||||||
SliverOverlapAbsorber(
|
title: Text(AppLocalizations.of(context)!.logDetails),
|
||||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
actions: [
|
||||||
sliver: SliverAppBar(
|
if (serversProvider.filteringStatus != null) IconButton(
|
||||||
pinned: true,
|
onPressed: () => blockUnblock(log, getFilteredStatus(context, appConfigProvider, log.reason, true)['filtered'] == true ? 'unblock' : 'block'),
|
||||||
floating: true,
|
icon: Icon(
|
||||||
centerTitle: false,
|
getFilteredStatus(context, appConfigProvider, log.reason, true)['filtered'] == true
|
||||||
forceElevated: innerBoxIsScrolled,
|
? Icons.check_circle_rounded
|
||||||
title: Text(AppLocalizations.of(context)!.logDetails),
|
: Icons.block
|
||||||
actions: [
|
|
||||||
if (serversProvider.filteringStatus != null) IconButton(
|
|
||||||
onPressed: () => blockUnblock(log, getFilteredStatus(context, appConfigProvider, log.reason, true)['filtered'] == true ? 'unblock' : 'block'),
|
|
||||||
icon: Icon(
|
|
||||||
getFilteredStatus(context, appConfigProvider, log.reason, true)['filtered'] == true
|
|
||||||
? Icons.check_circle_rounded
|
|
||||||
: Icons.block
|
|
||||||
),
|
|
||||||
tooltip: getFilteredStatus(context, appConfigProvider, log.reason, true)['filtered'] == true
|
|
||||||
? AppLocalizations.of(context)!.unblockDomain
|
|
||||||
: AppLocalizations.of(context)!.blockDomain,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
)
|
tooltip: getFilteredStatus(context, appConfigProvider, log.reason, true)['filtered'] == true
|
||||||
|
? AppLocalizations.of(context)!.unblockDomain
|
||||||
|
: AppLocalizations.of(context)!.blockDomain,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10)
|
||||||
],
|
],
|
||||||
body: content(),
|
|
||||||
),
|
),
|
||||||
|
body: content(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,143 +109,119 @@ class _GeneralSettingsState extends State<GeneralSettings> {
|
||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: NestedScrollView(
|
appBar: AppBar(
|
||||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
title: Text(AppLocalizations.of(context)!.generalSettings),
|
||||||
SliverOverlapAbsorber(
|
),
|
||||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
body: ListView(
|
||||||
sliver: SliverAppBar(
|
children: [
|
||||||
pinned: true,
|
SectionLabel(label: AppLocalizations.of(context)!.home),
|
||||||
floating: true,
|
CustomListTile(
|
||||||
centerTitle: false,
|
icon: Icons.exposure_zero_rounded,
|
||||||
forceElevated: innerBoxIsScrolled,
|
title: AppLocalizations.of(context)!.hideZeroValues,
|
||||||
title: Text(AppLocalizations.of(context)!.generalSettings),
|
subtitle: AppLocalizations.of(context)!.hideZeroValuesDescription,
|
||||||
)
|
trailing: Switch(
|
||||||
)
|
value: appConfigProvider.hideZeroValues,
|
||||||
],
|
onChanged: (value) => updateSettings(
|
||||||
body: SafeArea(
|
newStatus: value,
|
||||||
top: false,
|
function: appConfigProvider.setHideZeroValues
|
||||||
bottom: false,
|
),
|
||||||
child: Builder(
|
|
||||||
builder: (context) => CustomScrollView(
|
|
||||||
slivers: [
|
|
||||||
SliverOverlapInjector(
|
|
||||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
|
||||||
),
|
|
||||||
SliverList.list(
|
|
||||||
children: [
|
|
||||||
SectionLabel(label: AppLocalizations.of(context)!.home),
|
|
||||||
CustomListTile(
|
|
||||||
icon: Icons.exposure_zero_rounded,
|
|
||||||
title: AppLocalizations.of(context)!.hideZeroValues,
|
|
||||||
subtitle: AppLocalizations.of(context)!.hideZeroValuesDescription,
|
|
||||||
trailing: Switch(
|
|
||||||
value: appConfigProvider.hideZeroValues,
|
|
||||||
onChanged: (value) => updateSettings(
|
|
||||||
newStatus: value,
|
|
||||||
function: appConfigProvider.setHideZeroValues
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () => updateSettings(
|
|
||||||
newStatus: !appConfigProvider.hideZeroValues,
|
|
||||||
function: appConfigProvider.setHideZeroValues
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
top: 10,
|
|
||||||
bottom: 10,
|
|
||||||
left: 16,
|
|
||||||
right: 10
|
|
||||||
)
|
|
||||||
),
|
|
||||||
CustomListTile(
|
|
||||||
icon: Icons.show_chart_rounded,
|
|
||||||
title: AppLocalizations.of(context)!.combinedChart,
|
|
||||||
subtitle: AppLocalizations.of(context)!.combinedChartDescription,
|
|
||||||
trailing: Switch(
|
|
||||||
value: appConfigProvider.combinedChartHome,
|
|
||||||
onChanged: (value) => updateSettings(
|
|
||||||
newStatus: value,
|
|
||||||
function: appConfigProvider.setCombinedChartHome
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () => updateSettings(
|
|
||||||
newStatus: !appConfigProvider.combinedChartHome,
|
|
||||||
function: appConfigProvider.setCombinedChartHome
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
top: 10,
|
|
||||||
bottom: 10,
|
|
||||||
left: 16,
|
|
||||||
right: 10
|
|
||||||
)
|
|
||||||
),
|
|
||||||
SectionLabel(label: AppLocalizations.of(context)!.logs),
|
|
||||||
CustomListTile(
|
|
||||||
icon: Icons.timer_rounded,
|
|
||||||
title: AppLocalizations.of(context)!.timeLogs,
|
|
||||||
subtitle: AppLocalizations.of(context)!.timeLogsDescription,
|
|
||||||
trailing: Switch(
|
|
||||||
value: appConfigProvider.showTimeLogs,
|
|
||||||
onChanged: (value) => updateSettings(
|
|
||||||
newStatus: value,
|
|
||||||
function: appConfigProvider.setshowTimeLogs
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () => updateSettings(
|
|
||||||
newStatus: !appConfigProvider.showTimeLogs,
|
|
||||||
function: appConfigProvider.setshowTimeLogs
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
top: 10,
|
|
||||||
bottom: 10,
|
|
||||||
left: 16,
|
|
||||||
right: 10
|
|
||||||
)
|
|
||||||
),
|
|
||||||
CustomListTile(
|
|
||||||
icon: Icons.more,
|
|
||||||
title: AppLocalizations.of(context)!.ipLogs,
|
|
||||||
subtitle: AppLocalizations.of(context)!.ipLogsDescription,
|
|
||||||
trailing: Switch(
|
|
||||||
value: appConfigProvider.showIpLogs,
|
|
||||||
onChanged: (value) => updateSettings(
|
|
||||||
newStatus: value,
|
|
||||||
function: appConfigProvider.setShowIpLogs
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () => updateSettings(
|
|
||||||
newStatus: !appConfigProvider.showIpLogs,
|
|
||||||
function: appConfigProvider.setShowIpLogs
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
top: 10,
|
|
||||||
bottom: 10,
|
|
||||||
left: 16,
|
|
||||||
right: 10
|
|
||||||
)
|
|
||||||
),
|
|
||||||
if (
|
|
||||||
!(Platform.isAndroid || Platform.isIOS) ||
|
|
||||||
(Platform.isAndroid && (
|
|
||||||
appConfigProvider.installationSource == Source.IS_INSTALLED_FROM_LOCAL_SOURCE) ||
|
|
||||||
appConfigProvider.installationSource == Source.UNKNOWN
|
|
||||||
)
|
|
||||||
) ...[
|
|
||||||
SectionLabel(label: AppLocalizations.of(context)!.application),
|
|
||||||
CustomListTile(
|
|
||||||
icon: Icons.system_update_rounded,
|
|
||||||
title: AppLocalizations.of(context)!.appUpdates,
|
|
||||||
subtitle: appConfigProvider.appUpdatesAvailable != null
|
|
||||||
? AppLocalizations.of(context)!.updateAvailable
|
|
||||||
: AppLocalizations.of(context)!.usingLatestVersion,
|
|
||||||
trailing: generateAppUpdateStatus()
|
|
||||||
)
|
|
||||||
]
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
)
|
onTap: () => updateSettings(
|
||||||
)
|
newStatus: !appConfigProvider.hideZeroValues,
|
||||||
|
function: appConfigProvider.setHideZeroValues
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
top: 10,
|
||||||
|
bottom: 10,
|
||||||
|
left: 16,
|
||||||
|
right: 10
|
||||||
|
)
|
||||||
|
),
|
||||||
|
CustomListTile(
|
||||||
|
icon: Icons.show_chart_rounded,
|
||||||
|
title: AppLocalizations.of(context)!.combinedChart,
|
||||||
|
subtitle: AppLocalizations.of(context)!.combinedChartDescription,
|
||||||
|
trailing: Switch(
|
||||||
|
value: appConfigProvider.combinedChartHome,
|
||||||
|
onChanged: (value) => updateSettings(
|
||||||
|
newStatus: value,
|
||||||
|
function: appConfigProvider.setCombinedChartHome
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () => updateSettings(
|
||||||
|
newStatus: !appConfigProvider.combinedChartHome,
|
||||||
|
function: appConfigProvider.setCombinedChartHome
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
top: 10,
|
||||||
|
bottom: 10,
|
||||||
|
left: 16,
|
||||||
|
right: 10
|
||||||
|
)
|
||||||
|
),
|
||||||
|
SectionLabel(label: AppLocalizations.of(context)!.logs),
|
||||||
|
CustomListTile(
|
||||||
|
icon: Icons.timer_rounded,
|
||||||
|
title: AppLocalizations.of(context)!.timeLogs,
|
||||||
|
subtitle: AppLocalizations.of(context)!.timeLogsDescription,
|
||||||
|
trailing: Switch(
|
||||||
|
value: appConfigProvider.showTimeLogs,
|
||||||
|
onChanged: (value) => updateSettings(
|
||||||
|
newStatus: value,
|
||||||
|
function: appConfigProvider.setshowTimeLogs
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () => updateSettings(
|
||||||
|
newStatus: !appConfigProvider.showTimeLogs,
|
||||||
|
function: appConfigProvider.setshowTimeLogs
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
top: 10,
|
||||||
|
bottom: 10,
|
||||||
|
left: 16,
|
||||||
|
right: 10
|
||||||
|
)
|
||||||
|
),
|
||||||
|
CustomListTile(
|
||||||
|
icon: Icons.more,
|
||||||
|
title: AppLocalizations.of(context)!.ipLogs,
|
||||||
|
subtitle: AppLocalizations.of(context)!.ipLogsDescription,
|
||||||
|
trailing: Switch(
|
||||||
|
value: appConfigProvider.showIpLogs,
|
||||||
|
onChanged: (value) => updateSettings(
|
||||||
|
newStatus: value,
|
||||||
|
function: appConfigProvider.setShowIpLogs
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () => updateSettings(
|
||||||
|
newStatus: !appConfigProvider.showIpLogs,
|
||||||
|
function: appConfigProvider.setShowIpLogs
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
top: 10,
|
||||||
|
bottom: 10,
|
||||||
|
left: 16,
|
||||||
|
right: 10
|
||||||
|
)
|
||||||
|
),
|
||||||
|
if (
|
||||||
|
!(Platform.isAndroid || Platform.isIOS) ||
|
||||||
|
(Platform.isAndroid && (
|
||||||
|
appConfigProvider.installationSource == Source.IS_INSTALLED_FROM_LOCAL_SOURCE) ||
|
||||||
|
appConfigProvider.installationSource == Source.UNKNOWN
|
||||||
|
)
|
||||||
|
) ...[
|
||||||
|
SectionLabel(label: AppLocalizations.of(context)!.application),
|
||||||
|
CustomListTile(
|
||||||
|
icon: Icons.system_update_rounded,
|
||||||
|
title: AppLocalizations.of(context)!.appUpdates,
|
||||||
|
subtitle: appConfigProvider.appUpdatesAvailable != null
|
||||||
|
? AppLocalizations.of(context)!.updateAvailable
|
||||||
|
: AppLocalizations.of(context)!.usingLatestVersion,
|
||||||
|
trailing: generateAppUpdateStatus()
|
||||||
|
)
|
||||||
|
]
|
||||||
|
],
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue