mod
This commit is contained in:
@ -142,21 +142,15 @@ class VideoContent extends StatelessWidget {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
Text(
|
|
||||||
videoItem.owner.name,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
|
|
||||||
color: Theme.of(context).colorScheme.outline,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
StatView(
|
Text(
|
||||||
theme: 'gray',
|
videoItem.owner.name,
|
||||||
view: videoItem.cntInfo['play'],
|
style: TextStyle(
|
||||||
|
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||||
|
color: Theme.of(context).colorScheme.outline,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
|
||||||
StatDanMu(theme: 'gray', danmu: videoItem.cntInfo['danmaku']),
|
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 26,
|
width: 26,
|
||||||
|
|||||||
@ -27,12 +27,6 @@ Widget followItem({item}) {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontSize: 14),
|
style: const TextStyle(fontSize: 14),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
|
||||||
item.sign,
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
dense: true,
|
|
||||||
trailing: const SizedBox(width: 6),
|
trailing: const SizedBox(width: 6),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,8 +56,7 @@ class HistoryController extends GetxController {
|
|||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('提示'),
|
title: const Text('提示'),
|
||||||
content:
|
content: Text(!pauseStatus.value ? '你要暂停历史记录功能吗?' : '要恢复历史记录功能吗?'),
|
||||||
Text(!pauseStatus.value ? '啊叻?你要暂停历史记录功能吗?' : '啊叻?要恢复历史记录功能吗?'),
|
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => SmartDialog.dismiss(),
|
onPressed: () => SmartDialog.dismiss(),
|
||||||
|
|||||||
@ -74,140 +74,10 @@ class _MediaPageState extends State<MediaPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
Obx(() => mediaController.userLogin.value
|
|
||||||
? favFolder(mediaController, context)
|
|
||||||
: const SizedBox())
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget favFolder(mediaController, context) {
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
Divider(
|
|
||||||
height: 35,
|
|
||||||
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
onTap: () {},
|
|
||||||
leading: null,
|
|
||||||
dense: true,
|
|
||||||
title: Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 10),
|
|
||||||
child: Obx(
|
|
||||||
() => Text.rich(
|
|
||||||
TextSpan(
|
|
||||||
children: [
|
|
||||||
TextSpan(
|
|
||||||
text: '收藏夹 ',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize:
|
|
||||||
Theme.of(context).textTheme.titleMedium!.fontSize,
|
|
||||||
fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
if (mediaController.favFolderData.value.count != null)
|
|
||||||
TextSpan(
|
|
||||||
text: mediaController.favFolderData.value.count
|
|
||||||
.toString(),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize:
|
|
||||||
Theme.of(context).textTheme.titleSmall!.fontSize,
|
|
||||||
color: Theme.of(context).colorScheme.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
trailing: IconButton(
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
_futureBuilderFuture = mediaController.queryFavFolder();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.refresh,
|
|
||||||
size: 20,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// const SizedBox(height: 10),
|
|
||||||
SizedBox(
|
|
||||||
width: double.infinity,
|
|
||||||
height: 170 * MediaQuery.of(context).textScaleFactor,
|
|
||||||
child: FutureBuilder(
|
|
||||||
future: _futureBuilderFuture,
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
|
||||||
if (snapshot.data == null) {
|
|
||||||
return const SizedBox();
|
|
||||||
}
|
|
||||||
Map data = snapshot.data as Map;
|
|
||||||
if (data['status']) {
|
|
||||||
List favFolderList =
|
|
||||||
mediaController.favFolderData.value.list!;
|
|
||||||
int favFolderCount =
|
|
||||||
mediaController.favFolderData.value.count!;
|
|
||||||
bool flag = favFolderCount > favFolderList.length;
|
|
||||||
return Obx(() => ListView.builder(
|
|
||||||
itemCount:
|
|
||||||
mediaController.favFolderData.value.list!.length +
|
|
||||||
(flag ? 1 : 0),
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
if (flag && index == favFolderList.length) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
right: 14, bottom: 35),
|
|
||||||
child: Center(
|
|
||||||
child: IconButton(
|
|
||||||
style: ButtonStyle(
|
|
||||||
padding: MaterialStateProperty.all(
|
|
||||||
EdgeInsets.zero),
|
|
||||||
backgroundColor:
|
|
||||||
MaterialStateProperty.resolveWith(
|
|
||||||
(states) {
|
|
||||||
return Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.primaryContainer
|
|
||||||
.withOpacity(0.5);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
onPressed: () => Get.toNamed('/fav'),
|
|
||||||
icon: Icon(
|
|
||||||
Icons.arrow_forward_ios,
|
|
||||||
size: 18,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
));
|
|
||||||
} else {
|
|
||||||
return FavFolderItem(
|
|
||||||
item: mediaController
|
|
||||||
.favFolderData.value.list![index],
|
|
||||||
index: index);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
));
|
|
||||||
} else {
|
|
||||||
return SizedBox(
|
|
||||||
height: 160,
|
|
||||||
child: Center(child: Text(data['msg'])),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 骨架屏
|
|
||||||
return const SizedBox();
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class FavFolderItem extends StatelessWidget {
|
class FavFolderItem extends StatelessWidget {
|
||||||
|
|||||||
@ -70,11 +70,11 @@ class MemberController extends GetxController {
|
|||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('提示'),
|
title: const Text('提示'),
|
||||||
content: Text(memberInfo.value.isFollowed! ? '取消关注UP主?' : '关注UP主?'),
|
content: Text(memberInfo.value.isFollowed! ? '取消关注该用户?' : '关注该用户?'),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => SmartDialog.dismiss(),
|
onPressed: () => SmartDialog.dismiss(),
|
||||||
child: const Text('点错了')),
|
child: const Text('取消')),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await VideoHttp.relationMod(
|
await VideoHttp.relationMod(
|
||||||
|
|||||||
@ -382,14 +382,6 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(owner.name,
|
Text(owner.name,
|
||||||
style: const TextStyle(fontSize: 13)),
|
style: const TextStyle(fontSize: 13)),
|
||||||
const SizedBox(width: 6),
|
|
||||||
Text(
|
|
||||||
follower,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: t.textTheme.labelSmall!.fontSize,
|
|
||||||
color: outline,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
AnimatedOpacity(
|
AnimatedOpacity(
|
||||||
opacity: loadingStatus ? 0 : 1,
|
opacity: loadingStatus ? 0 : 1,
|
||||||
|
|||||||
@ -347,78 +347,40 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
},
|
},
|
||||||
onlyOneScrollInBody: true,
|
onlyOneScrollInBody: true,
|
||||||
body: Container(
|
body: Container(
|
||||||
key: Key(heroTag),
|
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
child: Column(
|
child: CustomScrollView(
|
||||||
children: [
|
key: const PageStorageKey<String>('简介'),
|
||||||
Opacity(
|
slivers: <Widget>[
|
||||||
opacity: 0,
|
if (videoDetailController.videoType ==
|
||||||
child: SizedBox(
|
SearchType.video) ...[
|
||||||
width: double.infinity,
|
const VideoIntroPanel(),
|
||||||
height: 0,
|
] else
|
||||||
child: Obx(
|
// if (videoDetailController.videoType ==
|
||||||
() => TabBar(
|
// SearchType.media_bangumi) ...[
|
||||||
controller: videoDetailController.tabCtr,
|
// BangumiIntroPanel(
|
||||||
dividerColor: Colors.transparent,
|
// cid: videoDetailController.cid)
|
||||||
indicatorColor:
|
// ],
|
||||||
Theme.of(context).colorScheme.background,
|
// if (videoDetailController.videoType ==
|
||||||
tabs: videoDetailController.tabs
|
// SearchType.video) ...[
|
||||||
.map((String name) => Tab(text: name))
|
// SliverPersistentHeader(
|
||||||
.toList(),
|
// floating: true,
|
||||||
),
|
// pinned: true,
|
||||||
|
// delegate: SliverHeaderDelegate(
|
||||||
|
// height: 50,
|
||||||
|
// child:
|
||||||
|
// const MenuRow(loadingStatus: false),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
SliverToBoxAdapter(
|
||||||
|
child: Divider(
|
||||||
|
indent: 12,
|
||||||
|
endIndent: 12,
|
||||||
|
color:
|
||||||
|
Theme.of(context).dividerColor.withOpacity(0.06),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
// const RelatedVideoPanel(),
|
||||||
Expanded(
|
|
||||||
child: TabBarView(
|
|
||||||
controller: videoDetailController.tabCtr,
|
|
||||||
children: [
|
|
||||||
Builder(
|
|
||||||
builder: (context) {
|
|
||||||
return CustomScrollView(
|
|
||||||
key: const PageStorageKey<String>('简介'),
|
|
||||||
slivers: <Widget>[
|
|
||||||
if (videoDetailController.videoType ==
|
|
||||||
SearchType.video) ...[
|
|
||||||
const VideoIntroPanel(),
|
|
||||||
] else
|
|
||||||
// if (videoDetailController.videoType ==
|
|
||||||
// SearchType.media_bangumi) ...[
|
|
||||||
// BangumiIntroPanel(
|
|
||||||
// cid: videoDetailController.cid)
|
|
||||||
// ],
|
|
||||||
// if (videoDetailController.videoType ==
|
|
||||||
// SearchType.video) ...[
|
|
||||||
// SliverPersistentHeader(
|
|
||||||
// floating: true,
|
|
||||||
// pinned: true,
|
|
||||||
// delegate: SliverHeaderDelegate(
|
|
||||||
// height: 50,
|
|
||||||
// child:
|
|
||||||
// const MenuRow(loadingStatus: false),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
SliverToBoxAdapter(
|
|
||||||
child: Divider(
|
|
||||||
indent: 12,
|
|
||||||
endIndent: 12,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.dividerColor
|
|
||||||
.withOpacity(0.06),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// const RelatedVideoPanel(),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
VideoReplyPanel(
|
|
||||||
bvid: videoDetailController.bvid,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user