opt: pages

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-24 16:36:26 +08:00
parent 4d7d9abc60
commit c28729af5b
27 changed files with 266 additions and 310 deletions

View File

@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
class StyleString { class StyleString {
static const double cardSpace = 8; static const double cardSpace = 8;
static const double safeSpace = 12; static const double safeSpace = 12;
static BorderRadius mdRadius = BorderRadius.circular(10); static const BorderRadius mdRadius = BorderRadius.all(Radius.circular(10));
static const Radius imgRadius = Radius.circular(10); static const Radius imgRadius = Radius.circular(10);
static const double aspectRatio = 16 / 10; static const double aspectRatio = 16 / 10;
} }

View File

@@ -99,7 +99,7 @@ class ShimmerState extends State<Shimmer> with SingleTickerProviderStateMixin {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return widget.child ?? const SizedBox(); return widget.child ?? const SizedBox.shrink();
} }
} }
@@ -165,7 +165,7 @@ class _ShimmerLoadingState extends State<ShimmerLoading> {
final shimmer = Shimmer.of(context)!; final shimmer = Shimmer.of(context)!;
if (!shimmer.isSized) { if (!shimmer.isSized) {
return const SizedBox(); return const SizedBox.shrink();
} }
final shimmerSize = shimmer.size; final shimmerSize = shimmer.size;
final gradient = shimmer.gradient; final gradient = shimmer.gradient;

View File

@@ -37,11 +37,12 @@ class HttpError extends StatelessWidget {
), ),
const SizedBox(height: 30), const SizedBox(height: 30),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 16), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 5),
child: SelectableText( child: SelectableText(
errMsg ?? '没有数据', errMsg ?? '没有数据',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleSmall, style: Theme.of(context).textTheme.titleSmall,
scrollPhysics: const NeverScrollableScrollPhysics(),
), ),
), ),
if (onReload != null) if (onReload != null)

View File

