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

linkfy_text 표지
패키지 상세v1.1.6

linkfy_text

URL, 이메일, 해시태그를 포함한 텍스트를 트위터처럼 링크화하는 가벼운 플러터 패키지입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
2.1천
좋아요
194
Pub 점수
140

패키지 설치

flutter pub add linkfy_text

패키지 개요

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

LinkfyText는 텍스트 내의 URL, 이메일, 해시태그를 자동으로 감지하고 클릭 가능한 링크로 변환하는 가벼운 Flutter 패키지입니다. 트위터의 링크 행동을 모방하며, 수동 링크 형식 지정 없이도 사용자 경험을 직관적으로 개선합니다. Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원하여 기기 간 일관된 기능을 보장합니다. 소셜 미디어 앱, 채팅 인터페이스 또는 동적 텍스트 링크가 필요한 모든 앱에 적합합니다.

사용 사례

  • 소셜 미디어 피드
  • 채팅 애플리케이션
  • 사용자 생성 콘텐츠 표시
  • 이메일 및 URL 추출
  • 해시태그 탐색

주요 기능

  • 자동 URL 감지
  • 이메일 링크화
  • 해시태그를 클릭 가능한 태그로 변환
  • 크로스 플랫폼 지원
  • 경량이고 빠름

적합한 대상

  • 풍부한 텍스트 콘텐츠를 가진 앱
  • 사용자 입력을 포함한 인터랙티브 UI
  • 콘텐츠 중심 인터페이스
  • 실시간 메시징 앱
  • 미니멀리스트 디자인과 동적 텍스트

고려 사항

  • 복잡한 테마에 맞추기 위해 사용자 정의 스타일링이 필요할 수 있습니다
  • 기본 링크 유형에만 제한됨(멘션 또는 사용자 정의 패턴 없음)
  • 매우 긴 텍스트에 대한 성능 영향
  • 중첩 링크에 대한 내장 처리 없음
  • 감지에 외부 정규 표현식 패턴에 의존합니다

원본 README

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

linkfy_text

Lightweight flutter package that detects linkable patterns(urls, emails, hashtags, etc) in a text and makes them clickable. It also allows you to customize the style of the linkified text and the link itself. It also allows you to choose what type of link to linkify in a text.¬

pub package CI coverage Status

Usage

To use this package, add linkfy_text as a dependency in your pubspec.yaml file.

Example:

// first import the package
import 'package:linkfy_text/linkify_text.dart';

Container(
    child: LinkifyText(
    "This text contains a url: https://flutter.dev",
    linkStyle: TextStyle(color: Colors.blue),
    onTap: (link) {
        /// do stuff with `link`
        },
    );
)

Be default, The above snippet would linkify all urls in the string, you can choose what type of link to linkify by passing the LinkTypes parameter

Container(
    child: LinkifyText(
    "This text contains a url: https://flutter.dev and #flutter",
    linkStyle: TextStyle(color: Colors.blue),
    LinkTypes: [LinkType.url, LinkType.hashtag]
    onTap: (link) {
        /// do stuff with `link` like
        /// if(link.type == Link.url) launchUrl(link.value);
        },
    );
)

API Reference

LinkfyText
Parameter Type Description
textStyle TextStyle style applied to the text
linkStyle TextStyle style applied to the linkified text. defaults to textStyle
LinkTypes List<LinkType> a list of LinkType used to override the links to be linkified in a text either a url, hashtag or email. defaults to [LinkTypes.url]
onTap Function(Link) function called when a link is pressed
LinkType
Parameter Type Description
type Link the link type either url, email or hashtag, @mention
value String value the link holds

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.

TODO

  • LinkifyTextField widget

카테고리

의존성

의존성 목록 1 개

소스 저장소

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