mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 04:57:23 +00:00
improve ui; update version code
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
<application
|
<application
|
||||||
android:label="pixes"
|
android:label="pixes"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
|
android:enableOnBackInvokedCallback="true"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
@@ -112,7 +112,6 @@
|
|||||||
"Multiple path separators will be automatically replaced with a single": "多个路径分隔符将被自动替换为单个",
|
"Multiple path separators will be automatically replaced with a single": "多个路径分隔符将被自动替换为单个",
|
||||||
"Login": "登录",
|
"Login": "登录",
|
||||||
"You need to complete the login operation in the browser window that will open.": "您需要在打开的浏览器窗口中完成登录操作",
|
"You need to complete the login operation in the browser window that will open.": "您需要在打开的浏览器窗口中完成登录操作",
|
||||||
"I have read and agree to the Terms of Use": "我已阅读并同意使用条款",
|
|
||||||
"Waiting..." : "等待中...",
|
"Waiting..." : "等待中...",
|
||||||
"Waiting for authentication. Please finished in the browser." : "等待验证. 请在浏览器中完成.",
|
"Waiting for authentication. Please finished in the browser." : "等待验证. 请在浏览器中完成.",
|
||||||
"Back" : "返回",
|
"Back" : "返回",
|
||||||
@@ -179,7 +178,9 @@
|
|||||||
"A new version of Pixes is available. Do you want to update now?" : "Pixes有新版本可用. 您要立即更新吗?",
|
"A new version of Pixes is available. Do you want to update now?" : "Pixes有新版本可用. 您要立即更新吗?",
|
||||||
"Update": "更新",
|
"Update": "更新",
|
||||||
"Check for updates": "检查更新",
|
"Check for updates": "检查更新",
|
||||||
"Check for updates on startup": "启动时检查更新"
|
"Check for updates on startup": "启动时检查更新",
|
||||||
|
"I understand pixes is a free unofficial application.": "我了解Pixes是一个免费的非官方应用程序",
|
||||||
|
"Related Artworks": "相关作品"
|
||||||
},
|
},
|
||||||
"zh_TW": {
|
"zh_TW": {
|
||||||
"Search": "搜索",
|
"Search": "搜索",
|
||||||
@@ -294,7 +295,6 @@
|
|||||||
"Multiple path separators will be automatically replaced with a single": "多個路徑分隔符號將自動替換為單一",
|
"Multiple path separators will be automatically replaced with a single": "多個路徑分隔符號將自動替換為單一",
|
||||||
"Login": "登錄",
|
"Login": "登錄",
|
||||||
"You need to complete the login operation in the browser window that will open.": "您需要在打開的瀏覽器窗口中完成登錄操作",
|
"You need to complete the login operation in the browser window that will open.": "您需要在打開的瀏覽器窗口中完成登錄操作",
|
||||||
"I have read and agree to the Terms of Use": "我已閱讀並同意使用條款",
|
|
||||||
"Waiting..." : "等待中...",
|
"Waiting..." : "等待中...",
|
||||||
"Waiting for authentication. Please finished in the browser." : "等待驗證. 請在瀏覽器中完成.",
|
"Waiting for authentication. Please finished in the browser." : "等待驗證. 請在瀏覽器中完成.",
|
||||||
"Back" : "返回",
|
"Back" : "返回",
|
||||||
@@ -361,6 +361,8 @@
|
|||||||
"A new version of Pixes is available. Do you want to update now?" : "Pixes有新版本可用. 您要立即更新嗎?",
|
"A new version of Pixes is available. Do you want to update now?" : "Pixes有新版本可用. 您要立即更新嗎?",
|
||||||
"Update": "更新",
|
"Update": "更新",
|
||||||
"Check for updates": "檢查更新",
|
"Check for updates": "檢查更新",
|
||||||
"Check for updates on startup": "啟動時檢查更新"
|
"Check for updates on startup": "啟動時檢查更新",
|
||||||
|
"I understand pixes is a free unofficial application.": "我了解Pixes是一個免費的非官方應用程序",
|
||||||
|
"Related Artworks": "相關作品"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -4,6 +4,7 @@ import 'package:pixes/foundation/app.dart';
|
|||||||
import 'package:pixes/foundation/history.dart';
|
import 'package:pixes/foundation/history.dart';
|
||||||
import 'package:pixes/foundation/image_provider.dart';
|
import 'package:pixes/foundation/image_provider.dart';
|
||||||
import 'package:pixes/network/download.dart';
|
import 'package:pixes/network/download.dart';
|
||||||
|
import 'package:pixes/pages/related_page.dart';
|
||||||
import 'package:pixes/utils/translation.dart';
|
import 'package:pixes/utils/translation.dart';
|
||||||
|
|
||||||
import '../network/network.dart';
|
import '../network/network.dart';
|
||||||
@@ -75,6 +76,7 @@ class _IllustWidgetState extends State<IllustWidget> {
|
|||||||
context.to(() => IllustPage(widget.illust));
|
context.to(() => IllustPage(widget.illust));
|
||||||
},
|
},
|
||||||
onSecondaryTapUp: showMenu,
|
onSecondaryTapUp: showMenu,
|
||||||
|
onLongPress: showMenu,
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(4.0),
|
borderRadius: BorderRadius.circular(4.0),
|
||||||
child: AnimatedImage(
|
child: AnimatedImage(
|
||||||
@@ -211,13 +213,13 @@ class _IllustWidgetState extends State<IllustWidget> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void showMenu(TapUpDetails details) {
|
void showMenu([TapUpDetails? details]) {
|
||||||
// This calculates the position of the flyout according to the parent navigator
|
// This calculates the position of the flyout according to the parent navigator
|
||||||
final targetContext = contextAttachKey.currentContext;
|
final targetContext = contextAttachKey.currentContext;
|
||||||
if (targetContext == null) return;
|
if (targetContext == null) return;
|
||||||
final box = targetContext.findRenderObject() as RenderBox;
|
final box = targetContext.findRenderObject() as RenderBox;
|
||||||
final position = box.localToGlobal(
|
Offset? position = box.localToGlobal(
|
||||||
details.localPosition,
|
details?.localPosition ?? box.size.center(Offset.zero),
|
||||||
ancestor: Navigator.of(context).context.findRenderObject(),
|
ancestor: Navigator.of(context).context.findRenderObject(),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -243,6 +245,12 @@ class _IllustWidgetState extends State<IllustWidget> {
|
|||||||
context.showToast(message: "Added");
|
context.showToast(message: "Added");
|
||||||
DownloadManager().addDownloadingTask(widget.illust);
|
DownloadManager().addDownloadingTask(widget.illust);
|
||||||
}),
|
}),
|
||||||
|
MenuFlyoutItem(
|
||||||
|
text: Text("Related Artworks".tl),
|
||||||
|
onPressed: () {
|
||||||
|
context.to(
|
||||||
|
() => RelatedIllustsPage(widget.illust.id.toString()));
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -320,150 +328,149 @@ class IllustHistoryWidget extends StatelessWidget {
|
|||||||
final width = constrains.maxWidth;
|
final width = constrains.maxWidth;
|
||||||
final height = illust.height * width / illust.width;
|
final height = illust.height * width / illust.width;
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: Container(
|
child: Container(
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(horizontal: 8.0, vertical: 8.0),
|
const EdgeInsets.symmetric(horizontal: 8.0, vertical: 8.0),
|
||||||
child: Card(
|
child: Card(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.to(() => IllustPageWithId(illust.id.toString()));
|
context.to(() => IllustPageWithId(illust.id.toString()));
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(4.0),
|
borderRadius: BorderRadius.circular(4.0),
|
||||||
child: AnimatedImage(
|
child: AnimatedImage(
|
||||||
image: CachedImageProvider(
|
image: CachedImageProvider(illust.imgPath),
|
||||||
illust.imgPath),
|
fit: BoxFit.cover,
|
||||||
fit: BoxFit.cover,
|
width: width - 16.0,
|
||||||
width: width - 16.0,
|
height: height - 16.0,
|
||||||
height: height - 16.0,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)),
|
),
|
||||||
if (illust.imageCount > 1)
|
)),
|
||||||
Positioned(
|
if (illust.imageCount > 1)
|
||||||
top: 12,
|
Positioned(
|
||||||
left: 12,
|
top: 12,
|
||||||
child: Container(
|
left: 12,
|
||||||
width: 28,
|
child: Container(
|
||||||
height: 20,
|
width: 28,
|
||||||
decoration: BoxDecoration(
|
height: 20,
|
||||||
color: FluentTheme.of(context)
|
decoration: BoxDecoration(
|
||||||
.micaBackgroundColor
|
color: FluentTheme.of(context)
|
||||||
.withOpacity(0.72),
|
.micaBackgroundColor
|
||||||
borderRadius: BorderRadius.circular(4),
|
.withOpacity(0.72),
|
||||||
border: Border.all(
|
borderRadius: BorderRadius.circular(4),
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
border: Border.all(
|
||||||
width: 0.6),
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
|
width: 0.6),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"${illust.imageCount}P",
|
||||||
|
style: const TextStyle(fontSize: 12),
|
||||||
),
|
),
|
||||||
child: Center(
|
)),
|
||||||
child: Text(
|
),
|
||||||
"${illust.imageCount}P",
|
if (illust.isAi)
|
||||||
style: const TextStyle(fontSize: 12),
|
Positioned(
|
||||||
),
|
bottom: 12,
|
||||||
)),
|
left: 12,
|
||||||
),
|
child: Container(
|
||||||
if (illust.isAi)
|
width: 28,
|
||||||
Positioned(
|
height: 20,
|
||||||
bottom: 12,
|
decoration: BoxDecoration(
|
||||||
left: 12,
|
color: ColorScheme.of(context)
|
||||||
child: Container(
|
.errorContainer
|
||||||
width: 28,
|
.withOpacity(0.8),
|
||||||
height: 20,
|
borderRadius: BorderRadius.circular(4),
|
||||||
decoration: BoxDecoration(
|
border: Border.all(
|
||||||
color: ColorScheme.of(context)
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
.errorContainer
|
width: 0.6),
|
||||||
.withOpacity(0.8),
|
),
|
||||||
borderRadius: BorderRadius.circular(4),
|
child: const Center(
|
||||||
border: Border.all(
|
child: Text(
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
"AI",
|
||||||
width: 0.6),
|
style: TextStyle(fontSize: 12),
|
||||||
),
|
),
|
||||||
child: const Center(
|
)),
|
||||||
child: Text(
|
),
|
||||||
"AI",
|
if (illust.isGif)
|
||||||
style: TextStyle(fontSize: 12),
|
Positioned(
|
||||||
),
|
bottom: 12,
|
||||||
)),
|
left: 12,
|
||||||
),
|
child: Container(
|
||||||
if (illust.isGif)
|
width: 28,
|
||||||
Positioned(
|
height: 20,
|
||||||
bottom: 12,
|
decoration: BoxDecoration(
|
||||||
left: 12,
|
color: ColorScheme.of(context)
|
||||||
child: Container(
|
.primaryContainer
|
||||||
width: 28,
|
.withOpacity(0.8),
|
||||||
height: 20,
|
borderRadius: BorderRadius.circular(4),
|
||||||
decoration: BoxDecoration(
|
border: Border.all(
|
||||||
color: ColorScheme.of(context)
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
.primaryContainer
|
width: 0.6),
|
||||||
.withOpacity(0.8),
|
),
|
||||||
borderRadius: BorderRadius.circular(4),
|
child: const Center(
|
||||||
border: Border.all(
|
child: Text(
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
"GIF",
|
||||||
width: 0.6),
|
style: TextStyle(fontSize: 12),
|
||||||
),
|
),
|
||||||
child: const Center(
|
)),
|
||||||
child: Text(
|
),
|
||||||
"GIF",
|
if (illust.isR18)
|
||||||
style: TextStyle(fontSize: 12),
|
Positioned(
|
||||||
),
|
bottom: 12,
|
||||||
)),
|
right: 12,
|
||||||
),
|
child: Container(
|
||||||
if (illust.isR18)
|
width: 28,
|
||||||
Positioned(
|
height: 20,
|
||||||
bottom: 12,
|
decoration: BoxDecoration(
|
||||||
right: 12,
|
color: ColorScheme.of(context).errorContainer,
|
||||||
child: Container(
|
borderRadius: BorderRadius.circular(4),
|
||||||
width: 28,
|
border: Border.all(
|
||||||
height: 20,
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
decoration: BoxDecoration(
|
width: 0.6),
|
||||||
color: ColorScheme.of(context).errorContainer,
|
),
|
||||||
borderRadius: BorderRadius.circular(4),
|
child: const Center(
|
||||||
border: Border.all(
|
child: Text(
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
"R18",
|
||||||
width: 0.6),
|
style: TextStyle(fontSize: 12),
|
||||||
),
|
),
|
||||||
child: const Center(
|
)),
|
||||||
child: Text(
|
),
|
||||||
"R18",
|
if (illust.isR18G)
|
||||||
style: TextStyle(fontSize: 12),
|
Positioned(
|
||||||
),
|
bottom: 12,
|
||||||
)),
|
right: 12,
|
||||||
),
|
child: Container(
|
||||||
if (illust.isR18G)
|
width: 28,
|
||||||
Positioned(
|
height: 20,
|
||||||
bottom: 12,
|
decoration: BoxDecoration(
|
||||||
right: 12,
|
color: ColorScheme.of(context).errorContainer,
|
||||||
child: Container(
|
borderRadius: BorderRadius.circular(4),
|
||||||
width: 28,
|
border: Border.all(
|
||||||
height: 20,
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
decoration: BoxDecoration(
|
width: 0.6),
|
||||||
color: ColorScheme.of(context).errorContainer,
|
),
|
||||||
borderRadius: BorderRadius.circular(4),
|
child: const Center(
|
||||||
border: Border.all(
|
child: Text(
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
"R18G",
|
||||||
width: 0.6),
|
style: TextStyle(fontSize: 12),
|
||||||
),
|
),
|
||||||
child: const Center(
|
)),
|
||||||
child: Text(
|
),
|
||||||
"R18G",
|
],
|
||||||
style: TextStyle(fontSize: 12),
|
),
|
||||||
),
|
);
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,7 +12,7 @@ export "state_controller.dart";
|
|||||||
export "navigation.dart";
|
export "navigation.dart";
|
||||||
|
|
||||||
class _App {
|
class _App {
|
||||||
final version = "1.0.7";
|
final version = "1.0.8";
|
||||||
|
|
||||||
bool get isAndroid => Platform.isAndroid;
|
bool get isAndroid => Platform.isAndroid;
|
||||||
bool get isIOS => Platform.isIOS;
|
bool get isIOS => Platform.isIOS;
|
||||||
|
@@ -4,7 +4,6 @@ import 'package:fluent_ui/fluent_ui.dart';
|
|||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart' show Icons;
|
import 'package:flutter/material.dart' show Icons;
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
|
||||||
import 'package:pixes/appdata.dart';
|
import 'package:pixes/appdata.dart';
|
||||||
import 'package:pixes/components/animated_image.dart';
|
import 'package:pixes/components/animated_image.dart';
|
||||||
import 'package:pixes/components/keyboard.dart';
|
import 'package:pixes/components/keyboard.dart';
|
||||||
@@ -20,6 +19,7 @@ import 'package:pixes/network/download.dart';
|
|||||||
import 'package:pixes/network/network.dart';
|
import 'package:pixes/network/network.dart';
|
||||||
import 'package:pixes/pages/comments_page.dart';
|
import 'package:pixes/pages/comments_page.dart';
|
||||||
import 'package:pixes/pages/image_page.dart';
|
import 'package:pixes/pages/image_page.dart';
|
||||||
|
import 'package:pixes/pages/related_page.dart';
|
||||||
import 'package:pixes/pages/search_page.dart';
|
import 'package:pixes/pages/search_page.dart';
|
||||||
import 'package:pixes/pages/user_info_page.dart';
|
import 'package:pixes/pages/user_info_page.dart';
|
||||||
import 'package:pixes/utils/block.dart';
|
import 'package:pixes/utils/block.dart';
|
||||||
@@ -1140,7 +1140,7 @@ class _BottomBarState extends State<_BottomBar> with TickerProviderStateMixin {
|
|||||||
).fixWidth(96),
|
).fixWidth(96),
|
||||||
Button(
|
Button(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.to(() => _RelatedIllustsPage(widget.illust.id.toString()));
|
context.to(() => RelatedIllustsPage(widget.illust.id.toString()));
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 28,
|
height: 28,
|
||||||
@@ -1357,64 +1357,3 @@ class _IllustPageWithIdState extends LoadingState<IllustPageWithId, Illust> {
|
|||||||
return Network().getIllustByID(widget.id);
|
return Network().getIllustByID(widget.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _RelatedIllustsPage extends StatefulWidget {
|
|
||||||
const _RelatedIllustsPage(this.id);
|
|
||||||
|
|
||||||
final String id;
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<_RelatedIllustsPage> createState() => _RelatedIllustsPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _RelatedIllustsPageState
|
|
||||||
extends MultiPageLoadingState<_RelatedIllustsPage, Illust> {
|
|
||||||
@override
|
|
||||||
Widget? buildFrame(BuildContext context, Widget child) {
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
TitleBar(title: "Related artworks".tl),
|
|
||||||
Expanded(
|
|
||||||
child: child,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget buildContent(BuildContext context, final List<Illust> data) {
|
|
||||||
return LayoutBuilder(builder: (context, constrains) {
|
|
||||||
return MasonryGridView.builder(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8) +
|
|
||||||
EdgeInsets.only(bottom: context.padding.bottom),
|
|
||||||
gridDelegate: const SliverSimpleGridDelegateWithMaxCrossAxisExtent(
|
|
||||||
maxCrossAxisExtent: 240,
|
|
||||||
),
|
|
||||||
itemCount: data.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
if (index == data.length - 1) {
|
|
||||||
nextPage();
|
|
||||||
}
|
|
||||||
return IllustWidget(data[index]);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
String? nextUrl;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<Res<List<Illust>>> loadData(page) async {
|
|
||||||
if (nextUrl == "end") {
|
|
||||||
return Res.error("No more data");
|
|
||||||
}
|
|
||||||
var res = nextUrl == null
|
|
||||||
? await Network().relatedIllusts(widget.id)
|
|
||||||
: await Network().getIllustsWithNextUrl(nextUrl!);
|
|
||||||
if (!res.error) {
|
|
||||||
nextUrl = res.subData;
|
|
||||||
nextUrl ??= "end";
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@@ -188,6 +188,7 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
|
|||||||
var image = widget.urls[index];
|
var image = widget.urls[index];
|
||||||
|
|
||||||
return PhotoViewGalleryPageOptions(
|
return PhotoViewGalleryPageOptions(
|
||||||
|
filterQuality: FilterQuality.medium,
|
||||||
imageProvider: getImageProvider(image),
|
imageProvider: getImageProvider(image),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@@ -87,7 +87,9 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 8,
|
width: 8,
|
||||||
),
|
),
|
||||||
Text("I have read and agree to the Terms of Use".tl)
|
Expanded(
|
||||||
|
child: Text("I understand pixes is a free unofficial application.".tl),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
69
lib/pages/related_page.dart
Normal file
69
lib/pages/related_page.dart
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import 'package:fluent_ui/fluent_ui.dart';
|
||||||
|
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||||
|
import 'package:pixes/components/illust_widget.dart';
|
||||||
|
import 'package:pixes/components/loading.dart';
|
||||||
|
import 'package:pixes/components/title_bar.dart';
|
||||||
|
import 'package:pixes/foundation/app.dart';
|
||||||
|
import 'package:pixes/network/network.dart';
|
||||||
|
import 'package:pixes/utils/translation.dart';
|
||||||
|
|
||||||
|
class RelatedIllustsPage extends StatefulWidget {
|
||||||
|
const RelatedIllustsPage(this.id, {super.key});
|
||||||
|
|
||||||
|
final String id;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<RelatedIllustsPage> createState() => _RelatedIllustsPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RelatedIllustsPageState
|
||||||
|
extends MultiPageLoadingState<RelatedIllustsPage, Illust> {
|
||||||
|
@override
|
||||||
|
Widget? buildFrame(BuildContext context, Widget child) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
TitleBar(title: "Related artworks".tl),
|
||||||
|
Expanded(
|
||||||
|
child: child,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget buildContent(BuildContext context, final List<Illust> data) {
|
||||||
|
return LayoutBuilder(builder: (context, constrains) {
|
||||||
|
return MasonryGridView.builder(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8) +
|
||||||
|
EdgeInsets.only(bottom: context.padding.bottom),
|
||||||
|
gridDelegate: const SliverSimpleGridDelegateWithMaxCrossAxisExtent(
|
||||||
|
maxCrossAxisExtent: 240,
|
||||||
|
),
|
||||||
|
itemCount: data.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
if (index == data.length - 1) {
|
||||||
|
nextPage();
|
||||||
|
}
|
||||||
|
return IllustWidget(data[index]);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
String? nextUrl;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Res<List<Illust>>> loadData(page) async {
|
||||||
|
if (nextUrl == "end") {
|
||||||
|
return Res.error("No more data");
|
||||||
|
}
|
||||||
|
var res = nextUrl == null
|
||||||
|
? await Network().relatedIllusts(widget.id)
|
||||||
|
: await Network().getIllustsWithNextUrl(nextUrl!);
|
||||||
|
if (!res.error) {
|
||||||
|
nextUrl = res.subData;
|
||||||
|
nextUrl ??= "end";
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
@@ -33,6 +33,8 @@ class _SearchPageState extends State<SearchPage> {
|
|||||||
|
|
||||||
int searchType = 0;
|
int searchType = 0;
|
||||||
|
|
||||||
|
final focusNode = FocusNode();
|
||||||
|
|
||||||
static const searchTypes = [
|
static const searchTypes = [
|
||||||
"Search artwork",
|
"Search artwork",
|
||||||
"Search novel",
|
"Search novel",
|
||||||
@@ -100,6 +102,9 @@ class _SearchPageState extends State<SearchPage> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextBox(
|
child: TextBox(
|
||||||
|
focusNode: focusNode,
|
||||||
|
autofocus: false,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
placeholder:
|
placeholder:
|
||||||
'${searchTypes[searchType].tl} / ${"Open link".tl}',
|
'${searchTypes[searchType].tl} / ${"Open link".tl}',
|
||||||
onChanged: (s) => text = s,
|
onChanged: (s) => text = s,
|
||||||
|
@@ -12,7 +12,6 @@ import 'package:pixes/foundation/app.dart';
|
|||||||
import 'package:pixes/pages/main_page.dart';
|
import 'package:pixes/pages/main_page.dart';
|
||||||
import 'package:pixes/utils/io.dart';
|
import 'package:pixes/utils/io.dart';
|
||||||
import 'package:pixes/utils/translation.dart';
|
import 'package:pixes/utils/translation.dart';
|
||||||
import 'package:pixes/utils/update.dart';
|
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
|
|
||||||
import 'logs.dart';
|
import 'logs.dart';
|
||||||
|
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.7+107
|
version: 1.0.8+108
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.3.4 <4.0.0'
|
sdk: '>=3.3.4 <4.0.0'
|
||||||
|
Reference in New Issue
Block a user