@@ -97,7 +97,7 @@ class NetworkImgLayer extends StatelessWidget {
), ),
), ),
child: type == 'bg' child: type == 'bg'
? const SizedBox() ? const SizedBox.shrink()
: Center( : Center(
child: Image.asset( child: Image.asset(
type == 'avatar' type == 'avatar'

View File

@@ -38,7 +38,7 @@ class _SelfSizedHorizontalListState extends State<SelfSizedHorizontalList> {
if (height == null) { if (height == null) {
WidgetsBinding.instance.addPostFrameCallback((v) => setState(() {})); WidgetsBinding.instance.addPostFrameCallback((v) => setState(() {}));
} }
if (widget.itemCount == 0) return const SizedBox(); if (widget.itemCount == 0) return const SizedBox.shrink();
if (isInit) { if (isInit) {
return Container( return Container(
key: infoKey, key: infoKey,

View File

@@ -780,69 +780,65 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
Widget replyList(LoadingState<List<ReplyInfo>?> loadingState) { Widget replyList(LoadingState<List<ReplyInfo>?> loadingState) {
return switch (loadingState) { return switch (loadingState) {
Loading() => SliverList( Loading() => SliverList.builder(
delegate: SliverChildBuilderDelegate( itemBuilder: (context, index) {
(context, index) { return const VideoReplySkeleton();
return const VideoReplySkeleton(); },
}, itemCount: 8,
childCount: 8,
),
), ),
Success() => loadingState.response?.isNotEmpty == true Success() => loadingState.response?.isNotEmpty == true
? SliverList( ? SliverList.builder(
delegate: SliverChildBuilderDelegate( itemBuilder: (context, index) {
(context, index) { if (index == loadingState.response!.length) {
if (index == loadingState.response!.length) { _dynamicDetailController.onLoadMore();
_dynamicDetailController.onLoadMore(); return Container(
return Container( alignment: Alignment.center,
alignment: Alignment.center, margin: EdgeInsets.only(
margin: EdgeInsets.only( bottom: MediaQuery.of(context).padding.bottom),
bottom: MediaQuery.of(context).padding.bottom), height: 125,
height: 125, child: Text(
child: Text( _dynamicDetailController.isEnd.not
_dynamicDetailController.isEnd.not ? '加载中...'
? '加载中...' : loadingState.response!.isEmpty
: loadingState.response!.isEmpty ? '还没有评论'
? '没有评论' : '没有更多了',
: '没有更多了', style: TextStyle(
style: TextStyle( fontSize: 12,
fontSize: 12, color: Theme.of(context).colorScheme.outline,
color: Theme.of(context).colorScheme.outline,
),
), ),
); ),
} else { );
return ReplyItemGrpc( } else {
replyItem: loadingState.response![index], return ReplyItemGrpc(
replyLevel: '1', replyItem: loadingState.response![index],
replyReply: (replyItem, id) => replyLevel: '1',
replyReply(context, replyItem, id), replyReply: (replyItem, id) =>
onReply: () { replyReply(context, replyItem, id),
_dynamicDetailController.onReply( onReply: () {
context, _dynamicDetailController.onReply(
replyItem: loadingState.response![index], context,
index: index, replyItem: loadingState.response![index],
); index: index,
}, );
onDelete: (subIndex) => },
_dynamicDetailController.onRemove(index, subIndex), onDelete: (subIndex) =>
upMid: _dynamicDetailController.upMid, _dynamicDetailController.onRemove(index, subIndex),
callback: _getImageCallback, upMid: _dynamicDetailController.upMid,
onCheckReply: (item) => callback: _getImageCallback,
_dynamicDetailController.onCheckReply(context, item), onCheckReply: (item) =>
onToggleTop: (isUpTop, rpid) => _dynamicDetailController.onCheckReply(context, item),
_dynamicDetailController.onToggleTop( onToggleTop: (isUpTop, rpid) =>
index, _dynamicDetailController.onToggleTop(
_dynamicDetailController.oid, index,
_dynamicDetailController.type, _dynamicDetailController.oid,
isUpTop, _dynamicDetailController.type,
rpid, isUpTop,
), rpid,
); ),
} );
}, }
childCount: loadingState.response!.length + 1, },
), itemCount: loadingState.response!.length + 1,
) )
: HttpError( : HttpError(
onReload: _dynamicDetailController.onReload, onReload: _dynamicDetailController.onReload,

View File

@@ -103,13 +103,11 @@ class _DynamicsTabPageState
const SliverFillRemaining(), const SliverFillRemaining(),
SliverConstrainedCrossAxis( SliverConstrainedCrossAxis(
maxExtent: Grid.smallCardWidth * 2, maxExtent: Grid.smallCardWidth * 2,
sliver: SliverList( sliver: SliverList.builder(
delegate: SliverChildBuilderDelegate( itemBuilder: (context, index) {
(context, index) { return const DynamicCardSkeleton();
return const DynamicCardSkeleton(); },
}, itemCount: 10,
childCount: 10,
),
), ),
), ),
const SliverFillRemaining() const SliverFillRemaining()
@@ -177,28 +175,25 @@ class _DynamicsTabPageState
const SliverFillRemaining(), const SliverFillRemaining(),
SliverConstrainedCrossAxis( SliverConstrainedCrossAxis(
maxExtent: Grid.smallCardWidth * 2, maxExtent: Grid.smallCardWidth * 2,
sliver: SliverList( sliver: SliverList.builder(
delegate: SliverChildBuilderDelegate( itemBuilder: (context, index) {
(context, index) { if (index == loadingState.response!.length - 1) {
if (index == controller.onLoadMore();
loadingState.response!.length - 1) { }
controller.onLoadMore(); final item = loadingState.response![index];
} if ((dynamicsController.tabController.index ==
final item = loadingState.response![index]; 4 &&
if ((dynamicsController.tabController.index == dynamicsController.mid.value != -1) ||
4 && !dynamicsController.tempBannedList.contains(
dynamicsController.mid.value != -1) || item.modules?.moduleAuthor?.mid)) {
!dynamicsController.tempBannedList.contains( return DynamicPanel(
item.modules?.moduleAuthor?.mid)) { item: item,
return DynamicPanel( onRemove: controller.onRemove,
item: item, );
onRemove: controller.onRemove, }
); return const SizedBox.shrink();
} },
return const SizedBox.shrink(); itemCount: loadingState.response!.length,
},
childCount: loadingState.response!.length,
),
), ),
), ),
const SliverFillRemaining(), const SliverFillRemaining(),

View File

@@ -134,17 +134,17 @@ Widget addWidget(item, context, type, {floor = 1}) {
), ),
), ),
) )
: const SizedBox() : const SizedBox.shrink()
: const SizedBox(); : const SizedBox.shrink();
case 'ADDITIONAL_TYPE_GOODS': case 'ADDITIONAL_TYPE_GOODS':
// 商品 // 商品
return const SizedBox(); return const SizedBox.shrink();
case 'ADDITIONAL_TYPE_MATCH': case 'ADDITIONAL_TYPE_MATCH':
return const SizedBox(); return const SizedBox.shrink();
case 'ADDITIONAL_TYPE_COMMON': case 'ADDITIONAL_TYPE_COMMON':
return const SizedBox(); return const SizedBox.shrink();
case 'ADDITIONAL_TYPE_VOTE': case 'ADDITIONAL_TYPE_VOTE':
return const SizedBox(); return const SizedBox.shrink();
default: default:
return const Text('11'); return const Text('11');
} }

View File

@@ -6,7 +6,7 @@ Widget picWidget(item, context, callback) {
item.modules.moduleDynamic.major.type == 'MAJOR_TYPE_OPUS') { item.modules.moduleDynamic.major.type == 'MAJOR_TYPE_OPUS') {
/// fix 图片跟rich_node_panel重复 /// fix 图片跟rich_node_panel重复
// pictures = item.modules.moduleDynamic.major.opus.pics; // pictures = item.modules.moduleDynamic.major.opus.pics;
return const SizedBox(); return const SizedBox.shrink();
} }
return LayoutBuilder( return LayoutBuilder(
builder: (context, constraints) => imageView( builder: (context, constraints) => imageView(

View File

@@ -70,36 +70,37 @@ class _UpPanelState extends State<UpPanel> {
), ),
), ),
const SliverToBoxAdapter(child: SizedBox(height: 10)), const SliverToBoxAdapter(child: SizedBox(height: 10)),
SliverList( if (widget.dynamicsController.showLiveItems && liveList.isNotEmpty)
delegate: SliverChildListDelegate( SliverList.builder(
[ itemCount: liveList.length,
if (widget.dynamicsController.showLiveItems && itemBuilder: (context, index) {
liveList.isNotEmpty) ...[ return upItemBuild(liveList[index]);
for (int i = 0; i < liveList.length; i++) ...[ },
upItemBuild(liveList[i], i)
],
],
upItemBuild(UpItem(face: '', uname: '全部动态', mid: -1), 0),
upItemBuild(
UpItem(
uname: '',
face: widget.dynamicsController.face,
mid: widget.dynamicsController.ownerMid,
),
1,
),
for (int i = 0; i < upList.length; i++) ...[
upItemBuild(upList[i], i + 2)
],
],
), ),
SliverToBoxAdapter(
child: upItemBuild(UpItem(face: '', uname: '全部动态', mid: -1)),
),
SliverToBoxAdapter(
child: upItemBuild(
UpItem(
uname: '',
face: widget.dynamicsController.face,
mid: widget.dynamicsController.ownerMid,
),
),
),
SliverList.builder(
itemCount: upList.length,
itemBuilder: (context, index) {
return upItemBuild(upList[index]);
},
), ),
const SliverToBoxAdapter(child: SizedBox(height: 200)), const SliverToBoxAdapter(child: SizedBox(height: 200)),
], ],
); );
} }
Widget upItemBuild(data, i) { Widget upItemBuild(data) {
bool isCurrent = widget.dynamicsController.currentMid == data.mid || bool isCurrent = widget.dynamicsController.currentMid == data.mid ||
widget.dynamicsController.currentMid == -1; widget.dynamicsController.currentMid == -1;
return SizedBox( return SizedBox(

View File

@@ -112,7 +112,7 @@ class _FavFolderSortPageState extends State<FavFolderSortPage> {
} }
Widget get _buildBody { Widget get _buildBody {
return ReorderableListView( return ReorderableListView.builder(
key: _key, key: _key,
scrollController: _scrollController, scrollController: _scrollController,
onReorder: onReorder, onReorder: onReorder,
@@ -120,26 +120,24 @@ class _FavFolderSortPageState extends State<FavFolderSortPage> {
footer: SizedBox( footer: SizedBox(
height: MediaQuery.of(context).padding.bottom + 80, height: MediaQuery.of(context).padding.bottom + 80,
), ),
children: List.generate( itemCount: sortList.length,
sortList.length, itemBuilder: (context, index) {
(index) { final item = sortList[index];
final item = sortList[index]; final key = item.id.toString();
final key = item.id.toString(); return SizedBox(
return SizedBox( key: Key(key),
key: Key(key), height: 98,
height: 98, child: FavItem(
child: FavItem( heroTag: key,
heroTag: key, favFolderItem: item,
favFolderItem: item, onLongPress: index == 0
onLongPress: index == 0 ? () {
? () { SmartDialog.showToast('默认收藏夹不支持排序');
SmartDialog.showToast('默认收藏夹不支持排序'); }
} : null,
: null, ),
), );
); },
},
),
); );
} }
} }

View File

@@ -119,7 +119,7 @@ class _FavSortPageState extends State<FavSortPage> {
} }
Widget get _buildBody { Widget get _buildBody {
return ReorderableListView( return ReorderableListView.builder(
key: _key, key: _key,
scrollController: _scrollController, scrollController: _scrollController,
onReorder: onReorder, onReorder: onReorder,
@@ -127,18 +127,18 @@ class _FavSortPageState extends State<FavSortPage> {
footer: SizedBox( footer: SizedBox(
height: MediaQuery.of(context).padding.bottom + 80, height: MediaQuery.of(context).padding.bottom + 80,
), ),
children: sortList itemCount: sortList.length,
.map( itemBuilder: (context, index) {
(item) => SizedBox( final item = sortList[index];
key: Key(item.id.toString()), return SizedBox(
height: 98, key: Key(item.id.toString()),
child: FavVideoCardH( height: 98,
isSort: true, child: FavVideoCardH(
videoItem: item, isSort: true,
), videoItem: item,
), ),
) );
.toList(), },
); );
} }
} }

View File

@@ -84,7 +84,7 @@ class _LaterPageState extends State<LaterPage>
label: const Text('播放全部'), label: const Text('播放全部'),
icon: const Icon(Icons.playlist_play), icon: const Icon(Icons.playlist_play),
) )
: const SizedBox(), : const SizedBox.shrink(),
), ),
body: SafeArea( body: SafeArea(
top: false, top: false,

View File

@@ -370,7 +370,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
future: _futureBuilder, future: _futureBuilder,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.data == null) { if (snapshot.data == null) {
return const SizedBox(); return const SizedBox.shrink();
} }
Map data = snapshot.data as Map; Map data = snapshot.data as Map;
if (data['status']) { if (data['status']) {
@@ -449,7 +449,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
), ),
); );
} else { } else {
return const SizedBox(); return const SizedBox.shrink();
} }
}, },
), ),

