flutter_advanced_canvas_editor 2.3.0
flutter_advanced_canvas_editor: ^2.3.0 copied to clipboard
A powerful Flutter canvas editor with Photoshop-style layers, freehand drawing, drag-and-drop components, undo/redo, and PNG export. Works on all platforms.
2.3.0 #
- Components are now measured after layout. Added
CanvasController.componentSize()andcomponentRect(), and the rotate button (androtateButtonRect()) now follows the measured component width instead of an assumed 50px. Objects narrower than 50px (e.g. SVG vehicles that shrink to their aspect ratio) get their rotate button next to them instead of floating away - Measured sizes are reported through
onStateChanged, only when they change
2.2.0 #
- Added
CanvasController.rotateButtonRect(layerIndex, componentIndex, {iconsSize})returning the rotate button bounds in canvas coordinates, so overlays (hints, tutorials) stay aligned with the button.CanvasWidgetnow positions the button from the same rect (no visual change)
2.1.0 #
- Added per-component icon colour via the new
CanvasComponentDataclass andiconColorparameter onaddComponent()(backwards compatible) - Added canvas serialisation:
toJson(),loadFromJson(), andhasContent; each component's asset path is stored so the canvas can be fully restored from JSON - Fixed rotate/delete action buttons appearing in exported PNGs
- Fixed Gradle/Java compatibility in the example app (Gradle 8.7, AGP 8.3.2, Kotlin 1.9.0)
2.0.4 #
- Added
scaleAllPositions(double scaleX, double scaleY)toCanvasController— rescales every component's position across all layers by the given x/y ratios; useful when the canvas widget is resized and component coordinates need to be remapped to the new space. Hidden and locked layers are included. Fully backwards compatible (additive API).
2.0.3 #
- Converted from Flutter plugin to pure Flutter package — now supports all platforms (Android, iOS, Web, macOS, Windows, Linux) without native code dependencies
- Removed
plugin_platform_interfacedependency and deleted unused plugin boilerplate files - Fixed deprecated
Color.withOpacity()→Color.fromRGBO()in painter - Replaced
print()withdebugPrint()inexportCanvaserror handler - Added class-level dartdoc to
CanvasController,CanvasWidget, and all public typedefs - Fixed
prefer_const_constructorslint in canvas widget (Sizeconstructor) - Suppressed
library_private_types_in_public_apioncreateState()with inline ignore comment - Added library-level doc comment to the main barrel file
- Filled in
homepagefield in pubspec.yaml - Improved pubspec
descriptionto better reflect all features - Rewrote README to show only a minimal quick-start snippet and API table; full example remains in
example/lib/main.dart - Replaced outdated plugin boilerplate tests with real unit tests covering
CanvasControllerandCanvasLayer(64 tests total, all passing)
2.0.2 #
CHANGELOG:
- MAJOR FEATURE: Added Photoshop-style layer system with full backwards compatibility
- Multiple named layers for organizing canvas content
- Create, delete, duplicate, rename, and reorder layers
- Per-layer drawing points and components
- Layer visibility toggle (show/hide)
- Layer opacity control (0-100%)
- Lock layers to prevent editing
- Merge layer down functionality
- Clear individual layers
- Global undo/redo that snapshots all layers together
- Hidden/locked layers cannot be selected
- New layer management API:
createLayer(),deleteLayer(),renameLayer(),setLayerVisibility(),setLayerOpacity(),setLayerLocked(),reorderLayer(),duplicateLayer(),mergeLayerDown(),clearLayer() - Demo includes collapsible layer navbar with horizontal scrolling layer cards
- Image Preview
- Made
onStateChangedcallback nullable for easier testing - Removed redundant debug logs throughout codebase
- Added comprehensive test suite (53 tests) covering all layer functionality
1.1.6 #
CHANGELOG:
- Undo Calls onUndo?.call() when undo is triggered
- Redo Calls onRedo?.call() when redo is triggered
- Erase Calls onErase?.call() when erasing mode is enabled
- TODO: export in different formats and colors