mirror of
https://github.com/Iconica-Development/flutter_timeline.git
synced 2025-05-18 18:13:46 +02:00
fix: first item scrolling under categories
This commit is contained in:
parent
09b11dbbc7
commit
c41f43bb2a
3 changed files with 36 additions and 16 deletions
4
.github/workflows/melos-component-ci.yml
vendored
4
.github/workflows/melos-component-ci.yml
vendored
|
@ -9,6 +9,4 @@ jobs:
|
||||||
call-global-iconica-workflow:
|
call-global-iconica-workflow:
|
||||||
uses: Iconica-Development/.github/.github/workflows/melos-ci.yml@master
|
uses: Iconica-Development/.github/.github/workflows/melos-ci.yml@master
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
with:
|
|
||||||
flutter_version: 3.24
|
|
|
@ -95,7 +95,7 @@ class _TimelineScreenState extends State<TimelineScreen> {
|
||||||
|
|
||||||
void _updateIsOnTop() {
|
void _updateIsOnTop() {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isOnTop = controller.position.pixels < 40;
|
_isOnTop = controller.position.pixels < 0.1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ class _TimelinePostWidgetState extends State<TimelinePostWidget> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var theme = Theme.of(context);
|
var theme = Theme.of(context);
|
||||||
var isLikedByUser = widget.post.likedBy?.contains(widget.userId) ?? false;
|
var isLikedByUser = widget.post.likedBy?.contains(widget.userId) ?? false;
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: widget.post.imageUrl != null || widget.post.image != null
|
height: widget.post.imageUrl != null || widget.post.image != null
|
||||||
? widget.options.postWidgetHeight
|
? widget.options.postWidgetHeight
|
||||||
|
@ -65,7 +66,7 @@ class _TimelinePostWidgetState extends State<TimelinePostWidget> {
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
if (widget.post.creator != null)
|
if (widget.post.creator != null) ...[
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: widget.onUserTap != null
|
onTap: widget.onUserTap != null
|
||||||
? () =>
|
? () =>
|
||||||
|
@ -110,9 +111,10 @@ class _TimelinePostWidgetState extends State<TimelinePostWidget> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
if (widget.allowAllDeletion ||
|
if (widget.allowAllDeletion ||
|
||||||
widget.post.creator?.userId == widget.userId)
|
widget.post.creator?.userId == widget.userId) ...[
|
||||||
PopupMenuButton(
|
PopupMenuButton(
|
||||||
onSelected: (value) async {
|
onSelected: (value) async {
|
||||||
if (value == 'delete') {
|
if (value == 'delete') {
|
||||||
|
@ -151,6 +153,7 @@ class _TimelinePostWidgetState extends State<TimelinePostWidget> {
|
||||||
color: widget.options.theme.iconColor,
|
color: widget.options.theme.iconColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// image of the post
|
// image of the post
|
||||||
|
@ -313,16 +316,9 @@ class _TimelinePostWidgetState extends State<TimelinePostWidget> {
|
||||||
post: widget.post,
|
post: widget.post,
|
||||||
),
|
),
|
||||||
] else ...[
|
] else ...[
|
||||||
Text(
|
_PostLikeCountText(
|
||||||
'${widget.post.likes} '
|
post: widget.post,
|
||||||
'${widget.post.likes > 1
|
options: widget.options,
|
||||||
? widget.options.translations.multipleLikesTitle
|
|
||||||
: widget.options.translations.oneLikeTitle}',
|
|
||||||
style:
|
|
||||||
widget.options.theme.textStyles.listPostLikeTitleAndAmount ??
|
|
||||||
theme.textTheme.titleSmall!.copyWith(
|
|
||||||
color: Colors.black,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Text.rich(
|
Text.rich(
|
||||||
TextSpan(
|
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(
|
Future<void> showPostDeletionConfirmationDialog(
|
||||||
TimelineOptions options,
|
TimelineOptions options,
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
|
|
Loading…
Reference in a new issue