View File

@@ -75,13 +75,11 @@ class _MemberDynamicsPageState extends State<MemberDynamicsPage>
const SliverFillRemaining(), const SliverFillRemaining(),
SliverConstrainedCrossAxis( SliverConstrainedCrossAxis(
maxExtent: Grid.smallCardWidth * 2, maxExtent: Grid.smallCardWidth * 2,
sliver: SliverList( sliver: SliverList.builder(
delegate: SliverChildBuilderDelegate( itemBuilder: (context, index) {
(context, index) { return const DynamicCardSkeleton();
return const DynamicCardSkeleton(); },
}, itemCount: 10,
childCount: 10,
),
), ),
), ),
const SliverFillRemaining() const SliverFillRemaining()
@@ -137,21 +135,18 @@ class _MemberDynamicsPageState extends State<MemberDynamicsPage>
const SliverFillRemaining(), const SliverFillRemaining(),
SliverConstrainedCrossAxis( SliverConstrainedCrossAxis(
maxExtent: Grid.smallCardWidth * 2, maxExtent: Grid.smallCardWidth * 2,
sliver: SliverList( sliver: SliverList.builder(
delegate: SliverChildBuilderDelegate( itemBuilder: (context, index) {
(context, index) { if (index == loadingState.response!.length - 1) {
if (index == _memberDynamicController.onLoadMore();
loadingState.response!.length - 1) { }
_memberDynamicController.onLoadMore(); return DynamicPanel(
} item: loadingState.response![index],
return DynamicPanel( onRemove: _memberDynamicController.onRemove,
item: loadingState.response![index], onSetTop: _memberDynamicController.onSetTop,
onRemove: _memberDynamicController.onRemove, );
onSetTop: _memberDynamicController.onSetTop, },
); itemCount: loadingState.response!.length,
},
childCount: loadingState.response!.length,
),
), ),
), ),
const SliverFillRemaining(), const SliverFillRemaining(),

