Skip to content

Commit

Permalink
feat(*): Update widgets layout
Browse files Browse the repository at this point in the history
  • Loading branch information
realth000 committed Aug 16, 2024
1 parent d2a21d8 commit 5c3dce0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 32 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- app:图片加载时显示占位图片的大小调整为80x80。
- app:更新app描述和版权页样式。
- app:去除各种卡片的高度,更符合Material 3。
- app: 优化布局。
- 关于:更新版本号格式,更符合semver。
- 分区:某些情况下分区为空时显示登录按钮。
- 分区:分区内筛选帖子的选项现在会一直显示在帖子列表顶部。
Expand Down
2 changes: 1 addition & 1 deletion lib/features/forum/view/forum_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class _ForumPageState extends State<ForumPage>
_buildNormalThreadFilterRow(context, state),
Expanded(
child: Padding(
padding: edgeInsetsL12T4R12B24,
padding: edgeInsetsL12T4R12,
child: CustomScrollView(
controller: _threadScrollController,
physics: physics,
Expand Down
59 changes: 28 additions & 31 deletions lib/widgets/card/post_card/post_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -341,39 +341,36 @@ class _PostCardState extends State<PostCard>
Widget build(BuildContext context) {
super.build(context);

return Padding(
padding: edgeInsetsL12R12B12,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Post author user info.
_buildAuthorRow(context),
// Last edit status.
if (widget.post.lastEditUsername != null &&
widget.post.lastEditTime != null)
_buildLastEditInfoRow(context),
// Post body
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Post author user info.
_buildAuthorRow(context),
// Last edit status.
if (widget.post.lastEditUsername != null &&
widget.post.lastEditTime != null)
_buildLastEditInfoRow(context),
// Post body
sizedBoxW12H12,
_buildPostBody(context),
// 红包 if any.
if (widget.post.locked.isNotEmpty)
...widget.post.locked.where((e) => e.isValid()).map(LockedCard.new),
if (widget.post.packetUrl != null) ...[
sizedBoxW12H12,
_buildPostBody(context),
// 红包 if any.
if (widget.post.locked.isNotEmpty)
...widget.post.locked.where((e) => e.isValid()).map(LockedCard.new),
if (widget.post.packetUrl != null) ...[
sizedBoxW12H12,
PacketCard(widget.post.packetUrl!),
],
// Rate status if any.
if (widget.post.rate != null) ...[
sizedBoxW12H12,
ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 712),
child: RateCard(widget.post.rate!),
),
],
// Context menu.
_buildContextMenu(context),
PacketCard(widget.post.packetUrl!),
],
),
// Rate status if any.
if (widget.post.rate != null) ...[
sizedBoxW12H12,
ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 712),
child: RateCard(widget.post.rate!),
),
],
// Context menu.
_buildContextMenu(context),
],
);
}

Expand Down

0 comments on commit 5c3dce0

Please sign in to comment.