Skip to main content

How to enable Heading in Post

For getting started, please refer to this doc.

Enabling heading in a post brings you one step closer to building a QnA feed type experience using the LikeMinds Feed Flutter SDK.

To enable heading in a post, follow the below steps.

Step 1

Create an instance of LMFeedConfig class to enable heading.

LMFeedConfig config = LMFeedConfig(
composeConfig: LMFeedComposeScreenConfig(
// This enables heading textfield in compose screen
enableHeading: true,
// Hint to be shown in the Heading text field
headingHint: "Add a heading",
// Whether or not to make heading a requirement for post creation
headingRequiredToCreatePost: true,
),
);

Below is the description of keys you have used in the above snippet.

NameTypeDescriptionOptional
enableHeadingboolEnables/Disables support of heading in LMFeedComposeScreen, default to false✔️
headingHintStringHint text to be shown in heading textfield, default to "Add a heading"✔️
headingRequiredToCreatePostboolWhether or not to make heading compulsory for post creation✔️
enableHeading:

This is the difference in default design when heading in LMFeedComposeScreen is enabled or disabled.

LMFeedComposeScreen

LMFeedComposeScreen

true

false

Step 2

While calling initialize method of LMFeedCore, pass the instance created in Step 1.

await LMFeedCore.instance.initialize(
// Replace below string with api key of your community
apiKey: "YOUR_API_KEY",
config: config,
);

Below is the description of keys you have used in the above snippet.

NameTypeDescriptionOptional
apiKeyStringAPI key of the community
configLMFeedConfigConfigures features in Feed, i.e. topics, heading in post, etc.,✔️