View File

@@ -59,13 +59,11 @@ class _SearchDynamicState extends State<SearchDynamic>
const SliverFillRemaining(), const SliverFillRemaining(),
SliverConstrainedCrossAxis( SliverConstrainedCrossAxis(
maxExtent: Grid.smallCardWidth * 2, maxExtent: Grid.smallCardWidth * 2,
sliver: SliverList( sliver: SliverList.builder(
delegate: SliverChildBuilderDelegate( itemBuilder: (context, index) {
(context, index) { return const DynamicCardSkeleton();
return const DynamicCardSkeleton(); },
}, itemCount: 10,
childCount: 10,
),
), ),
), ),
const SliverFillRemaining() const SliverFillRemaining()
@@ -120,21 +118,19 @@ class _SearchDynamicState extends State<SearchDynamic>
const SliverFillRemaining(), const SliverFillRemaining(),
SliverConstrainedCrossAxis( SliverConstrainedCrossAxis(
maxExtent: Grid.smallCardWidth * 2, maxExtent: Grid.smallCardWidth * 2,
sliver: SliverList( sliver: SliverList.builder(
delegate: SliverChildBuilderDelegate( itemBuilder: (context, index) {
(context, index) { if (index == loadingState.response!.length - 1) {
if (index == loadingState.response!.length - 1) { EasyThrottle.throttle('member_dynamics',
EasyThrottle.throttle('member_dynamics', const Duration(milliseconds: 1000), () {
const Duration(milliseconds: 1000), () { widget.ctr.searchDynamic(false);
widget.ctr.searchDynamic(false); });
}); }
} return DynamicPanel(
return DynamicPanel( item: loadingState.response![index],
item: loadingState.response![index], );
); },
}, itemCount: loadingState.response!.length,
childCount: loadingState.response!.length,
),
), ),
), ),
const SliverFillRemaining(), const SliverFillRemaining(),

