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:
46
lib/components/gallery_basic_info.dart
Normal file
46
lib/components/gallery_basic_info.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import '../api/gallery.dart';
|
||||
import 'thumbnail.dart';
|
||||
|
||||
class GalleryBasicInfo extends StatelessWidget {
|
||||
const GalleryBasicInfo(this.gMeta, this.firstPage, {Key? key, this.fileId})
|
||||
: super(key: key);
|
||||
final GMeta gMeta;
|
||||
final ExtendedPMeta firstPage;
|
||||
final int? fileId;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: 300,
|
||||
child: Column(children: [
|
||||
Expanded(
|
||||
child: Row(children: [
|
||||
Expanded(flex: 2, child: Thumbnail(firstPage, fileId: fileId)),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SelectableText(gMeta.preferredTitle),
|
||||
SelectableText(gMeta.uploader),
|
||||
SelectableText(gMeta.category),
|
||||
],
|
||||
))
|
||||
])),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: null,
|
||||
child: Text(AppLocalizations.of(context)!.read)),
|
||||
ElevatedButton(
|
||||
onPressed: null,
|
||||
child: Text(AppLocalizations.of(context)!.download)),
|
||||
]))
|
||||
]));
|
||||
}
|
||||
}
|
||||
30
lib/components/gallery_info.dart
Normal file
30
lib/components/gallery_info.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../api/gallery.dart';
|
||||
import 'gallery_basic_info.dart';
|
||||
import 'gallery_info_desktop.dart';
|
||||
|
||||
class GalleryInfo extends StatefulWidget {
|
||||
const GalleryInfo(this.gData, {Key? key}) : super(key: key);
|
||||
final GalleryData gData;
|
||||
|
||||
@override
|
||||
State<GalleryInfo> createState() => _GalleryInfo();
|
||||
}
|
||||
|
||||
class _GalleryInfo extends State<GalleryInfo> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool useMobile = MediaQuery.of(context).size.width <= 810;
|
||||
return LayoutBuilder(builder: (context, constraints) {
|
||||
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),
|
||||
],)));
|
||||
});
|
||||
}
|
||||
}
|
||||
56
lib/components/gallery_info_desktop.dart
Normal file
56
lib/components/gallery_info_desktop.dart
Normal file
@@ -0,0 +1,56 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import '../api/gallery.dart';
|
||||
import 'thumbnail.dart';
|
||||
|
||||
class GalleryInfoDesktop extends StatelessWidget {
|
||||
const GalleryInfoDesktop(this.gData, {Key? key, this.fileId})
|
||||
: super(key: key);
|
||||
final GalleryData gData;
|
||||
final int? fileId;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = Theme.of(context).colorScheme;
|
||||
return Container(
|
||||
alignment: Alignment.topCenter,
|
||||
child: SizedBox(
|
||||
height: 400,
|
||||
width: 1280,
|
||||
child: Row(children: [
|
||||
Expanded(
|
||||
flex: 3, child: Thumbnail(gData.pages.first, fileId: fileId)),
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: Column(
|
||||
children: [
|
||||
SelectableText(gData.meta.title,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
color: cs.primary)),
|
||||
gData.meta.titleJpn.isEmpty
|
||||
? Container()
|
||||
: SelectableText(gData.meta.titleJpn,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: cs.secondary)),
|
||||
const Divider(indent: 20, endIndent: 20),
|
||||
Expanded(
|
||||
child: Row(children: [
|
||||
SizedBox(
|
||||
width: 170,
|
||||
child: Column(children: [
|
||||
SelectableText(gData.meta.category),
|
||||
SelectableText(gData.meta.uploader),
|
||||
])),
|
||||
const VerticalDivider(indent: 10, endIndent: 10),
|
||||
Expanded(child: Column(children: [])),
|
||||
const VerticalDivider(indent: 10, endIndent: 10),
|
||||
SizedBox(width: 150, child: Column(children: [])),
|
||||
])),
|
||||
],
|
||||
))
|
||||
])));
|
||||
}
|
||||
}
|
||||
@@ -106,8 +106,10 @@ class _Thumbnail extends State<Thumbnail> {
|
||||
width: widget.width.toDouble(),
|
||||
height: widget.height.toDouble(),
|
||||
child: ImageFiltered(
|
||||
imageFilter:
|
||||
ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
||||
imageFilter: ImageFilter.blur(
|
||||
sigmaX: 10,
|
||||
sigmaY: 10,
|
||||
tileMode: TileMode.decal),
|
||||
child: Image.memory(_data!))),
|
||||
SizedBox(
|
||||
width: widget.width.toDouble(),
|
||||
|
||||
Reference in New Issue
Block a user