FLUTTER ECOSYSTEM

furkansarihan/story_painter

适用于 Flutter 的绘图体验!

story_painter 项目封面
Stars
9
Forks
6
最近推送(UTC)
2025年9月11日
项目状态
未归档
Furkan Sarıhan GitHub avatar
GITHUB User

Furkan Sarıhan ↗

Istanbul
语言DartSwiftKotlinObjective-C

此仓库发布的插件

使用的依赖

依赖清单 3 项
  • flutter{"sdk":"flutter"}
  • flutter_svg^1.1.6
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

story_painter

This package provides drawing experince like in story editor of Instagram.

story_painter is a modified version of the hand_signature.

https://firebasestorage.googleapis.com/v0/b/app-monotony.appspot.com/o/assets%2Fdemo.gif?alt=media&token=2e525617-acb6-40f0-bd68-f3e72c0e97c6
Check out fast_color_picker from here.

Usage

Initialize the controller

StoryPainterControl painterControl = StoryPainterControl(
    type: PainterDrawType.shape,
    threshold: 3.0,
    smoothRatio: 0.65,
    velocityRange: 2.0,
    color: Colors.white,
    width: 8,
    onDrawStart: () {},
    onDrawEnd: () {},
);

Build StoryPainter with controller

StoryPainter(control: painterControl)

Change brush specs while drawing

painterControl.setColor(Colors.red);
painterControl.setWidth(24.0);

Export the image

ui.Image image = await painterControl.toImage(pixelRatio: 3.0);

Display or use the output

// Convert the data
ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png);
Uint8List pngBytes = byteData.buffer.asUint8List();

// Display with memory image
Image.memory(pngBytes)