diff --git a/.github/workflows/melos-component-ci.yml b/.github/workflows/melos-component-ci.yml index 2df0d4c..869bed9 100644 --- a/.github/workflows/melos-component-ci.yml +++ b/.github/workflows/melos-component-ci.yml @@ -9,6 +9,4 @@ jobs: call-global-iconica-workflow: uses: Iconica-Development/.github/.github/workflows/melos-ci.yml@master secrets: inherit - permissions: write-all - with: - flutter_version: 3.24 \ No newline at end of file + permissions: write-all \ No newline at end of file diff --git a/packages/flutter_timeline_view/lib/src/screens/timeline_screen.dart b/packages/flutter_timeline_view/lib/src/screens/timeline_screen.dart index d5c91fd..f7db082 100644 --- a/packages/flutter_timeline_view/lib/src/screens/timeline_screen.dart +++ b/packages/flutter_timeline_view/lib/src/screens/timeline_screen.dart @@ -95,7 +95,7 @@ class _TimelineScreenState extends State { void _updateIsOnTop() { setState(() { - _isOnTop = controller.position.pixels < 40; + _isOnTop = controller.position.pixels < 0.1; }); } diff --git a/packages/flutter_timeline_view/lib/src/widgets/timeline_post_widget.dart b/packages/flutter_timeline_view/lib/src/widgets/timeline_post_widget.dart index e7760a6..103aac9 100644 --- a/packages/flutter_timeline_view/lib/src/widgets/timeline_post_widget.dart +++ b/packages/flutter_timeline_view/lib/src/widgets/timeline_post_widget.dart @@ -55,6 +55,7 @@ class _TimelinePostWidgetState extends State { Widget build(BuildContext context) { var theme = Theme.of(context); var isLikedByUser = widget.post.likedBy?.contains(widget.userId) ?? false; + return SizedBox( height: widget.post.imageUrl != null || widget.post.image != null ? widget.options.postWidgetHeight @@ -65,7 +66,7 @@ class _TimelinePostWidgetState extends State { children: [ Row( children: [ - if (widget.post.creator != null) + if (widget.post.creator != null) ...[ InkWell( onTap: widget.onUserTap != null ? () => @@ -110,9 +111,10 @@ class _TimelinePostWidgetState extends State { ], ), ), + ], const Spacer(), if (widget.allowAllDeletion || - widget.post.creator?.userId == widget.userId) + widget.post.creator?.userId == widget.userId) ...[ PopupMenuButton( onSelected: (value) async { if (value == 'delete') { @@ -151,6 +153,7 @@ class _TimelinePostWidgetState extends State { color: widget.options.theme.iconColor, ), ), + ], ], ), // image of the post @@ -313,16 +316,9 @@ class _TimelinePostWidgetState extends State { post: widget.post, ), ] else ...[ - Text( - '${widget.post.likes} ' - '${widget.post.likes > 1 - ? widget.options.translations.multipleLikesTitle - : widget.options.translations.oneLikeTitle}', - style: - widget.options.theme.textStyles.listPostLikeTitleAndAmount ?? - theme.textTheme.titleSmall!.copyWith( - color: Colors.black, - ), + _PostLikeCountText( + post: widget.post, + options: widget.options, ), Text.rich( TextSpan( @@ -362,6 +358,32 @@ class _TimelinePostWidgetState extends State { } } +class _PostLikeCountText extends StatelessWidget { + const _PostLikeCountText({ + required this.post, + required this.options, + }); + + final TimelineOptions options; + final TimelinePost post; + @override + Widget build(BuildContext context) { + var theme = Theme.of(context); + var likeTranslation = post.likes > 1 + ? options.translations.multipleLikesTitle + : options.translations.oneLikeTitle; + + return Text( + '${post.likes} ' + '$likeTranslation', + style: options.theme.textStyles.listPostLikeTitleAndAmount ?? + theme.textTheme.titleSmall!.copyWith( + color: Colors.black, + ), + ); + } +} + Future showPostDeletionConfirmationDialog( TimelineOptions options, BuildContext context,