mod: fontweight

This commit is contained in:
bggRGjQaUbCoE
2024-08-26 23:23:37 +08:00
parent 51083f2bd1
commit 0df54fe6a5
9 changed files with 113 additions and 114 deletions

View File

@@ -92,7 +92,7 @@ class LiveContent extends StatelessWidget {
Text( Text(
liveItem.title as String, liveItem.title as String,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w600), style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w400),
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),

View File

@@ -44,94 +44,89 @@ class VideoCardH extends StatelessWidget {
final String heroTag = Utils.makeHeroTag(aid); final String heroTag = Utils.makeHeroTag(aid);
return Stack(children: [ return Stack(children: [
Semantics( Semantics(
label: Utils.videoItemSemantics(videoItem), label: Utils.videoItemSemantics(videoItem),
excludeSemantics: true, excludeSemantics: true,
child: GestureDetector( child: InkWell(
onLongPress: () { borderRadius: BorderRadius.circular(12),
if (longPress != null) { onLongPress: () {
longPress!(); if (longPress != null) {
} longPress!();
}
},
onTap: () async {
if (type == 'ketang') {
SmartDialog.showToast('课堂视频暂不支持播放');
return;
}
try {
final int cid =
videoItem.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid);
Get.toNamed('/video?bvid=$bvid&cid=$cid',
arguments: {'videoItem': videoItem, 'heroTag': heroTag});
} catch (err) {
SmartDialog.showToast(err.toString());
}
},
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints boxConstraints) {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AspectRatio(
aspectRatio: StyleString.aspectRatio,
child: LayoutBuilder(
builder: (BuildContext context,
BoxConstraints boxConstraints) {
final double maxWidth = boxConstraints.maxWidth;
final double maxHeight = boxConstraints.maxHeight;
return Stack(
children: [
Hero(
tag: heroTag,
child: NetworkImgLayer(
src: videoItem.pic as String,
width: maxWidth,
height: maxHeight,
),
),
if (videoItem.duration != 0)
PBadge(
text: Utils.timeFormat(videoItem.duration!),
right: 6.0,
bottom: 6.0,
type: 'gray',
),
if (type != 'video')
PBadge(
text: type,
left: 6.0,
bottom: 6.0,
type: 'primary',
),
// if (videoItem.rcmdReason != null &&
// videoItem.rcmdReason.content != '')
// pBadge(videoItem.rcmdReason.content, context,
// 6.0, 6.0, null, null),
],
);
},
),
),
VideoContent(
videoItem: videoItem,
source: source,
showOwner: showOwner,
showView: showView,
showDanmaku: showDanmaku,
showPubdate: showPubdate,
)
],
);
}, },
// onLongPressEnd: (details) { ),
// if (longPressEnd != null) { ),
// longPressEnd!(); ),
// }
// },
child: InkWell(
onTap: () async {
if (type == 'ketang') {
SmartDialog.showToast('课堂视频暂不支持播放');
return;
}
try {
final int cid = videoItem.cid ??
await SearchHttp.ab2c(aid: aid, bvid: bvid);
Get.toNamed('/video?bvid=$bvid&cid=$cid',
arguments: {'videoItem': videoItem, 'heroTag': heroTag});
} catch (err) {
SmartDialog.showToast(err.toString());
}
},
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints boxConstraints) {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AspectRatio(
aspectRatio: StyleString.aspectRatio,
child: LayoutBuilder(
builder: (BuildContext context,
BoxConstraints boxConstraints) {
final double maxWidth = boxConstraints.maxWidth;
final double maxHeight = boxConstraints.maxHeight;
return Stack(
children: [
Hero(
tag: heroTag,
child: NetworkImgLayer(
src: videoItem.pic as String,
width: maxWidth,
height: maxHeight,
),
),
if (videoItem.duration != 0)
PBadge(
text: Utils.timeFormat(videoItem.duration!),
right: 6.0,
bottom: 6.0,
type: 'gray',
),
if (type != 'video')
PBadge(
text: type,
left: 6.0,
bottom: 6.0,
type: 'primary',
),
// if (videoItem.rcmdReason != null &&
// videoItem.rcmdReason.content != '')
// pBadge(videoItem.rcmdReason.content, context,
// 6.0, 6.0, null, null),
],
);
},
),
),
VideoContent(
videoItem: videoItem,
source: source,
showOwner: showOwner,
showView: showView,
showDanmaku: showDanmaku,
showPubdate: showPubdate,
)
],
);
},
),
),
)),
if (source == 'normal') if (source == 'normal')
Positioned( Positioned(
bottom: 0, bottom: 0,
@@ -183,7 +178,7 @@ class VideoContent extends StatelessWidget {
videoItem.title as String, videoItem.title as String,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w400,
fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize,
height: 1.42, height: 1.42,
letterSpacing: 0.3, letterSpacing: 0.3,
@@ -203,7 +198,7 @@ class VideoContent extends StatelessWidget {
TextSpan( TextSpan(
text: i['text'] as String, text: i['text'] as String,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w400,
fontSize: Theme.of(context) fontSize: Theme.of(context)
.textTheme .textTheme
.bodyMedium! .bodyMedium!
@@ -242,7 +237,7 @@ class VideoContent extends StatelessWidget {
Expanded( Expanded(
flex: 0, flex: 0,
child: Text( child: Text(
"${pubdate} ${showOwner ? videoItem.owner.name : ''}", "$pubdate ${showOwner ? videoItem.owner.name : ''}",
maxLines: 1, maxLines: 1,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,

View File

@@ -217,7 +217,7 @@ class VideoContent extends StatelessWidget {
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w400,
height: 1.38, height: 1.38,
)), )),
), ),

View File

@@ -159,7 +159,7 @@ class BangumiContent extends StatelessWidget {
bangumiItem.title, bangumiItem.title,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w400,
letterSpacing: 0.3, letterSpacing: 0.3,
), ),
maxLines: 1, maxLines: 1,

View File

@@ -102,7 +102,7 @@ class LiveContent extends StatelessWidget {
liveItem.title, liveItem.title,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w400,
letterSpacing: 0.3, letterSpacing: 0.3,
), ),
maxLines: 2, maxLines: 2,

View File

@@ -103,25 +103,24 @@ class _SearchPageState extends State<SearchPage> with RouteAware {
} }
Widget _searchSuggest() { Widget _searchSuggest() {
SSearchController ssCtr = _searchController;
return Obx( return Obx(
() => ssCtr.searchSuggestList.isNotEmpty && () => _searchController.searchSuggestList.isNotEmpty &&
ssCtr.searchSuggestList.first.term != null && _searchController.searchSuggestList.first.term != null &&
ssCtr.controller.value.text != '' _searchController.controller.value.text != ''
? ListView.builder( ? ListView.builder(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemCount: ssCtr.searchSuggestList.length, itemCount: _searchController.searchSuggestList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
customBorder: RoundedRectangleBorder( customBorder: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
), ),
onTap: () => ssCtr onTap: () => _searchController.onClickKeyword(
.onClickKeyword(ssCtr.searchSuggestList[index].term!), _searchController.searchSuggestList[index].term!),
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 20, top: 9, bottom: 9), padding: const EdgeInsets.only(left: 20, top: 9, bottom: 9),
child: ssCtr.searchSuggestList[index].textRich, child: _searchController.searchSuggestList[index].textRich,
), ),
); );
}, },
@@ -152,7 +151,7 @@ class _SearchPageState extends State<SearchPage> with RouteAware {
height: 34, height: 34,
child: TextButton.icon( child: TextButton.icon(
style: ButtonStyle( style: ButtonStyle(
padding: MaterialStateProperty.all(const EdgeInsets.only( padding: WidgetStateProperty.all(const EdgeInsets.only(
left: 10, top: 6, bottom: 6, right: 10)), left: 10, top: 6, bottom: 6, right: 10)),
), ),
onPressed: () => ctr.queryHotSearchList(), onPressed: () => ctr.queryHotSearchList(),

View File

@@ -126,7 +126,8 @@ class _SearchPanelState extends State<SearchPanel>
errMsg: '没有相关数据', errMsg: '没有相关数据',
fn: () { fn: () {
setState(() { setState(() {
_searchPanelController.onSearch(); _futureBuilderFuture =
_searchPanelController.onSearch();
}); });
}, },
), ),

View File

@@ -29,6 +29,7 @@ class ReplyItem extends StatelessWidget {
this.showReplyRow = true, this.showReplyRow = true,
this.replyReply, this.replyReply,
this.replyType, this.replyType,
this.needDivider = true,
super.key, super.key,
}); });
final ReplyItemModel? replyItem; final ReplyItemModel? replyItem;
@@ -37,6 +38,7 @@ class ReplyItem extends StatelessWidget {
final bool? showReplyRow; final bool? showReplyRow;
final Function? replyReply; final Function? replyReply;
final ReplyType? replyType; final ReplyType? replyType;
final bool needDivider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -66,15 +68,16 @@ class ReplyItem extends StatelessWidget {
padding: const EdgeInsets.fromLTRB(12, 14, 8, 5), padding: const EdgeInsets.fromLTRB(12, 14, 8, 5),
child: content(context), child: content(context),
), ),
Divider( if (needDivider)
indent: 55, Divider(
endIndent: 15, indent: 55,
height: 0.3, endIndent: 15,
color: Theme.of(context) height: 0.3,
.colorScheme color: Theme.of(context)
.onInverseSurface .colorScheme
.withOpacity(0.5), .onInverseSurface
) .withOpacity(0.5),
)
], ],
), ),
), ),

View File

@@ -75,7 +75,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
return Container( return Container(
height: height:
widget.source == 'videoDetail' ? Utils.getSheetHeight(context) : null, widget.source == 'videoDetail' ? Utils.getSheetHeight(context) : null,
color: Theme.of(context).colorScheme.background, color: Theme.of(context).colorScheme.surface,
child: Column( child: Column(
children: [ children: [
if (widget.source == 'videoDetail') if (widget.source == 'videoDetail')
@@ -125,6 +125,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
}, },
replyType: widget.replyType, replyType: widget.replyType,
replyReply: (replyItem) => replyReply(replyItem), replyReply: (replyItem) => replyReply(replyItem),
needDivider: false,
), ),
), ),
SliverToBoxAdapter( SliverToBoxAdapter(