fix: add options icon button on detail screen. (also fixed a typo)

This commit is contained in:
Jacques 2025-02-17 15:15:53 +01:00
parent 35644b989a
commit 4befa42ac4
3 changed files with 8 additions and 9 deletions

View file

@ -57,7 +57,7 @@ class _TimelinePostDetailScreenState extends State<TimelinePostDetailScreen> {
post: widget.post, post: widget.post,
timelineService: widget.timelineService, timelineService: widget.timelineService,
options: widget.options, options: widget.options,
isInDetialView: true, isInDetailView: true,
currentUserId: widget.currentUserId, currentUserId: widget.currentUserId,
onTapPost: (post) {}, onTapPost: (post) {},
onTapComments: (post) {}, onTapComments: (post) {},

View file

@ -42,7 +42,7 @@ class _TimelinePostOverviewState extends State<TimelinePostOverview> {
currentUserId: currentPost.creatorId, currentUserId: currentPost.creatorId,
onTapPost: (post) {}, onTapPost: (post) {},
onTapComments: (post) {}, onTapComments: (post) {},
isInDetialView: true, isInDetailView: true,
isInPostOverview: true, isInPostOverview: true,
), ),
], ],

View file

@ -10,7 +10,7 @@ class TimelinePostWidget extends StatefulWidget {
required this.currentUserId, required this.currentUserId,
required this.onTapPost, required this.onTapPost,
required this.onTapComments, required this.onTapComments,
this.isInDetialView = false, this.isInDetailView = false,
this.isInPostOverview = false, this.isInPostOverview = false,
super.key, super.key,
}); });
@ -20,7 +20,7 @@ class TimelinePostWidget extends StatefulWidget {
final TimelineOptions options; final TimelineOptions options;
final String currentUserId; final String currentUserId;
final Function(TimelinePost post) onTapPost; final Function(TimelinePost post) onTapPost;
final bool isInDetialView; final bool isInDetailView;
final Function(TimelinePost post) onTapComments; final Function(TimelinePost post) onTapComments;
final bool isInPostOverview; final bool isInPostOverview;
@ -47,7 +47,7 @@ class _TimelinePostWidgetState extends State<TimelinePostWidget> {
left: 20, left: 20,
right: 20, right: 20,
top: 20, top: 20,
bottom: widget.isInDetialView ? 100 : 0, bottom: widget.isInDetailView ? 100 : 0,
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -64,8 +64,7 @@ class _TimelinePostWidgetState extends State<TimelinePostWidget> {
], ],
), ),
if (post.creatorId == widget.currentUserId && if (post.creatorId == widget.currentUserId &&
!widget.isInPostOverview && !widget.isInPostOverview)
!widget.isInDetialView)
MoreOptionsButton( MoreOptionsButton(
timelineService: widget.timelineService, timelineService: widget.timelineService,
options: options, options: options,
@ -209,7 +208,7 @@ class _TimelinePostWidgetState extends State<TimelinePostWidget> {
), ),
], ],
), ),
if (widget.isInDetialView) ...[ if (widget.isInDetailView) ...[
const SizedBox( const SizedBox(
height: 20, height: 20,
), ),
@ -234,7 +233,7 @@ class _TimelinePostWidgetState extends State<TimelinePostWidget> {
timelineService: widget.timelineService, timelineService: widget.timelineService,
), ),
], ],
if (!widget.isInDetialView) if (!widget.isInDetailView)
InkWell( InkWell(
onTap: () => widget.onTapPost(widget.post), onTap: () => widget.onTapPost(widget.post),
child: Text( child: Text(