LMFeedPostFooter
LMFeedPostFooter
is a widget that represents the footer section of a post in a feed. It contains various buttons for user interaction, such as like, comment, save, share, and repost. The footer can be customized to show or hide specific buttons and to modify their appearance and behavior.
The LMFeedPostFooter
widget is a part of the likeminds_feed_flutter_ui
package. It is designed to be used within an LMFeedPostWidget
to provide a consistent and customizable footer for each post in the feed.
Properties
postFooterStyle
(LMFeedPostFooterStyle
)
An instance of LMFeedPostFooterStyle
to customize the appearance of the post footer. This is an optional parameter.
likeButtonBuilder
(Widget Function(LMFeedButton)
)
A builder function that takes an LMFeedButton
and returns a custom widget for the like button. This is an optional parameter.
commentButtonBuilder
(Widget Function(LMFeedButton)
)
A builder function that takes an LMFeedButton
and returns a custom widget for the comment button. This is an optional parameter.
saveButtonBuilder
(Widget Function(LMFeedButton)
)
A builder function that takes an LMFeedButton
and returns a custom widget for the save button. This is an optional parameter.
shareButtonBuilder
(Widget Function(LMFeedButton)
)
A builder function that takes an LMFeedButton
and returns a custom widget for the share button. This is an optional parameter.
repostButtonBuilder
(Widget Function(LMFeedButton)
)
A builder function that takes an LMFeedButton
and returns a custom widget for the repost button. This is an optional parameter.
likeButton
(LMFeedButton
)
An instance of LMFeedButton
to be used as the like button. This is an optional parameter.
commentButton
(LMFeedButton
)
An instance of LMFeedButton
to be used as the comment button. This is an optional parameter.
saveButton
(LMFeedButton
)
An instance of LMFeedButton
to be used as the save button. This is an optional parameter.
shareButton
(LMFeedButton
)
An instance of LMFeedButton
to be used as the share button. This is an optional parameter.
repostButton
(LMFeedButton
)
An instance of LMFeedButton
to be used as the repost button. This is an optional parameter.
showRepostButton
(bool
)
A flag to control whether the repost button should be shown. This is an optional parameter with a default value of false
.
Styling
The LMFeedPostFooterStyle
class allows you to customize the appearance of the LMFeedPostFooter
.
Customization variables
Property | Type | Description | Required | Default |
---|---|---|---|---|
showSaveButton | bool | Whether to show the save button. | true | |
showLikeButton | bool | Whether to show the like button. | true | |
showCommentButton | bool | Whether to show the comment button. | true | |
showShareButton | bool | Whether to show the share button. | true | |
showRepostButton | bool | Whether to show the repost button. | false | |
width | double | The width of the post footer. | ||
height | double | The height of the post footer. | ||
padding | EdgeInsets | The padding of the post footer. | ||
margin | EdgeInsets | The margin of the post footer. | ||
alignment | MainAxisAlignment | The alignment of the buttons in the post footer. | ||
likeButtonStyle | LMFeedButtonStyle | The style for the like button. | ||
commentButtonStyle | LMFeedButtonStyle | The style for the comment button. | ||
saveButtonStyle | LMFeedButtonStyle | The style for the save button. | ||
shareButtonStyle | LMFeedButtonStyle | The style for the share button. | ||
repostButtonStyle | LMFeedButtonStyle | The style for the repost button. |
You can create an instance of LMFeedPostFooterStyle
and pass it to the LMFeedPostFooter
to customize its appearance.
Usage Example
LMFeedPostFooter(
postFooterStyle: LMFeedPostFooterStyle(
showLikeButton: true,
showCommentButton: true,
showShareButton: true,
showSaveButton: true,
showRepostButton: true,
likeButtonStyle: LMFeedButtonStyle(
icon: LMFeedIcon(
type: LMFeedIconType.svg,
assetPath: 'assets/icons/like.svg',
),
activeIcon: LMFeedIcon(
type: LMFeedIconType.svg,
assetPath: 'assets/icons/like_active.svg',
),
),
commentButtonStyle: LMFeedButtonStyle(
icon: LMFeedIcon(
type: LMFeedIconType.svg,
assetPath: 'assets/icons/comment.svg',
),
),
shareButtonStyle: LMFeedButtonStyle(
icon: LMFeedIcon(
type: LMFeedIconType.svg,
assetPath: 'assets/icons/share.svg',
),
),
saveButtonStyle: LMFeedButtonStyle(
icon: LMFeedIcon(
type: LMFeedIconType.svg,
assetPath: 'assets/icons/save.svg',
),
activeIcon: LMFeedIcon(
type: LMFeedIconType.svg,
assetPath: 'assets/icons/save_active.svg',
),
),
repostButtonStyle: LMFeedButtonStyle(
icon: LMFeedIcon(
type: LMFeedIconType.svg,
assetPath: 'assets/icons/repost.svg',
),
),
alignment: MainAxisAlignment.spaceBetween,
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
),
)
In this example, an LMFeedPostFooter
is created with custom button styles and configurations. The postFooterStyle
property is used to specify the visibility of each button, their respective styles, and the overall alignment and padding of the footer.