Update mobile details page layout

This commit is contained in:
2024-01-26 13:15:27 +08:00
parent e6363ff4fb
commit 94bcb53603
7 changed files with 63 additions and 19 deletions

View File

@@ -21,6 +21,7 @@ class GalleryInfoDetail extends StatelessWidget {
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(horizontal: 40),
child: Column(children: [
Container(padding: const EdgeInsets.only(top: 10)),
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text(i18n.pages(meta.filecount),
style: TextStyle(color: cs.secondary)),

View File

@@ -33,7 +33,7 @@ class ImageWithContextMenu extends StatelessWidget {
Widget build(BuildContext context) {
return ContextMenuWidget(
menuProvider: (_) {
var list = [
var list = <MenuElement>[
MenuAction(
title: AppLocalizations.of(context)!.copyImage,
callback: () async {
@@ -65,6 +65,9 @@ class ImageWithContextMenu extends StatelessWidget {
}
}));
}
if ((isNsfw != null && changeNsfw != null) || (isAd != null && changeAd != null)) {
list.add(MenuSeparator());
}
if (isNsfw != null && changeNsfw != null) {
final nsfw = isNsfw!();
list.add(MenuAction(

View File

@@ -45,20 +45,21 @@ class _DownloadZipPage extends State<DownloadZipPage> {
key: _formKey,
child: Column(
children: [
Row(
Stack(
alignment: Alignment.center,
children: [
Expanded(
child: Center(
child: Text(
Text(
i18n.downloadAsZip,
style: Theme.of(context).textTheme.headlineSmall,
))),
IconButton(
onPressed: () => context.canPop()
? context.pop()
: context.go("/gallery/${widget.gid}"),
icon: const Icon(Icons.close),
)
),
Align(
alignment: Alignment.centerRight,
child: IconButton(
onPressed: () => context.canPop()
? context.pop()
: context.go("/gallery/${widget.gid}"),
icon: const Icon(Icons.close),
)),
],
),
CheckboxMenuButton(

View File

@@ -1,6 +1,7 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:go_router/go_router.dart';
import 'package:logging/logging.dart';
import '../api/gallery.dart';
import '../globals.dart';
@@ -20,8 +21,10 @@ class _KeyValue extends StatelessWidget {
return Row(children: [
SizedBox(
width: 80,
child: Text(name,
style: TextStyle(color: cs.primary, fontSize: fontSize))),
child: Center(
child: Text(name,
textAlign: TextAlign.center,
style: TextStyle(color: cs.primary, fontSize: fontSize)))),
Expanded(
child: SelectableText(value,
style: TextStyle(color: cs.secondary, fontSize: fontSize)),
@@ -91,9 +94,10 @@ class _GalleryDetailsPage extends State<GalleryDetailsPage> {
final i18n = AppLocalizations.of(context)!;
final maxWidth = MediaQuery.of(context).size.width;
if (isLoading && !_isLoading) _fetchData();
final indent = maxWidth < 400 ? 5.0 : 10.0;
return Container(
padding: maxWidth < 400
? const EdgeInsets.symmetric(vertical: 20, horizontal: 5)
? const EdgeInsets.symmetric(vertical: 20, horizontal: 10)
: const EdgeInsets.all(20),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10)),
child: isLoading
@@ -117,11 +121,40 @@ class _GalleryDetailsPage extends State<GalleryDetailsPage> {
))
: SingleChildScrollView(
child: Column(children: [
Stack(
alignment: Alignment.center,
children: [
Text(
i18n.galleryDetails,
style: Theme.of(context).textTheme.headlineSmall,
),
Align(
alignment: Alignment.centerRight,
child: IconButton(
onPressed: () => context.canPop()
? context.pop()
: context.go("/gallery/${widget.gid}"),
icon: const Icon(Icons.close),
)),
],
),
Divider(indent: indent, endIndent: indent),
_KeyValue(
i18n.gid,
_meta!.gid.toString(),
fontSize: 14,
fontSize: 16,
),
Divider(indent: indent, endIndent: indent),
_KeyValue(i18n.title2, _meta!.title, fontSize: 16),
_meta!.titleJpn.isEmpty
? Container()
: Divider(indent: indent, endIndent: indent),
_meta!.titleJpn.isEmpty
? Container()
: _KeyValue(i18n.titleJpn, _meta!.titleJpn, fontSize: 16),
Divider(indent: indent, endIndent: indent),
_KeyValue(i18n.visible, _meta!.expunged ? i18n.no : i18n.yes,
fontSize: 16),
])),
);
}

View File

@@ -132,5 +132,8 @@
"invalidURLOrigin": "Invalid URL origin.",
"httpHttpsNeeded": "Unsupported scheme. Only https or http are supported.",
"corsCredentialsHosts": "The URL origins which are allowed to send CORS requests with credentials",
"corsCredentialsHostsHelp": "Add websites to this list can lead to security risks, make sure you trust these websites."
"corsCredentialsHostsHelp": "Add websites to this list can lead to security risks, make sure you trust these websites.",
"galleryDetails": "Gallery Details",
"title2": "Title",
"titleJpn": "Japanese Title"
}

View File

@@ -132,5 +132,8 @@
"invalidURLOrigin": "非法的 URL 源。",
"httpHttpsNeeded": "不支持的协议。仅支持 http 或 https。",
"corsCredentialsHosts": "被允许发送带有凭证的 CORS 请求的 URL 源",
"corsCredentialsHostsHelp": "将网站加入这个列表会导致安全风险,请确保你信任这些网站。"
"corsCredentialsHostsHelp": "将网站加入这个列表会导致安全风险,请确保你信任这些网站。",
"galleryDetails": "画廊详情",
"title2": "标题",
"titleJpn": "日语标题"
}