mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
Update
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user