mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
batch download
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||
import 'package:pixes/components/batch_download.dart';
|
||||
import 'package:pixes/components/segmented_button.dart';
|
||||
import 'package:pixes/components/title_bar.dart';
|
||||
import 'package:pixes/foundation/app.dart';
|
||||
@@ -34,19 +35,25 @@ class _BookMarkedArtworkPageState extends State<BookMarkedArtworkPage>{
|
||||
Widget buildTab() {
|
||||
return TitleBar(
|
||||
title: "Bookmarks".tl,
|
||||
action: SegmentedButton(
|
||||
options: [
|
||||
SegmentedButtonOption("public", "Public".tl),
|
||||
SegmentedButtonOption("private", "Private".tl),
|
||||
action: Row(
|
||||
children: [
|
||||
BatchDownloadButton(request: () => Network().getBookmarkedIllusts(restrict)),
|
||||
const SizedBox(width: 8,),
|
||||
SegmentedButton(
|
||||
options: [
|
||||
SegmentedButtonOption("public", "Public".tl),
|
||||
SegmentedButtonOption("private", "Private".tl),
|
||||
],
|
||||
onPressed: (key) {
|
||||
if(key != restrict) {
|
||||
setState(() {
|
||||
restrict = key;
|
||||
});
|
||||
}
|
||||
},
|
||||
value: restrict,
|
||||
)
|
||||
],
|
||||
onPressed: (key) {
|
||||
if(key != restrict) {
|
||||
setState(() {
|
||||
restrict = key;
|
||||
});
|
||||
}
|
||||
},
|
||||
value: restrict,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -66,6 +66,7 @@ class _DownloadingPageState extends State<DownloadingPage> {
|
||||
controller[task.illust.id.toString()] ??= FlyoutController();
|
||||
|
||||
return Card(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: SizedBox(
|
||||
height: 96,
|
||||
|
@@ -4,6 +4,7 @@ import 'package:pixes/components/title_bar.dart';
|
||||
import 'package:pixes/foundation/app.dart';
|
||||
import 'package:pixes/utils/translation.dart';
|
||||
|
||||
import '../components/batch_download.dart';
|
||||
import '../components/illust_widget.dart';
|
||||
import '../components/loading.dart';
|
||||
import '../components/segmented_button.dart';
|
||||
@@ -34,20 +35,26 @@ class _FollowingArtworksPageState extends State<FollowingArtworksPage> {
|
||||
Widget buildTab() {
|
||||
return TitleBar(
|
||||
title: "Following".tl,
|
||||
action: SegmentedButton(
|
||||
options: [
|
||||
SegmentedButtonOption("all", "All".tl),
|
||||
SegmentedButtonOption("public", "Public".tl),
|
||||
SegmentedButtonOption("private", "Private".tl),
|
||||
action: Row(
|
||||
children: [
|
||||
BatchDownloadButton(request: () => Network().getFollowingArtworks(restrict)),
|
||||
const SizedBox(width: 8,),
|
||||
SegmentedButton(
|
||||
options: [
|
||||
SegmentedButtonOption("all", "All".tl),
|
||||
SegmentedButtonOption("public", "Public".tl),
|
||||
SegmentedButtonOption("private", "Private".tl),
|
||||
],
|
||||
onPressed: (key) {
|
||||
if(key != restrict) {
|
||||
setState(() {
|
||||
restrict = key;
|
||||
});
|
||||
}
|
||||
},
|
||||
value: restrict,
|
||||
)
|
||||
],
|
||||
onPressed: (key) {
|
||||
if(key != restrict) {
|
||||
setState(() {
|
||||
restrict = key;
|
||||
});
|
||||
}
|
||||
},
|
||||
value: restrict,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -3,8 +3,10 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||
import 'package:pixes/foundation/app.dart';
|
||||
import 'package:pixes/utils/translation.dart';
|
||||
|
||||
import '../components/batch_download.dart';
|
||||
import '../components/illust_widget.dart';
|
||||
import '../components/loading.dart';
|
||||
import '../components/title_bar.dart';
|
||||
import '../network/network.dart';
|
||||
|
||||
class RankingPage extends StatefulWidget {
|
||||
@@ -48,12 +50,12 @@ class _RankingPageState extends State<RankingPage> {
|
||||
}
|
||||
|
||||
Widget buildHeader() {
|
||||
return SizedBox(
|
||||
child: Row(
|
||||
return TitleBar(
|
||||
title: "Ranking".tl,
|
||||
action: Row(
|
||||
children: [
|
||||
Text("Ranking".tl, style: const TextStyle(
|
||||
fontSize: 20, fontWeight: FontWeight.bold),),
|
||||
const Spacer(),
|
||||
BatchDownloadButton(request: () => Network().getRanking(type)),
|
||||
const SizedBox(width: 8,),
|
||||
DropDownButton(
|
||||
title: Text(types[type]!),
|
||||
items: types.entries.map((e) => MenuFlyoutItem(
|
||||
@@ -66,8 +68,8 @@ class _RankingPageState extends State<RankingPage> {
|
||||
)).toList(),
|
||||
)
|
||||
],
|
||||
)
|
||||
).padding(const EdgeInsets.symmetric(vertical: 8, horizontal: 16));
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2,6 +2,7 @@ import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||
import 'package:pixes/appdata.dart';
|
||||
import 'package:pixes/components/batch_download.dart';
|
||||
import 'package:pixes/components/loading.dart';
|
||||
import 'package:pixes/components/md.dart';
|
||||
import 'package:pixes/foundation/app.dart';
|
||||
@@ -32,7 +33,12 @@ class _UserInfoPageState extends LoadingState<UserInfoPage, UserDetails> {
|
||||
slivers: [
|
||||
buildUser(),
|
||||
buildInformation(),
|
||||
SliverToBoxAdapter(child: buildHeader("Artworks"),),
|
||||
SliverToBoxAdapter(
|
||||
child: buildHeader(
|
||||
"Artworks",
|
||||
action: BatchDownloadButton(
|
||||
request: () => Network().getUserIllusts(widget.id))
|
||||
),),
|
||||
_UserArtworks(data.id.toString(), key: ValueKey(data.id),),
|
||||
SliverPadding(padding: EdgeInsets.only(bottom: context.padding.bottom)),
|
||||
],
|
||||
@@ -146,13 +152,21 @@ class _UserInfoPageState extends LoadingState<UserInfoPage, UserDetails> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildHeader(String title) {
|
||||
Widget buildHeader(String title, {Widget? action}) {
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
title,
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
).toAlign(Alignment.centerLeft)).paddingLeft(16).paddingVertical(4);
|
||||
height: 38,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
).toAlign(Alignment.centerLeft),
|
||||
const Spacer(),
|
||||
if(action != null)
|
||||
action.toAlign(Alignment.centerRight)
|
||||
],
|
||||
).paddingHorizontal(16)).paddingTop(8);
|
||||
}
|
||||
|
||||
Widget buildInformation() {
|
||||
@@ -181,7 +195,6 @@ class _UserInfoPageState extends LoadingState<UserInfoPage, UserDetails> {
|
||||
buildItem(icon: MdIcons.location_city_outlined, title: "Region", content: data!.region),
|
||||
buildItem(icon: MdIcons.work_outline, title: "Job".tl, content: data!.job),
|
||||
buildItem(icon: MdIcons.person_2_outlined, title: "Gender".tl, content: data!.gender),
|
||||
const SizedBox(height: 8,),
|
||||
buildHeader("Social Network".tl),
|
||||
buildItem(title: "Webpage",
|
||||
content: data!.webpage,
|
||||
|
Reference in New Issue
Block a user