Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-10-23 10:20:23 +08:00
parent e8a32a6149
commit da52cac2c6
6 changed files with 62 additions and 58 deletions

View File

@@ -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);
}

View File

@@ -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,15 +749,15 @@ class _AudioPageState extends State<AudioPage> {
onDragStart: _onDragStart,
onDragUpdate: _onDragUpdate,
onSeek: _onSeek,
),
);
if (Utils.isDesktop) {
return MouseRegion(
cursor: SystemMouseCursors.click,
child: child,
);
if (Utils.isDesktop) {
return MouseRegion(
cursor: SystemMouseCursors.click,
child: child,
);
}
return child;
});
}
return child;
}
Widget _buildDuration(ColorScheme colorScheme) {

View File

@@ -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);
}

View File

@@ -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,

View File

@@ -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(
padding: const EdgeInsets.fromLTRB(10, 0, 10, 12),
child: Column(
@@ -98,37 +131,7 @@ class BottomControl extends StatelessWidget {
clipBehavior: Clip.none,
alignment: Alignment.bottomCenter,
children: [
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(
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;
}),
progressBar(),
if (controller.enableSponsorBlock &&
videoDetailController.segmentProgressList.isNotEmpty)
Positioned(

View File

@@ -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(