Skip to main content

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.


LMFeedPostFooter

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

PropertyTypeDescriptionRequiredDefault
showSaveButtonboolWhether to show the save button.true
showLikeButtonboolWhether to show the like button.true
showCommentButtonboolWhether to show the comment button.true
showShareButtonboolWhether to show the share button.true
showRepostButtonboolWhether to show the repost button.false
widthdoubleThe width of the post footer.
heightdoubleThe height of the post footer.
paddingEdgeInsetsThe padding of the post footer.
marginEdgeInsetsThe margin of the post footer.
alignmentMainAxisAlignmentThe alignment of the buttons in the post footer.
likeButtonStyleLMFeedButtonStyleThe style for the like button.
commentButtonStyleLMFeedButtonStyleThe style for the comment button.
saveButtonStyleLMFeedButtonStyleThe style for the save button.
shareButtonStyleLMFeedButtonStyleThe style for the share button.
repostButtonStyleLMFeedButtonStyleThe 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.