This commit is contained in:
2023-09-04 18:22:09 +08:00
parent 20b38ba6da
commit e1233f35bd
10 changed files with 262 additions and 9 deletions

View File

@@ -1,3 +1,4 @@
import 'package:eh_downloader_flutter/globals.dart';
import 'package:flutter/material.dart';
import '../api/gallery.dart';
import 'gallery_basic_info.dart';
@@ -12,6 +13,16 @@ class GalleryInfo extends StatefulWidget {
}
class _GalleryInfo extends State<GalleryInfo> {
void showNsfwChanged(dynamic _) {
setState(() {});
}
@override
void initState() {
listener.on("showNsfwChanged", showNsfwChanged);
super.initState();
}
@override
Widget build(BuildContext context) {
bool useMobile = MediaQuery.of(context).size.width <= 810;
@@ -19,12 +30,24 @@ class _GalleryInfo extends State<GalleryInfo> {
return SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints(minHeight: constraints.maxHeight),
child: useMobile ? Column(children: [
GalleryBasicInfo(widget.gData.meta, widget.gData.pages.first),
],
) : Column(children: [
GalleryInfoDesktop(widget.gData),
],)));
child: useMobile
? Column(
children: [
GalleryBasicInfo(
widget.gData.meta, widget.gData.pages.first),
],
)
: Column(
children: [
GalleryInfoDesktop(widget.gData),
],
)));
});
}
@override
void dispose() {
listener.removeEventListener("showNsfwChanged", showNsfwChanged);
super.dispose();
}
}