scribe_canvas 0.4.0 copy "scribe_canvas: ^0.4.0" to clipboard
scribe_canvas: ^0.4.0 copied to clipboard

A high-performance Flutter multi-page canvas library for handwriting, drawing, and annotation with customizable tools and PDF export.

Scribe #

A powerful, high-performance Flutter multi-page canvas library for handwriting, drawing, and annotation. Scribe is designed to handle multiple A4-sized pages with smooth strokes, customizable tools, and seamless PDF export.

Preview #

[Scribe Canvas Preview 1] [Scribe Canvas Preview 2]

Features #

  • 📄 Multi-page Canvas: Work with multiple A4-sized pages in a single scrollable view.
  • 🖋️ Smooth Drawing: High-performance drawing engine using the Ramer-Douglas-Peucker algorithm for stroke simplification.
  • 🛠️ Customizable Tools:
    • Multiple pen stroke sizes (user-definable cycling).
    • Multiple eraser sizes (user-definable cycling).
    • Toggle between pen and eraser directly from the integrated Page Header.
  • 📑 Templates & Backgrounds:
    • Load local or network images as backgrounds.
    • Load PDF documents as background templates for each page.
    • Add global headers and footers to every page.
  • 🔄 Interactive Navigation:
    • Support for pinch-to-zoom and pan.
    • Full Undo/Redo stack (global and per-page).
    • Page management: add, insert, or delete pages with ease.
  • 💾 Persistence: Save and load drawing data in a compact, efficient encoded format.
  • 📤 PDF Export: Export your entire creation to a high-quality PDF to share or print.

Getting Started #

Add scribe to your pubspec.yaml:

dependencies:
  scribe_canvas: ^0.4.0

Usage #

A simple way to integrate ScribeCanvas into your application:

import 'package:scribe_canvas/scribe.dart';

// ... inside your build method
ScribeCanvas(
  color: Colors.blueAccent,
  strokeWidth: 4.0,           // Initial pen width
  strokeSizes: [2, 4, 8, 16], // Predefined sizes for cycling
  eraserWidth: 30.0,          // Initial eraser width
  eraserSizes: [20, 30, 60],  // Predefined sizes for cycling
  isEraser: _isEraser,        // Toggle between Pen and Eraser
  isPanMode: _isPanMode,      // Enable/Disable panning
  multiPage: true,            // Support multi-page scrolling
  onStrokeEnd: () {
    // Optional: Auto-save or trigger UI update
  },
  onStrokeWidthChanged: (width) {
    setState(() => _strokeWidth = width);
  },
  onToggleEraser: (isEraser) {
    setState(() => _isEraser = isEraser);
  },
  onColorChanged: (color) {
    debugPrint("Color switched to $color");
  },
)

Additional Information #

Scribe uses InteractiveViewer for navigation and CustomPainter for drawing. It leverages pdf and printing packages for high-quality cross-platform PDF generation.

Feel free to contribute by opening issues or submitting pull requests!

3
likes
0
points
281
downloads

Publisher

unverified uploader

Weekly Downloads

A high-performance Flutter multi-page canvas library for handwriting, drawing, and annotation with customizable tools and PDF export.

Homepage

License

unknown (license)

Dependencies

file_picker, flutter, pdf, pdfx, printing

More

Packages that depend on scribe_canvas