mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -2,7 +2,7 @@
|
|||||||
enum SearchType {
|
enum SearchType {
|
||||||
// all('综合'),
|
// all('综合'),
|
||||||
// 视频:video
|
// 视频:video
|
||||||
video('视频', hasHeader: true),
|
video('视频'),
|
||||||
// 番剧:media_bangumi,
|
// 番剧:media_bangumi,
|
||||||
media_bangumi('番剧'),
|
media_bangumi('番剧'),
|
||||||
// 影视:media_ft
|
// 影视:media_ft
|
||||||
@@ -16,13 +16,12 @@ enum SearchType {
|
|||||||
// 话题:topic
|
// 话题:topic
|
||||||
// topic,
|
// topic,
|
||||||
// 用户:bili_user
|
// 用户:bili_user
|
||||||
bili_user('用户', hasHeader: true),
|
bili_user('用户'),
|
||||||
// 专栏:article
|
// 专栏:article
|
||||||
article('专栏', hasHeader: true);
|
article('专栏');
|
||||||
// 相簿:photo
|
// 相簿:photo
|
||||||
// photo
|
// photo
|
||||||
|
|
||||||
final bool hasHeader;
|
|
||||||
final String label;
|
final String label;
|
||||||
const SearchType(this.label, {this.hasHeader = false});
|
const SearchType(this.label);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -735,8 +735,8 @@ class _AudioPageState extends State<AudioPage> {
|
|||||||
final baseBarColor = colorScheme.brightness.isDark
|
final baseBarColor = colorScheme.brightness.isDark
|
||||||
? const Color(0x33FFFFFF)
|
? const Color(0x33FFFFFF)
|
||||||
: const Color(0x33999999);
|
: const Color(0x33999999);
|
||||||
return Obx(() {
|
final child = Obx(
|
||||||
final child = ProgressBar(
|
() => ProgressBar(
|
||||||
progress: _controller.position.value,
|
progress: _controller.position.value,
|
||||||
total: _controller.duration.value,
|
total: _controller.duration.value,
|
||||||
baseBarColor: baseBarColor,
|
baseBarColor: baseBarColor,
|
||||||
@@ -749,15 +749,15 @@ class _AudioPageState extends State<AudioPage> {
|
|||||||
onDragStart: _onDragStart,
|
onDragStart: _onDragStart,
|
||||||
onDragUpdate: _onDragUpdate,
|
onDragUpdate: _onDragUpdate,
|
||||||
onSeek: _onSeek,
|
onSeek: _onSeek,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (Utils.isDesktop) {
|
||||||
|
return MouseRegion(
|
||||||
|
cursor: SystemMouseCursors.click,
|
||||||
|
child: child,
|
||||||
);
|
);
|
||||||
if (Utils.isDesktop) {
|
}
|
||||||
return MouseRegion(
|
return child;
|
||||||
cursor: SystemMouseCursors.click,
|
|
||||||
child: child,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return child;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDuration(ColorScheme colorScheme) {
|
Widget _buildDuration(ColorScheme colorScheme) {
|
||||||
|
|||||||
@@ -42,8 +42,13 @@ abstract class CommonSearchPanelState<
|
|||||||
controller: controller.scrollController,
|
controller: controller.scrollController,
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
slivers: [
|
slivers: [
|
||||||
if (widget.searchType.hasHeader) buildHeader(theme),
|
?buildHeader(theme),
|
||||||
Obx(() => _buildBody(theme, controller.loadingState.value)),
|
SliverPadding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
bottom: MediaQuery.viewPaddingOf(context).bottom + 100,
|
||||||
|
),
|
||||||
|
sliver: Obx(() => _buildBody(theme, controller.loadingState.value)),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -56,12 +61,7 @@ abstract class CommonSearchPanelState<
|
|||||||
Loading() => buildLoading,
|
Loading() => buildLoading,
|
||||||
Success(:var response) =>
|
Success(:var response) =>
|
||||||
response?.isNotEmpty == true
|
response?.isNotEmpty == true
|
||||||
? SliverPadding(
|
? buildList(theme, response!)
|
||||||
padding: EdgeInsets.only(
|
|
||||||
bottom: MediaQuery.viewPaddingOf(context).bottom + 100,
|
|
||||||
),
|
|
||||||
sliver: buildList(theme, response!),
|
|
||||||
)
|
|
||||||
: HttpError(onReload: controller.onReload),
|
: HttpError(onReload: controller.onReload),
|
||||||
Error(:var errMsg) => HttpError(
|
Error(:var errMsg) => HttpError(
|
||||||
errMsg: errMsg,
|
errMsg: errMsg,
|
||||||
@@ -70,7 +70,7 @@ abstract class CommonSearchPanelState<
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildHeader(ThemeData theme) => throw UnimplementedError();
|
Widget? buildHeader(ThemeData theme) => null;
|
||||||
|
|
||||||
Widget buildList(ThemeData theme, List<T> list);
|
Widget buildList(ThemeData theme, List<T> list);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ class _MediaListPanelState extends State<MediaListPanel>
|
|||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
actions: [
|
actions: [
|
||||||
iconButton(
|
iconButton(
|
||||||
|
iconSize: 20,
|
||||||
tooltip: widget.desc ? '顺序播放' : '倒序播放',
|
tooltip: widget.desc ? '顺序播放' : '倒序播放',
|
||||||
icon: widget.desc
|
icon: widget.desc
|
||||||
? const Icon(MdiIcons.sortAscending)
|
? const Icon(MdiIcons.sortAscending)
|
||||||
@@ -86,6 +87,7 @@ class _MediaListPanelState extends State<MediaListPanel>
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
iconButton(
|
iconButton(
|
||||||
|
iconSize: 20,
|
||||||
tooltip: '关闭',
|
tooltip: '关闭',
|
||||||
icon: const Icon(Icons.close),
|
icon: const Icon(Icons.close),
|
||||||
onPressed: Get.back,
|
onPressed: Get.back,
|
||||||
|
|||||||
@@ -86,6 +86,39 @@ class BottomControl extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget progressBar() {
|
||||||
|
final child = Obx(() {
|
||||||
|
final int value = controller.sliderPositionSeconds.value;
|
||||||
|
final int max = controller.durationSeconds.value.inSeconds;
|
||||||
|
if (value > max || max <= 0) {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
return ProgressBar(
|
||||||
|
progress: Duration(seconds: value),
|
||||||
|
buffered: Duration(seconds: controller.bufferedSeconds.value),
|
||||||
|
total: Duration(seconds: max),
|
||||||
|
progressBarColor: primary,
|
||||||
|
baseBarColor: const Color(0x33FFFFFF),
|
||||||
|
bufferedBarColor: bufferedBarColor,
|
||||||
|
thumbColor: primary,
|
||||||
|
thumbGlowColor: thumbGlowColor,
|
||||||
|
barHeight: 3.5,
|
||||||
|
thumbRadius: 7,
|
||||||
|
thumbGlowRadius: 25,
|
||||||
|
onDragStart: onDragStart,
|
||||||
|
onDragUpdate: (e) => onDragUpdate(e, max),
|
||||||
|
onSeek: (e) => onSeek(e, max),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
if (Utils.isDesktop) {
|
||||||
|
return MouseRegion(
|
||||||
|
cursor: SystemMouseCursors.click,
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return child;
|
||||||
|
}
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(10, 0, 10, 12),
|
padding: const EdgeInsets.fromLTRB(10, 0, 10, 12),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -98,37 +131,7 @@ class BottomControl extends StatelessWidget {
|
|||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
children: [
|
children: [
|
||||||
Obx(() {
|
progressBar(),
|
||||||
final int value = controller.sliderPositionSeconds.value;
|
|
||||||
final int max = controller.durationSeconds.value.inSeconds;
|
|
||||||
final int buffer = controller.bufferedSeconds.value;
|
|
||||||
if (value > max || max <= 0) {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
final child = ProgressBar(
|
|
||||||
progress: Duration(seconds: value),
|
|
||||||
buffered: Duration(seconds: buffer),
|
|
||||||
total: Duration(seconds: max),
|
|
||||||
progressBarColor: primary,
|
|
||||||
baseBarColor: const Color(0x33FFFFFF),
|
|
||||||
bufferedBarColor: bufferedBarColor,
|
|
||||||
thumbColor: primary,
|
|
||||||
thumbGlowColor: thumbGlowColor,
|
|
||||||
barHeight: 3.5,
|
|
||||||
thumbRadius: 7,
|
|
||||||
thumbGlowRadius: 25,
|
|
||||||
onDragStart: onDragStart,
|
|
||||||
onDragUpdate: (e) => onDragUpdate(e, max),
|
|
||||||
onSeek: (e) => onSeek(e, max),
|
|
||||||
);
|
|
||||||
if (Utils.isDesktop) {
|
|
||||||
return MouseRegion(
|
|
||||||
cursor: SystemMouseCursors.click,
|
|
||||||
child: child,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return child;
|
|
||||||
}),
|
|
||||||
if (controller.enableSponsorBlock &&
|
if (controller.enableSponsorBlock &&
|
||||||
videoDetailController.segmentProgressList.isNotEmpty)
|
videoDetailController.segmentProgressList.isNotEmpty)
|
||||||
Positioned(
|
Positioned(
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ abstract class ImageUtils {
|
|||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Utils.isMobile) {
|
if (Platform.isAndroid) {
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
await SaverGallery.saveFile(
|
await SaverGallery.saveFile(
|
||||||
filePath: filePath,
|
filePath: filePath,
|
||||||
@@ -214,7 +214,7 @@ abstract class ImageUtils {
|
|||||||
del: true,
|
del: true,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
if (Utils.isMobile) {
|
if (Platform.isAndroid) {
|
||||||
await SaverGallery.saveFile(
|
await SaverGallery.saveFile(
|
||||||
filePath: file.path,
|
filePath: file.path,
|
||||||
fileName: name,
|
fileName: name,
|
||||||
@@ -227,7 +227,7 @@ abstract class ImageUtils {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
final result = await Future.wait(futures, eagerError: true);
|
final result = await Future.wait(futures, eagerError: true);
|
||||||
if (!Utils.isMobile) {
|
if (!Platform.isAndroid) {
|
||||||
for (var res in result) {
|
for (var res in result) {
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
await saveFileImg(
|
await saveFileImg(
|
||||||
|
|||||||
Reference in New Issue
Block a user