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

pencil_field 封面
套件詳情v0.5.0

pencil_field

在不同設備和平台上的鉛筆/觸控筆互動(書寫與擦除)。附帶輸入內容的版本化持久化。

AndroidiOSmacOSWindowsLinux
近 30 天下載
200
喜歡數
17
Pub 分數
150

安裝套件

flutter pub add pencil_field

套件介紹

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

Pencil_Field 是一個 Flutter 套件,可在 Android、iOS、macOS、Windows 和 Linux 等多個平台實現精確的觸控筆與鉛筆互動,適用於繪圖、書寫與擦除。它支援使用者輸入的版本化持久化,確保草圖與註解能可靠地儲存與還原。設計時著重跨裝置相容性,無論硬體差異為何,皆能提供一致的效能表現。非常適合需要數位墨水功能的應用程式,例如筆記記錄、簽名擷取或創意繪圖工具。

適用情境

  • 數位筆記
  • 簽名捕獲
  • 創意素描
  • 標註工具
  • 跨平台繪圖應用

主要特色

  • 筆與觸控輸入支援
  • 版本化輸入持久化
  • 多平台相容性
  • 平滑的筆壓處理
  • 即時擦除功能

適合對象

  • 繪圖和繪畫應用
  • 教育軟體
  • 電子簽名解決方案
  • 筆記應用程式
  • 互動式白板

使用建議

  • 需要相容的硬體才能使用完整的觸控筆功能
  • 效能可能在低階裝置上有所差異
  • 僅限於套件中列出的平台
  • 高階使用案例可能需要額外的設定
  • 輸入持久化需要適當的狀態管理

原始 README

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

FLUTTER PENCIL FIELD

pencil_field

Widget for pencil / stylus input on different devices and platforms. This widget is intended for any freehand input like signatures or drawings.

example


How to use

Just create PencilField widget and embedd it into your page:

PencilField(
  controller: widget.controller,
  pencilPaint: pencilPaint,
  onPencilDrawingChanged: widget.onPencilDrawingChanged,
  decoration: PencilDecoration(
    type: PencilDecorationType.chequered,
    backgroundColor: Colors.white,
    patternColor: Colors.grey[300]!,
    numberOfLines: 10,
    strokeWidth: 2,
    padding: const EdgeInsets.all(10),
  ),
  pencilOnly: true,
)

And resulting input can be displayed like so. As everything is stored in vector format scaling (e.g. for creating previews) is easy:

PencilDisplay(
  pencilDrawing: widget.controller.drawing.scale(
    scale: scale,
  ),
  decoration: PencilDecoration(backgroundColor: Colors.white),
)

Features


PencilField / PencilFieldController

The actual widget that provides the capability to capture and store freehand / pencil input. Each PencilField requires a controller that builds the bridge between the widget and PencilDrawing that stores the input.

PencilDrawing

PencilDrawing stores the actual content captured by PencilField. You can store and retrieve this data in a versioned format, so that future version of PencilField can load old data.

Example

A full example is provided. This example shows how to use PencilField and its litte sibling PencilDisplay. It also shows how to define pens for input and interactions like erase, undo and clear.

Upcoming features

  • Additional eraser that only erases strokes within a circle
  • Pan support for the input widget and the display widget
  • Pinch support for the display widget
  • Input widget decoration that supports images as background

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。