Merge branch 'design'
This commit is contained in:
@ -125,21 +125,29 @@ class LikeItem extends StatelessWidget {
|
|||||||
Color outline = Theme.of(context).colorScheme.outline;
|
Color outline = Theme.of(context).colorScheme.outline;
|
||||||
final nickNameList = item.users!.map((e) => e.nickname).take(2).toList();
|
final nickNameList = item.users!.map((e) => e.nickname).take(2).toList();
|
||||||
int usersLen = item.users!.length > 3 ? 3 : item.users!.length;
|
int usersLen = item.users!.length > 3 ? 3 : item.users!.length;
|
||||||
final String bvid = item.item!.uri!.split('/').last;
|
final Uri uri = Uri.parse(item.item!.uri!);
|
||||||
|
final String path = uri.path;
|
||||||
|
final String bvid = path.split('/').last;
|
||||||
|
|
||||||
|
/// bilibili://
|
||||||
|
final Uri nativeUri = Uri.parse(item.item!.nativeUri!);
|
||||||
|
final Map<String, String> queryParameters = nativeUri.queryParameters;
|
||||||
|
final String type = item.item!.type!;
|
||||||
|
// cid
|
||||||
|
final String? argCid = queryParameters['cid'];
|
||||||
// 页码
|
// 页码
|
||||||
final String page =
|
final String? page = queryParameters['page'];
|
||||||
item.item!.nativeUri!.split('page=').last.split('&').first;
|
|
||||||
// 根评论id
|
// 根评论id
|
||||||
final String commentRootId =
|
final String? commentRootId = queryParameters['comment_root_id'];
|
||||||
item.item!.nativeUri!.split('comment_root_id=').last.split('&').first;
|
|
||||||
// 二级评论id
|
// 二级评论id
|
||||||
final String commentSecondaryId =
|
final String? commentSecondaryId = queryParameters['comment_secondary_id'];
|
||||||
item.item!.nativeUri!.split('comment_secondary_id=').last;
|
|
||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
try {
|
try {
|
||||||
final int cid = await SearchHttp.ab2c(bvid: bvid);
|
final int cid = argCid != null
|
||||||
|
? int.parse(argCid)
|
||||||
|
: await SearchHttp.ab2c(bvid: bvid);
|
||||||
final String heroTag = Utils.makeHeroTag(bvid);
|
final String heroTag = Utils.makeHeroTag(bvid);
|
||||||
Get.toNamed<dynamic>(
|
Get.toNamed<dynamic>(
|
||||||
'/video?bvid=$bvid&cid=$cid',
|
'/video?bvid=$bvid&cid=$cid',
|
||||||
@ -148,8 +156,8 @@ class LikeItem extends StatelessWidget {
|
|||||||
'heroTag': heroTag,
|
'heroTag': heroTag,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} catch (_) {
|
} catch (e) {
|
||||||
SmartDialog.showToast('视频可能失效了');
|
SmartDialog.showToast('视频可能失效了$e');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Stack(
|
child: Stack(
|
||||||
@ -222,7 +230,7 @@ class LikeItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 25),
|
const SizedBox(width: 25),
|
||||||
if (item.item!.type! == 'reply')
|
if (type == 'reply' || type == 'danmu')
|
||||||
Container(
|
Container(
|
||||||
width: 60,
|
width: 60,
|
||||||
height: 60,
|
height: 60,
|
||||||
@ -234,7 +242,7 @@ class LikeItem extends StatelessWidget {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (item.item!.type! == 'video')
|
if (type == 'video')
|
||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
width: 60,
|
width: 60,
|
||||||
height: 60,
|
height: 60,
|
||||||
|
|||||||
@ -205,11 +205,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool isUsingFullScreenGestures(double tapPosition, double sectionWidth) {
|
bool isUsingFullScreenGestures(double tapPosition, double sectionWidth) {
|
||||||
if (fullScreenGestureMode == FullScreenGestureMode.none) {
|
return fullScreenGestureMode != FullScreenGestureMode.none &&
|
||||||
return false;
|
tapPosition < sectionWidth * 2;
|
||||||
} else {
|
|
||||||
return tapPosition < sectionWidth * 2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -646,7 +643,10 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
onVerticalDragUpdate: (DragUpdateDetails details) async {
|
onVerticalDragUpdate: (DragUpdateDetails details) async {
|
||||||
final double totalWidth = MediaQuery.sizeOf(context).width;
|
final double totalWidth = MediaQuery.sizeOf(context).width;
|
||||||
final double tapPosition = details.localPosition.dx;
|
final double tapPosition = details.localPosition.dx;
|
||||||
final double sectionWidth = totalWidth / 3;
|
final double sectionWidth =
|
||||||
|
fullScreenGestureMode == FullScreenGestureMode.none
|
||||||
|
? totalWidth / 2
|
||||||
|
: totalWidth / 3;
|
||||||
final double delta = details.delta.dy;
|
final double delta = details.delta.dy;
|
||||||
|
|
||||||
/// 锁定时禁用
|
/// 锁定时禁用
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class GlobalDataCache {
|
|||||||
defaultValue: 10); // 设置全局变量
|
defaultValue: 10); // 设置全局变量
|
||||||
fullScreenGestureMode = FullScreenGestureMode.values[setting.get(
|
fullScreenGestureMode = FullScreenGestureMode.values[setting.get(
|
||||||
SettingBoxKey.fullScreenGestureMode,
|
SettingBoxKey.fullScreenGestureMode,
|
||||||
defaultValue: FullScreenGestureMode.values.last.index) as int];
|
defaultValue: FullScreenGestureMode.fromBottomtoTop.index)];
|
||||||
enablePlayerControlAnimation = setting
|
enablePlayerControlAnimation = setting
|
||||||
.get(SettingBoxKey.enablePlayerControlAnimation, defaultValue: true);
|
.get(SettingBoxKey.enablePlayerControlAnimation, defaultValue: true);
|
||||||
actionTypeSort = await setting.get(SettingBoxKey.actionTypeSort,
|
actionTypeSort = await setting.get(SettingBoxKey.actionTypeSort,
|
||||||
|
|||||||
Reference in New Issue
Block a user