Skip to content

Commit

Permalink
mod: 评论头部样式
Browse files Browse the repository at this point in the history
  • Loading branch information
guozhigq committed Mar 24, 2024
1 parent 72f1a82 commit 8ff387d
Showing 1 changed file with 13 additions and 32 deletions.
45 changes: 13 additions & 32 deletions lib/pages/video/detail/reply/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,46 +148,27 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
floating: true,
delegate: _MySliverPersistentHeaderDelegate(
child: Container(
height: 45,
padding: const EdgeInsets.fromLTRB(12, 0, 6, 0),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.background,
border: Border(
bottom: BorderSide(
color: Theme.of(context)
.colorScheme
.outline
.withOpacity(0.1)),
),
),
height: 40,
padding: const EdgeInsets.fromLTRB(12, 6, 6, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Obx(
() => AnimatedSwitcher(
duration: const Duration(milliseconds: 400),
transitionBuilder:
(Widget child, Animation<double> animation) {
return ScaleTransition(
scale: animation, child: child);
},
child: Text(
'共${_videoReplyController.count.value}条回复',
key: ValueKey<int>(
_videoReplyController.count.value),
),
),
Text(
'${_videoReplyController.sortTypeLabel.value}评论',
style: const TextStyle(fontSize: 13),
),
SizedBox(
height: 35,
child: TextButton.icon(
onPressed: () =>
_videoReplyController.queryBySort(),
icon: const Icon(Icons.sort, size: 16),
label: Obx(() => Text(
_videoReplyController.sortTypeLabel.value,
style: const TextStyle(fontSize: 13),
)),
label: Obx(
() => Text(
_videoReplyController.sortTypeLabel.value,
style: const TextStyle(fontSize: 13),
),
),
),
)
],
Expand Down Expand Up @@ -329,8 +310,8 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>

class _MySliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate {
_MySliverPersistentHeaderDelegate({required this.child});
final double _minExtent = 45;
final double _maxExtent = 45;
final double _minExtent = 40;
final double _maxExtent = 40;
final Widget child;

@override
Expand Down

0 comments on commit 8ff387d

Please sign in to comment.