mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
Add server settings page
This commit is contained in:
@@ -136,6 +136,7 @@ enum MoreVertSettings {
|
||||
settings,
|
||||
markAsNsfw,
|
||||
markAsSfw,
|
||||
serverSettings,
|
||||
}
|
||||
|
||||
void onMoreVertSettingsSelected(BuildContext context, MoreVertSettings value) {
|
||||
@@ -155,6 +156,9 @@ void onMoreVertSettingsSelected(BuildContext context, MoreVertSettings value) {
|
||||
case MoreVertSettings.markAsSfw:
|
||||
GalleryPage.maybeOf(context)?.markGalleryAsNsfw(false);
|
||||
break;
|
||||
case MoreVertSettings.serverSettings:
|
||||
context.push("/server_settings");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -183,6 +187,11 @@ List<PopupMenuEntry<MoreVertSettings>> buildMoreVertSettings(
|
||||
value: MoreVertSettings.settings,
|
||||
child: Text(AppLocalizations.of(context)!.settings)));
|
||||
}
|
||||
if (path != "/server_settings" && auth.isAdmin == true) {
|
||||
list.add(PopupMenuItem(
|
||||
value: MoreVertSettings.serverSettings,
|
||||
child: Text(AppLocalizations.of(context)!.serverSettings)));
|
||||
}
|
||||
var showNsfw = prefs.getBool("showNsfw") ?? false;
|
||||
list.add(PopupMenuItem(
|
||||
child: StatefulBuilder(
|
||||
|
||||
Reference in New Issue
Block a user