mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-08 12:04:50 +08:00
@@ -1,13 +1,10 @@
|
||||
import 'package:PiliPlus/common/style.dart';
|
||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/progress_bar/video_progress_indicator.dart';
|
||||
import 'package:PiliPlus/common/widgets/select_mask.dart';
|
||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||
import 'package:PiliPlus/http/search.dart';
|
||||
import 'package:PiliPlus/models/common/badge_type.dart';
|
||||
import 'package:PiliPlus/models/common/stat_type.dart';
|
||||
import 'package:PiliPlus/models_new/later/list.dart';
|
||||
import 'package:PiliPlus/pages/later/controller.dart';
|
||||
import 'package:PiliPlus/utils/duration_utils.dart';
|
||||
@@ -15,6 +12,9 @@ import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:get/get_navigation/src/extension_navigation.dart';
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
|
||||
// 视频卡片 - 水平布局
|
||||
class VideoCardHLater extends StatelessWidget {
|
||||
@@ -42,7 +42,7 @@ class VideoCardHLater extends StatelessWidget {
|
||||
..onSelect(videoItem);
|
||||
|
||||
return Material(
|
||||
type: MaterialType.transparency,
|
||||
type: .transparency,
|
||||
child: InkWell(
|
||||
onLongPress: onLongPress,
|
||||
onSecondaryTap: PlatformUtils.isMobile ? null : onLongPress,
|
||||
@@ -81,8 +81,8 @@ class VideoCardHLater extends StatelessWidget {
|
||||
vertical: 5,
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
crossAxisAlignment: .start,
|
||||
children: [
|
||||
AspectRatio(
|
||||
aspectRatio: Style.aspectRatio,
|
||||
child: LayoutBuilder(
|
||||
@@ -91,7 +91,7 @@ class VideoCardHLater extends StatelessWidget {
|
||||
final double maxHeight = boxConstraints.maxHeight;
|
||||
num? progress = videoItem.progress;
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
clipBehavior: .none,
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
src: videoItem.pic,
|
||||
@@ -104,7 +104,7 @@ class VideoCardHLater extends StatelessWidget {
|
||||
text: '充电专属',
|
||||
top: 6.0,
|
||||
right: 6.0,
|
||||
type: PBadgeType.error,
|
||||
type: .error,
|
||||
)
|
||||
else if (videoItem.rights?.isCooperation == 1)
|
||||
const PBadge(
|
||||
@@ -131,7 +131,7 @@ class VideoCardHLater extends StatelessWidget {
|
||||
: '${DurationUtils.formatDuration(progress)}/${DurationUtils.formatDuration(videoItem.duration)}',
|
||||
right: 6,
|
||||
bottom: 8,
|
||||
type: PBadgeType.gray,
|
||||
type: .gray,
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
@@ -153,7 +153,7 @@ class VideoCardHLater extends StatelessWidget {
|
||||
),
|
||||
right: 6.0,
|
||||
bottom: 6.0,
|
||||
type: PBadgeType.gray,
|
||||
type: .gray,
|
||||
),
|
||||
Positioned.fill(
|
||||
child: selectMask(
|
||||
@@ -178,15 +178,15 @@ class VideoCardHLater extends StatelessWidget {
|
||||
Widget content(BuildContext context, ThemeData theme) {
|
||||
final isPgc = videoItem.isPgc == true && videoItem.bangumi != null;
|
||||
Widget stat = StatWidget(
|
||||
type: StatType.play,
|
||||
type: .play,
|
||||
value: videoItem.stat?.view,
|
||||
);
|
||||
return Expanded(
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
clipBehavior: .none,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment: .start,
|
||||
children: isPgc
|
||||
? [
|
||||
Text(
|
||||
@@ -197,18 +197,18 @@ class VideoCardHLater extends StatelessWidget {
|
||||
letterSpacing: 0.3,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
overflow: .ellipsis,
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
Text(
|
||||
videoItem.subtitle!,
|
||||
textAlign: TextAlign.start,
|
||||
textAlign: .start,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
overflow: .ellipsis,
|
||||
),
|
||||
const Spacer(),
|
||||
stat,
|
||||
@@ -223,7 +223,7 @@ class VideoCardHLater extends StatelessWidget {
|
||||
letterSpacing: 0.3,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
overflow: .ellipsis,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@@ -233,7 +233,7 @@ class VideoCardHLater extends StatelessWidget {
|
||||
fontSize: 12,
|
||||
height: 1,
|
||||
color: theme.colorScheme.outline,
|
||||
overflow: TextOverflow.clip,
|
||||
overflow: .clip,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
@@ -242,7 +242,7 @@ class VideoCardHLater extends StatelessWidget {
|
||||
children: [
|
||||
stat,
|
||||
StatWidget(
|
||||
type: StatType.danmaku,
|
||||
type: .danmaku,
|
||||
value: videoItem.stat?.danmaku,
|
||||
),
|
||||
],
|
||||
@@ -252,11 +252,45 @@ class VideoCardHLater extends StatelessWidget {
|
||||
Positioned(
|
||||
right: 0,
|
||||
bottom: -8,
|
||||
child: iconButton(
|
||||
tooltip: '移除',
|
||||
onPressed: () => ctr.toViewDel(context, index, videoItem.aid),
|
||||
icon: const Icon(Icons.clear),
|
||||
iconColor: theme.colorScheme.outline,
|
||||
width: 29,
|
||||
height: 29,
|
||||
child: PopupMenuButton(
|
||||
padding: .zero,
|
||||
tooltip: '功能菜单',
|
||||
icon: Icon(
|
||||
Icons.more_vert_outlined,
|
||||
color: theme.colorScheme.outline,
|
||||
size: 18,
|
||||
),
|
||||
position: .under,
|
||||
itemBuilder: (_) => [
|
||||
PopupMenuItem(
|
||||
onTap: () =>
|
||||
Get.toNamed('/member?mid=${videoItem.owner?.mid}'),
|
||||
height: 38,
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(MdiIcons.accountCircleOutline, size: 16),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
'访问:${videoItem.owner?.name}',
|
||||
style: const TextStyle(fontSize: 13),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
onTap: () => ctr.toViewDel(context, index, videoItem.aid),
|
||||
height: 38,
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.close_outlined, size: 16),
|
||||
SizedBox(width: 6),
|
||||
Text('移除', style: TextStyle(fontSize: 13)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user