Skip to content

A simple yet powerful rich text view and editor for Flutter that supports mention, hashtag, email, url and see more.

License

Notifications You must be signed in to change notification settings

refactory-id/rich_text_view

 
 

Repository files navigation

rich_text_view

A simple yet powerful rich text view that supports mention, hashtag, email, url and see more.

Example

RichTextView as a Text Widget

 RichTextView(
              text:
                  "Who else thinks it's thinks it's just cool to mention
                     @jane when #JaneMustLive is trending without even trying
                     to send an email to [email protected] verify the 
                     facts talkmore of visiting www.janedoe.com",
              maxLines: 3,
              align: TextAlign.center,
              onEmailClicked: (email) => print('$email clicked'),
              onHashTagClicked: (hashtag) => print('is $hashtag trending?'),
              onMentionClicked: (mention) => print('$mention clicked'),
              onUrlClicked: (url) => print('visting $url?'),
            )

RichTextView as a Text Editor

You can use the RichTextView widget as an input field that supports suggestions when mentioning or using hashtags

RichTextView.editor(
                  suggestionPosition: SuggestionPosition.bottom,
                  onSearchPeople: (term) async {
                    return [
                      Suggestion(
                          imageURL: 'imageURL',
                          subtitle: 'I am the little guy from Coal city',
                          title: 'Nelly Gane')
                    ];
                  },
                  onSearchTags: (term) async {
                    return [
                      HashTag(hashtag: 'Dart', subtitle: '20 posts', trending: true)
                    ];
                  },
                )

About

A simple yet powerful rich text view and editor for Flutter that supports mention, hashtag, email, url and see more.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 93.2%
  • HTML 3.6%
  • Swift 2.8%
  • Other 0.4%