mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
Update Galleries page title
This commit is contained in:
23
lib/components/tag.dart
Normal file
23
lib/components/tag.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import '../api/gallery.dart';
|
||||
import '../globals.dart';
|
||||
|
||||
class TagWidget extends StatelessWidget {
|
||||
const TagWidget(this.tag, {Key? key, this.name}) : super(key: key);
|
||||
final Tag tag;
|
||||
final String? name;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
context.pushNamed("/galleries",
|
||||
queryParameters: {
|
||||
"tag": [tag.tag]
|
||||
},
|
||||
extra: GalleriesPageExtra(translatedTag: tag.translated));
|
||||
},
|
||||
child: Text(name ?? tag.tag));
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../api/gallery.dart';
|
||||
import 'tag.dart';
|
||||
|
||||
String _getTag(Tag tag) {
|
||||
final tags = tag.tag.split(":");
|
||||
@@ -17,13 +16,7 @@ class TagTooltip extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final name = _getTag(tag);
|
||||
final t = InkWell(
|
||||
onTap: () {
|
||||
context.pushNamed("/galleries", queryParameters: {
|
||||
"tag": [tag.tag]
|
||||
});
|
||||
},
|
||||
child: Text(name));
|
||||
final t = TagWidget(tag, name: name);
|
||||
return tag.intro != null && tag.intro!.isNotEmpty
|
||||
? Tooltip(
|
||||
message: tag.intro!,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import '../api/gallery.dart';
|
||||
import '../globals.dart';
|
||||
import '../main.dart';
|
||||
import 'tag.dart';
|
||||
import 'tag_tooltip.dart';
|
||||
import 'scroll_parent.dart';
|
||||
|
||||
@@ -74,13 +74,7 @@ class _TagsPanel extends State<TagsPanel> {
|
||||
),
|
||||
child: stt
|
||||
? TagTooltip(ta[index - 1]!)
|
||||
: InkWell(
|
||||
onTap: () {
|
||||
context.pushNamed("/galleries", queryParameters: {
|
||||
"tag": [ta[index - 1]!.tag]
|
||||
});
|
||||
},
|
||||
child: Text(ta[index - 1]!.tag)));
|
||||
: TagWidget(ta[index - 1]!));
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user