搜索插件、代码仓与 APP 分类

scribble 封面
插件详情v0.10.0+1

scribble

Scribble 是一个轻量级的 Flutter 绘图库,支持自由手绘、压力感应、可变线条宽度等特性!

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
350
喜欢数
227
Pub 分数
140

安装插件

flutter pub add scribble

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Scribble 是一个轻量级的 Flutter 库,支持压力感应、可变线条宽度和跨多个平台的平滑笔画渲染,实现自由手绘。专为开发绘画、涂鸦或签名捕捉功能的开发者设计,提供简单易用的 API,轻松集成直观的触控输入。该库可在 Android、iOS、Web、macOS、Windows 和 Linux 上无缝运行,非常适合跨平台创意应用。通过 `flutter pub add scribble` 即可快速配置,无需复杂设置,即可为交互式绘图体验提供坚实基础。

适合场景

  • 数字素描应用
  • 签名捕获接口
  • 互动白板
  • 艺术与设计工具
  • 教育绘图应用

主要特点

  • 压力敏感笔画
  • 可变线宽
  • 跨平台兼容性
  • 平滑渲染
  • 简单集成
  • 多点触控支持

适合对象

  • 寻求绘图功能的应用开发者
  • 创意工具构建者
  • 教育软件创作者
  • 跨平台应用团队
  • 需要交互元素的UI设计师

使用建议

  • 有限的高级编辑工具
  • 无内置导出格式
  • 需要手动处理画布状态
  • 未针对高性能动画进行优化
  • 仅基本手势识别

原始 README

以下为关联源码仓库的 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.

所属分类

依赖

依赖清单 3 项

源码仓库

使用此插件的项目

暂无相关数据。