View File

@@ -71,7 +71,6 @@ class _NavigationbarSetPageState extends State<NavigationBarSetPage> {
), ),
body: ReorderableListView( body: ReorderableListView(
onReorder: onReorder, onReorder: onReorder,
physics: const NeverScrollableScrollPhysics(),
footer: SizedBox( footer: SizedBox(
height: MediaQuery.of(context).padding.bottom + 30, height: MediaQuery.of(context).padding.bottom + 30,
), ),

View File

@@ -83,7 +83,6 @@ class _TabbarSetPageState extends State<TabbarSetPage> {
), ),
body: ReorderableListView( body: ReorderableListView(
onReorder: onReorder, onReorder: onReorder,
physics: const NeverScrollableScrollPhysics(),
footer: SizedBox( footer: SizedBox(
height: MediaQuery.of(context).padding.bottom + 30, height: MediaQuery.of(context).padding.bottom + 30,
child: const Align( child: const Align(

View File

@@ -86,7 +86,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (episodes.isEmpty) { if (episodes.isEmpty) {
return const SizedBox(); return const SizedBox.shrink();
} }
return Builder(builder: (BuildContext context) { return Builder(builder: (BuildContext context) {
return Container( return Container(

View File

@@ -135,13 +135,11 @@ class _NoteListPageState extends CommonSlidePageState<NoteListPage> {
Loading() => CustomScrollView( Loading() => CustomScrollView(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
slivers: [ slivers: [
SliverList( SliverList.builder(
delegate: SliverChildBuilderDelegate( itemBuilder: (context, index) {
(BuildContext context, int index) { return const VideoReplySkeleton();
return const VideoReplySkeleton(); },
}, itemCount: 8,
childCount: 8,
),
) )
], ],
), ),

View File

@@ -196,71 +196,67 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
Widget _buildBody(LoadingState loadingState) { Widget _buildBody(LoadingState loadingState) {
return switch (loadingState) { return switch (loadingState) {
Loading() => SliverList( Loading() => SliverList.builder(
delegate: SliverChildBuilderDelegate( itemBuilder: (BuildContext context, index) {
(BuildContext context, index) { return const VideoReplySkeleton();
return const VideoReplySkeleton(); },
}, itemCount: 5,
childCount: 5,
),
), ),
Success() => loadingState.response?.isNotEmpty == true Success() => loadingState.response?.isNotEmpty == true
? SliverList( ? SliverList.builder(
delegate: SliverChildBuilderDelegate( itemBuilder: (context, index) {
(BuildContext context, index) { double bottom = MediaQuery.of(context).padding.bottom;
double bottom = MediaQuery.of(context).padding.bottom; if (index == loadingState.response.length) {
if (index == loadingState.response.length) { _videoReplyController.onLoadMore();
_videoReplyController.onLoadMore(); return Container(
return Container( alignment: Alignment.center,
alignment: Alignment.center, padding: EdgeInsets.only(bottom: bottom),
padding: EdgeInsets.only(bottom: bottom), height: bottom + 100,
height: bottom + 100, child: Text(
child: Text( _videoReplyController.isEnd.not
_videoReplyController.isEnd.not ? '加载中...'
? '加载中...' : loadingState.response.isEmpty
: loadingState.response.isEmpty ? '还没有评论'
? '没有评论' : '没有更多了',
: '没有更多了', style: TextStyle(
style: TextStyle( fontSize: 12,
fontSize: 12, color: Theme.of(context).colorScheme.outline,
color: Theme.of(context).colorScheme.outline,
),
), ),
); ),
} else { );
return ReplyItemGrpc( } else {
replyItem: loadingState.response[index], return ReplyItemGrpc(
replyLevel: widget.replyLevel, replyItem: loadingState.response[index],
replyReply: widget.replyReply, replyLevel: widget.replyLevel,
onReply: () { replyReply: widget.replyReply,
_videoReplyController.onReply( onReply: () {
context, _videoReplyController.onReply(
replyItem: loadingState.response[index], context,
index: index, replyItem: loadingState.response[index],
); index: index,
}, );
onDelete: (subIndex) => },
_videoReplyController.onRemove(index, subIndex), onDelete: (subIndex) =>
upMid: _videoReplyController.upMid, _videoReplyController.onRemove(index, subIndex),
getTag: () => heroTag, upMid: _videoReplyController.upMid,
onViewImage: widget.onViewImage, getTag: () => heroTag,
onDismissed: widget.onDismissed, onViewImage: widget.onViewImage,
callback: widget.callback, onDismissed: widget.onDismissed,
onCheckReply: (item) => callback: widget.callback,
_videoReplyController.onCheckReply(context, item), onCheckReply: (item) =>
onToggleTop: (isUpTop, rpid) => _videoReplyController.onCheckReply(context, item),
_videoReplyController.onToggleTop( onToggleTop: (isUpTop, rpid) =>
index, _videoReplyController.onToggleTop(
_videoReplyController.aid, index,
ReplyType.video.index, _videoReplyController.aid,
isUpTop, ReplyType.video.index,
rpid, isUpTop,
), rpid,
); ),
} );
}, }
childCount: loadingState.response.length + 1, },
), itemCount: loadingState.response.length + 1,
) )
: HttpError( : HttpError(
errMsg: '还没有评论', errMsg: '还没有评论',

View File

@@ -391,13 +391,11 @@ class _VideoReplyReplyPanelState
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
slivers: [ slivers: [
SliverList( SliverList.builder(
delegate: SliverChildBuilderDelegate( itemBuilder: (context, index) {
(BuildContext context, int index) { return const VideoReplySkeleton();
return const VideoReplySkeleton(); },
}, itemCount: 8,
childCount: 8,
),
) )
], ],
), ),

View File

@@ -1226,7 +1226,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
Widget get childWhenEnabled => Obx( Widget get childWhenEnabled => Obx(
() => !videoDetailController.autoPlay.value () => !videoDetailController.autoPlay.value
? const SizedBox() ? const SizedBox.shrink()
: PLVideoPlayer( : PLVideoPlayer(
key: Key(heroTag), key: Key(heroTag),
plPlayerController: plPlayerController!, plPlayerController: plPlayerController!,

View File

@@ -782,7 +782,7 @@ class HeaderControlState extends State<HeaderControl> {
Icons.done, Icons.done,
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
) )
: const SizedBox(), : const SizedBox.shrink(),
), ),
] ]
], ],
@@ -858,7 +858,7 @@ class HeaderControlState extends State<HeaderControl> {
Icons.done, Icons.done,
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
) )
: const SizedBox(), : const SizedBox.shrink(),
), ),
] ]
], ],
@@ -1832,7 +1832,7 @@ class HeaderControlState extends State<HeaderControl> {
Icons.done, Icons.done,
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
) )
: const SizedBox(), : const SizedBox.shrink(),
) )
], ],
], ],
@@ -2014,7 +2014,7 @@ class HeaderControlState extends State<HeaderControl> {
} }
clock?.cancel(); clock?.cancel();
clock = null; clock = null;
return SizedBox.shrink(); return const SizedBox.shrink();
}, },
), ),
if (videoDetailCtr.enableSponsorBlock == true) if (videoDetailCtr.enableSponsorBlock == true)

