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