chat_image_editor 1.0.0
chat_image_editor: ^1.0.0 copied to clipboard
A lightweight, WhatsApp-style image editor for chat apps: draw, add text, crop, rotate, compress and send with a caption. Pure Dart, fully themeable.
Changelog #
All notable changes to this project are documented here. The format follows Keep a Changelog and the project uses Semantic Versioning.
1.0.0 - 2026-11-04 #
Initial release.
Added #
ChatImageEditorwidget andChatImageEditor.openroute helper that returns aChatImageEditorResultwith the encoded bytes, size, format, caption and edits.- Send mode (a full-width caption, with the caption header in a chip beside the send button) and done mode (single done button).
- Draw tool: freehand, line, rectangle, circle and arrow, a brush size slider and a vertical gradient color slider. The top bar turns into a Done pill, undo and a swatch of the pen color while drawing.
- Text tool: add, edit, move, pinch to resize and rotate, drag to delete, center alignment guides and background styles, with a Done pill and the color slider while typing.
- Crop with aspect-ratio presets, rotate, flip and reset. Cancel, rotate, flip, reset and confirm sit in one row under the aspect-ratio chips. The back button or gesture cancels the crop (and closes text entry, the compress sheet or draw mode) instead of closing the editor.
- Compression with a quality sheet in steps of 10 labelled Low, Medium or
High, the original size, a live size estimate, an Apply button, and a
maxBytestarget. - Undo and redo for every edit.
- Pinch-to-zoom while no tool is open, and a discard prompt for unsaved edits that uses the platform's style: a Cupertino alert on iOS and macOS, a Material dialog elsewhere.
ChatImageEditorConfig.hideSystemBarsWhileDrawing(off by default) to hide the status and navigation bars while the draw tool is open. Works on iOS. On Android it usesSystemUiMode.manual, which Android ignores for apps that target API 36 or later (Flutter's default) and which needs the edge-to-edge opt-out on API 35.- Theming that defaults to the host app's
ColorScheme, with per-field overrides throughChatImageEditorThemeData, also usable as aThemeExtension. - Replaceable icons, strings (including
color,applyandformatQuality) and captionTextFormFieldconfiguration. - Builders that replace the top bar, bottom bar, send and done buttons, loading and error views, and the discard dialog.
ChatImageEditorControllerto drive the editor from code and read its state.sendEnabledandonSendLongPressto control the send button.- Export options: JPEG or PNG, quality,
maxLongEdgeandmaxBytes. - Pure-Dart JPEG/PNG encoding through a pluggable
ImageEncoder. ExportStatsinChatImageEditorResult.stats: decode, render, encode and total time, encode attempts, final quality, and source and output sizes, for apps to log export performance to their own analytics.chat_image_editor.*timeline spans around loading, decoding, painting, rendering, rasterizing, encoding, themaxBytessearch and size estimates, visible in the Performance view of Flutter DevTools and compiled out of release builds.- A benchmark suite (
fvm flutter test benchmark) with a Markdown report tool (tool/benchmark_report.dart), and frame-timing integration tests for drawing, text dragging, cropping and zooming in the example app. - Screen reader support: every tool, pill and toggle is labelled, sliders
step through their values and read them out (
High · 90), and the color slider names the palette color nearest its position. - Runs on Android, iOS, web, macOS, Windows and Linux. The package is pure
Dart with no platform code; the image and edits are painted with
CustomPaint. - An example app built as a chat: pick a photo, edit it and send it; each
bubble shows the file size and export time, and the photo viewer shows
the full
ExportStats. - Documentation: a README with GIF previews, and guides to customization,
architecture, performance and releasing in
doc/.
