FLUTTER ECOSYSTEM

timcreatedit/scribble

Scribble 是一個輕量級的 Flutter 繪圖庫,支援自由手繪、壓力感應、可變線條寬度等特性!

塗鴉 專案封面
Stars
153
Forks
52
最近推送(UTC)
2026年5月25日
專案狀態
未封存
Tim Lehmann GitHub avatar
GITHUB User

Tim Lehmann ↗

Engineer at ClickUp, open source on the side @whynotmake-it

@whynotmake-itBerlin, Germany
語言Dart

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 12 項

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

Scribble

Powered by Mason melos coverage

Scribble is a lightweight library for freehand drawing in Flutter supporting pressure, variable line width and more!

Scribble Demo

Installation 💻

❗ In order to start using Scribble you must have the Dart SDK installed on your machine.

Install via dart pub add:

dart pub add scribble

Features

  • Variable line width
  • Image Export
  • Pen and touch pressure support
  • Line simplification for making sketch files smaller
  • Choose which pointers can draw (touch, pen, mouse, etc.)
  • Lines get slimmer when the pen is moved more quickly
  • Line eraser support
  • Full undo/redo support using value_notifier_tools
  • Sketches are fully serializable to JSON
  • Export Sketches to PNG

Usage

You can find a full working example in the example directory

You can create a drawing surface by adding the Scribble widget to your widget tree and passing in a ScribbleNotifier.

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Scribble(
        notifier: notifier,
      ),
    );
  }
}

Use the public methods on ScribbleNotifier to control the behavior (for example from a button in the UI):

notifier = ScribbleNotifier();


// Set color
notifier.setColor(Colors.black);

// Clear
notifier.clear();

// Undo
notifier.undo();

// Export to Image
notifier.renderImage(pixelRatio: 2.0);

// Line details will be simplified to save space from now on
notifier.setSimplificationFactor(2);

// Simplify the entire existing sketch
notifier.simplify();

// And more ... 

Additional information

As mentioned above, the package is still under development, but we already use it in the app we are currently developing.

Feel free to contribute, or open issues in our GitHub repo.