mod: tabbar样式&增加评论数
This commit is contained in:
@ -85,10 +85,9 @@ class VideoIntroController extends GetxController {
|
|||||||
if (videoDetail.value.pages!.isNotEmpty && lastPlayCid.value == 0) {
|
if (videoDetail.value.pages!.isNotEmpty && lastPlayCid.value == 0) {
|
||||||
lastPlayCid.value = videoDetail.value.pages!.first.cid!;
|
lastPlayCid.value = videoDetail.value.pages!.first.cid!;
|
||||||
}
|
}
|
||||||
// Get.find<VideoDetailController>(tag: heroTag).tabs.value = [
|
final VideoDetailController videoDetailCtr =
|
||||||
// '简介',
|
Get.find<VideoDetailController>(tag: heroTag);
|
||||||
// '评论 ${result['data']!.stat!.reply}'
|
videoDetailCtr.tabs.value = ['简介', '评论 ${result['data']?.stat?.reply}'];
|
||||||
// ];
|
|
||||||
// 获取到粉丝数再返回
|
// 获取到粉丝数再返回
|
||||||
await queryUserStat();
|
await queryUserStat();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -319,62 +319,78 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Material(
|
||||||
children: [
|
child: Row(
|
||||||
const SizedBox(width: 20),
|
children: [
|
||||||
Expanded(
|
Flexible(
|
||||||
child: TabBar(
|
flex: 1,
|
||||||
controller: vdCtr.tabCtr,
|
child: Obx(
|
||||||
dividerColor: Colors.transparent,
|
() => TabBar(
|
||||||
tabs: vdCtr.tabs.map((String name) => Tab(text: name)).toList(),
|
padding: EdgeInsets.zero,
|
||||||
),
|
controller: vdCtr.tabCtr,
|
||||||
),
|
labelStyle: const TextStyle(fontSize: 13),
|
||||||
SizedBox(
|
labelPadding:
|
||||||
width: 220,
|
const EdgeInsets.symmetric(horizontal: 10.0), // 设置每个标签的宽度
|
||||||
child: Center(
|
dividerColor: Colors.transparent,
|
||||||
child: Row(
|
tabs: vdCtr.tabs
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
.map(
|
||||||
children: [
|
(String name) => Flexible(
|
||||||
SizedBox(
|
child: Tab(text: name),
|
||||||
height: 32,
|
),
|
||||||
child: TextButton(
|
)
|
||||||
style: ButtonStyle(
|
.toList(),
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
),
|
||||||
),
|
|
||||||
onPressed: () => vdCtr.showShootDanmakuSheet(),
|
|
||||||
child: const Text('发弹幕', style: TextStyle(fontSize: 12)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 4),
|
|
||||||
SizedBox(
|
|
||||||
width: 34,
|
|
||||||
height: 32,
|
|
||||||
child: TextButton(
|
|
||||||
style: ButtonStyle(
|
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
plPlayerController?.isOpenDanmu.value =
|
|
||||||
!(plPlayerController?.isOpenDanmu.value ?? false);
|
|
||||||
},
|
|
||||||
child: Obx(() => Text(
|
|
||||||
'弹',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12,
|
|
||||||
color: (plPlayerController?.isOpenDanmu.value ??
|
|
||||||
false)
|
|
||||||
? Theme.of(context).colorScheme.primary
|
|
||||||
: Theme.of(context).colorScheme.outline,
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 14),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Flexible(
|
||||||
],
|
flex: 1,
|
||||||
|
child: Center(
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 32,
|
||||||
|
child: TextButton(
|
||||||
|
style: ButtonStyle(
|
||||||
|
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||||
|
),
|
||||||
|
onPressed: () => vdCtr.showShootDanmakuSheet(),
|
||||||
|
child:
|
||||||
|
const Text('发弹幕', style: TextStyle(fontSize: 12)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
SizedBox(
|
||||||
|
width: 34,
|
||||||
|
height: 32,
|
||||||
|
child: TextButton(
|
||||||
|
style: ButtonStyle(
|
||||||
|
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
plPlayerController?.isOpenDanmu.value =
|
||||||
|
!(plPlayerController?.isOpenDanmu.value ??
|
||||||
|
false);
|
||||||
|
},
|
||||||
|
child: Obx(() => Text(
|
||||||
|
'弹',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: (plPlayerController
|
||||||
|
?.isOpenDanmu.value ??
|
||||||
|
false)
|
||||||
|
? Theme.of(context).colorScheme.primary
|
||||||
|
: Theme.of(context).colorScheme.outline,
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 14),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user