搜尋套件、儲存庫與 APP 分類

套件詳情v1.2.1

link_previewer

一個全新的 Flutter 套件。它旨在讓連結看起來比一般的內嵌連結或預設超連結更美觀。

近 30 天下載
59
喜歡數
14
Pub 分數
40

安裝套件

flutter pub add link_previewer

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Link Previewer 是一個 Flutter 套件,專為增強應用程式內連結的視覺呈現而設計。它將純文字 URL 轉換為富含互動性的預覽,包含縮圖、標題、描述及從連結內容取得的資料。適用於社群媒體應用程式、即時通訊平台,或任何使用者分享網頁連結的應用,能透過更豐富資訊與美觀外觀提升使用者參與度。此套件支援動態渲染,並可輕鬆整合至現有的文字元件中。

適用情境

  • 社群媒體應用
  • 訊息介面
  • 內容共享功能
  • 部落格或新聞來源顯示
  • 使用者產生內容平台

主要特色

  • 自動獲取連結元數據
  • 顯示縮略圖和描述
  • 支援動態預覽渲染
  • 與文字小工具的輕鬆整合
  • 乾淨、可自定義的使用者介面

適合對象

  • 開發社交應用的開發者
  • 用戶分享的連結的應用
  • 需要豐富連結可視化的專案
  • 專注於使用者體驗改善的團隊

使用建議

  • 需要互聯網存取以取得元資料
  • 可能影響大量預覽時的效能
  • 僅限 HTTP/HTTPS URL
  • 不支援離線預覽
  • 依賴外部網站的元標籤

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

link_previewer

A new Flutter package. Build container with image, title, description from web-site (link) will be provided.

Getting Started

alt text

Installing

Use this package as a library

  1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  link_previewer: ^1.2.1
  1. Install it

You can install packages from the command line: with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

  1. Import it

Now in your Dart code, you can use:

import 'package:link_previewer/link_previewer.dart';

Usage

Widget build() {
  return Column(
    mainAxisAlignment: MainAxisAlignment.center,
    children: <Widget>[
      LinkPreviewer(
        link: "https://www.linkedin.com/feed/",
        direction: ContentDirection.horizontal,
      ),
      LinkPreviewer(
        link: "https://www.linkedin.com/feed/",
        direction: ContentDirection.vertical,
      ),
    ],
  );
}

Properties (Constructor props)

PropName Value Definition
link String value (Ex: "http://...") Link to website will be shown as LinkPreviewer
titleFontSize double (default: 15, but it's auto resizable depends on layout(parent) width or hight) Title font size
bodyFontSize double (default: 14, but it's auto resizable depends on layout(parent) width or hight) Body font size
backgroundColor Color (default: Colors.white) Background color in case there will be not much text and will be whitespace
borderColor Color (default: Colors.deepOrangeAccent) Border color of the previewer
borderRadius double (default: 3.0) Border radius
direction ContentDirection from the package (default: ContentDirection.horizontal) Options: 1. ContentDirection.horizontal 2. ContentDirection.vertical Content direction (image -> title -> body)
From version 1.1.0
PropName Value Definition
placeholder Widget Custom placeholder while data is loading
defaultPlaceholderColor Color (default: light-grey) If placeholder is not set, will be used the default one and its color can be set using this prop (empty container with background)
showTitle bool (default: true) Title can be hiden using this prop, if it set to false
showBody bool (default: true) Body can be hiden using this prop, if it set to false
From version 1.2.0
PropName Value Definition
bodyTextOverflow TextOverflow (default: TextOverflow.ellipsis or TextOverflow.fade) Text overflow prop
bodyMaxLines int (default: depends on hight) Max Lines that will be shown in the body

所屬分類

依賴

依賴清單 4 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。