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

utils_rinch_text 표지
패키지 상세v1.0.3

utils_rinch_text

이 메서드는 긴 텍스트를 형식화하는 데 적합한 TextSpan 목록을 반환합니다. 이 구현은 다음 태그를 지원합니다. 예제를 참조하세요.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
19
좋아요
9
Pub 점수
160

패키지 설치

flutter pub add utils_rinch_text

패키지 개요

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

utils_rinch_text 패키지는 TextSpan을 사용하여 긴 텍스트를 포맷하는 유틸리티 메서드를 제공하며, 리치 텍스트 렌더링을 위한 사용자 정의 태그를 지원합니다. 내장된 형식을 갖춘 구조화된 텍스트 표시를 가능하게 하며, 채팅 메시지나 형식이 지정된 설명과 같은 동적 콘텐츠에 이상적입니다. 이 패키지는 모든 주요 플랫폼과 호환되며, 수동적인 Span 관리 없이 복잡한 텍스트 레이아웃을 쉽게 만들 수 있도록 합니다. 깔끔한 API를 활용해 태그가 포함된 텍스트를 효율적으로 파싱하고 렌더링합니다.

사용 사례

  • 채팅 메시지 형식 지정
  • 동적 콘텐츠 렌더링
  • UI 컴포넌트 내 리치 텍스트
  • 형식화된 설명
  • 사용자 생성 텍스트 처리

주요 기능

  • 사용자 정의 텍스트 태그 지원
  • TextSpan 목록 생성
  • 크로스 플랫폼 호환성
  • 간단한 API 통합
  • 효율적인 텍스트 파싱

적합한 대상

  • 풍부한 텍스트가 필요한 앱
  • 채팅 또는 메시지 인터페이스
  • 콘텐츠 중심의 UI
  • 텍스트 서식 지정 유틸리티
  • 간결함을 원하는 플러터 개발자

고려 사항

  • 올바른 태그 구문이 필요합니다
  • 텍스트 형식 지정만 가능
  • 내장된 스타일 옵션이 없음
  • 정확한 입력 구조에 따라 달라집니다
  • 복잡한 레이아웃에 적합하지 않습니다

원본 README

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

This method returns a list of TextSpan ideal for formatting long text this implementation supports the following tags, see example.

<a>Link web<a>
<p> add paragraph

Captura de tela 2023-02-03 195339

Add custom tags

Text de example:

 String textExample = """
  <i>Flutter<i> is an open source mobile app development framework <l>created by Google.<l> 
  It enables the creation of native apps for <i>iOS and Android<i> with a single Dart code base. 
  With its flexible and performant architecture, <o>Flutter has become one of the most 
  popular options for building mobile apps.<o> In addition, it offers a wide range of widgets 
  and animated visual effects that help you create attractive and intuitive applications. <p>
  For more information about Flutter, head over to the main 
  page at <a>https://flutter.dev/<a> and start <b>exploring the possibilities<b> 
  of this powerful app development tool.
  """;

Implementation

RichText(
   text: TextSpan(
     children: UtilsRinchText.generate(
       textExample,
       customTags: {
         "<i>": const TextStyle(
           fontWeight: FontWeight.bold,
           fontSize: 20,
         ),
         "<l>": const TextStyle(
           fontSize: 20,
           color: Colors.red,
           fontWeight: FontWeight.bold,
         ),
         "<a>": const TextStyle(
           color: Colors.green,
           fontWeight: FontWeight.bold,
         ),
         "<o>": const TextStyle(
           fontWeight: FontWeight.bold,
           color: Colors.blue,
           fontSize: 20,
         ),
         "<b>": const TextStyle(
           fontWeight: FontWeight.bold,
           color: Colors.orange,
           fontSize: 20,
         ),
       },
     ),
   ),
 ), 

카테고리

의존성

의존성 목록 1 개

소스 저장소

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

아직 데이터가 없습니다.