fix: first item scrolling under categories

This commit is contained in:
mike doornenbal 2024-08-22 14:42:13 +02:00 committed by Freek van de Ven
parent 09b11dbbc7
commit c41f43bb2a
3 changed files with 36 additions and 16 deletions

View file

@ -10,5 +10,3 @@ jobs:
uses: Iconica-Development/.github/.github/workflows/melos-ci.yml@master
secrets: inherit
permissions: write-all
with:
flutter_version: 3.24

View file

@ -95,7 +95,7 @@ class _TimelineScreenState extends State<TimelineScreen> {
void _updateIsOnTop() {
setState(() {
_isOnTop = controller.position.pixels < 40;
_isOnTop = controller.position.pixels < 0.1;
});
}

View file

@ -55,6 +55,7 @@ class _TimelinePostWidgetState extends State<TimelinePostWidget> {
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<TimelinePostWidget> {
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<TimelinePostWidget> {
],
),
),
],
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<TimelinePostWidget> {
color: widget.options.theme.iconColor,
),
),
],
],
),
// image of the post
@ -313,16 +316,9 @@ class _TimelinePostWidgetState extends State<TimelinePostWidget> {
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<TimelinePostWidget> {
}
}
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<void> showPostDeletionConfirmationDialog(
TimelineOptions options,
BuildContext context,