View File

@@ -130,7 +130,9 @@ class _WhisperDetailPageState
reverse: true, reverse: true,
itemCount: loadingState.response!.length, itemCount: loadingState.response!.length,
padding: const EdgeInsets.only(bottom: 12), padding: const EdgeInsets.only(bottom: 12),
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(
parent: ClampingScrollPhysics(),
),
controller: _whisperDetailController.scrollController, controller: _whisperDetailController.scrollController,
itemBuilder: (context, int index) { itemBuilder: (context, int index) {
if (index == loadingState.response!.length - 1) { if (index == loadingState.response!.length - 1) {

View File

@@ -458,7 +458,7 @@ class ChatItem extends StatelessWidget {
return isSystem return isSystem
? messageContent(context) ? messageContent(context)
: isRevoke : isRevoke
? const SizedBox() ? const SizedBox.shrink()
: GestureDetector( : GestureDetector(
onLongPress: () { onLongPress: () {
Feedback.forLongPress(context); Feedback.forLongPress(context);

View File

@@ -1270,24 +1270,6 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
), ),
), ),
// Obx(() {
// if (_.buffered.value == Duration.zero) {
// return Positioned.fill(
// child: Container(
// color: Colors.black,
// child: Center(
// child: Image.asset(
// 'assets/images/loading.gif',
// height: 25,
// ),
// ),
// ),
// );
// } else {
// return Container();
// }
// }),
// 头部、底部控制条 // 头部、底部控制条
Obx( Obx(
() => Positioned.fill( () => Positioned.fill(