패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.3.0

rich_text_view

멘션, 해시태그, 이메일, URL 및 더 보기 기능을 지원하는 간단하면서도 강력한 리치 텍스트 뷰입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
4.4천
좋아요
65
Pub 점수
140

패키지 설치

flutter pub add rich_text_view

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

rich_text_view는 멘션, 해시태그, 이메일, URL 및 '더 보기' 기능과 같은 상호작용 요소를 포함한 풍부한 텍스트를 표시하는 데 유연하고 직관적인 방법을 제공하는 Flutter 패키지입니다. 단일 텍스트 블록 내에서 클릭 가능한 스타일링된 컴포넌트를 활성화함으로써 텍스트 렌더링을 향상시킵니다. 이 패키지는 Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원하여 동적 텍스트 콘텐츠가 필요한 크로스플랫폼 애플리케이션에 적합합니다. pub 명령을 통해 최소한의 설정만으로 개발자는 앱에 풍부한 텍스트 기능을 쉽게 통합할 수 있습니다.

사용 사례

  • 소셜 미디어 게시물 렌더링
  • 채팅 메시지 표시
  • 블로그 또는 기사 미리보기
  • 링크를 포함한 사용자 생성 콘텐츠
  • 상호작용 댓글 섹션

주요 기능

  • 멘션과 해시태그를 지원합니다
  • URL 및 이메일 처리
  • 더 보기 토글 포함
  • 사용자 지정 스타일
  • 크로스 플랫폼 호환성
  • Flutter와의 간편한 통합

적합한 대상

  • 사용자 생성 콘텐츠를 포함한 앱
  • 메시징 또는 소셜 네트워킹 앱
  • 콘텐츠가 풍부한 UI
  • 동적 텍스트 표시
  • 경량의 리치 텍스트 솔루션을 찾는 개발자

고려 사항

  • 사전 정의된 링크 유형에 한정
  • 내장된 이미지 지원 없음
  • 터치 이벤트를 수동으로 처리해야 합니다
  • 복잡한 리치 텍스트 편집에 적합하지 않음
  • 매우 긴 텍스트에서는 성능이 달라질 수 있습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

rich_text_view

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

Example

RichTextView
 RichTextView(
           text:
                      '''Who else thinks it's thinks it's just cool😎 to mention 
                      @jane when #JaneMustLive is trending without even trying 
                      to send a *bold* email to janedoe@gmail.com and verify the
                       facts talkmore of visiting www.janedoe.com''',
                  maxLines: 3,
                  truncate: true,
                  viewLessText: 'less',
                  linkStyle: TextStyle(color: Colors.blue),
                  supportedTypes: [
                    EmailParser(
                        onTap: (email) => print('${email.value} clicked')),
                    PhoneParser(
                        onTap: (phone) => print('click phone ${phone.value}')),
                    MentionParser(
                        onTap: (mention) => print('${mention.value} clicked')),
                    UrlParser(onTap: (url) => print('visting ${url.value}?')),
                    BoldParser(),
                    HashTagParser(
                        onTap: (hashtag) =>
                            print('is ${hashtag.value} trending?'))
                  ]
                )
RichTextEditor

RichTextEditor is an input field that supports suggestions when mentioning or using hashtags


        RichTextEditor(
                      decoration: InputDecoration(
                        border: OutlineInputBorder(
                          borderRadius: BorderRadius.circular(16)),
                      ),
                      suggestionController: SuggestionController(
                      mentionSymbol: '/',
                      position: SuggestionPosition.bottom,
                      mentionSuggestions: [
                        Mention(
                            imageURL: 'imageURL',
                            subtitle: 'nelly',
                            title: 'Nelly Gane'),
                        Mention(
                            imageURL: 'imageURL',
                            subtitle: 'gaus',
                            title: 'Gaus Shell')
                      ],
                      onSearchMention: (term) async {
                        return List.generate(
                            20,
                            (index) => Mention(
                                id: index.toString(),
                                imageURL: 'imageURL',
                                subtitle: term.toLowerCase(),
                                title: '$term $index'));
                      },
                      onMentionSelected: (suggestion) {
                        print(suggestion.id);
                      },
                      onSearchTags: (term) async {
                        return [
                          HashTag(
                              hashtag: '#Dart',
                              subtitle: '30 posts',
                              trending: true),
                          HashTag(
                            hashtag: '#Flutter',
                            subtitle: '56 posts',
                          )
                        ];
                      },
                    ))
Todo
  • Add styles to mentions/hashtags in RichTextEditor

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.