Search packages, repositories and app categories

Package detailsv0.2.2

whiteboardkit

An awesome Flutter whiteboard implementation with drawing toolbox.

30-day downloads
29
Likes
50
Pub points
35

Install package

flutter pub add whiteboardkit

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

WhiteboardKit is a Flutter package that provides a fully functional whiteboard implementation with an intuitive drawing toolbox. It enables users to draw, erase, and annotate on a canvas with customizable tools such as pens, markers, and erasers. Designed for simplicity and performance, it supports touch input and integrates seamlessly into apps requiring real-time sketching or collaborative annotation. Ideal for educational, design, or note-taking applications, it offers a smooth and responsive drawing experience across devices.

Use cases

  • Digital sketching
  • Collaborative whiteboarding
  • Educational tools
  • Interactive note-taking
  • Design prototyping

Key features

  • Drawing toolbox with multiple tools
  • Real-time touch input support
  • Customizable stroke styles
  • Simple integration with Flutter
  • Responsive canvas rendering

Suitable for

  • Educators
  • Designers
  • App developers
  • Students
  • Remote collaboration tools

Considerations

  • Limited platform-specific optimizations
  • No built-in cloud sync
  • Requires manual state management
  • Not optimized for large canvases
  • No undo/redo history by default

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

whiteboardkit

A Flutter whiteboard widget with so much extendability and flexibility to be used with no need to rewrite your own whiteboard. Enjoy !

Package demo

live demo: https://abdulaziz-mohammed.github.io/whiteboardkit

Usage

import whiteboardkit.dart

import 'package:whiteboardkit/whiteboardkit.dart';

     

Drawing:

Define DrawingController and listen to change event:

  DrawingController controller;

  @override
  void initState() {
    controller = new DrawingController();
    controller.onChange().listen((draw){
      //do something with it
    });
    super.initState();
  }

Place your Whiteboard inside a constrained widget ie. Container,Expanded etc

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Expanded(
              child: Whiteboard(
                controller: controller,
              ),
            ),
          ],
        ),
      ),
    );
  }

     

Playback:

Define PlaybackController and supply it with a WhiteboardDraw object:

  PlaybackController controller;

  @override
  void initState() {
    var draw = WhiteboardDraw.fromWhiteboardSVG("<svg...");
    controller = new PlaybackController(draw);
    super.initState();
  }

Place your Whiteboard inside a constrained widget ie. Container,Expanded etc

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Expanded(
              child: Whiteboard(
                controller: controller,
              ),
            ),
          ],
        ),
      ),
    );
  }

     

Stream (e.g. online whiteboard):

Define SketchStreamController:

  PlayerController controller;

  @override
  void initState() {
    controller = new SketchStreamController();
    super.initState();
  }

Place your Whiteboard inside a constrained widget ie. Container,Expanded etc

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Expanded(
              child: Whiteboard(
                controller: controller,
              ),
            ),
          ],
        ),
      ),
    );
  }

Later, supply it with DrawChunk when recived from DrawingController:

  controller.addChunk(chunk);

You'l need to enable chunks producing in DrawingController then start listening to new chunks:

    controller = new DrawingController(enableChunk: true);
    _chunkSubscription = controller.onChunk().listen((chunk) {
    }

DrawChunk supports:

  • chunk.toJson()
  • DrawChunk.fromJson("...")
    which together can help in transfering chunks through network or any other medium

     

WhiteboardDraw class:

  • Map<String, dynamic> toJson()
  • WhiteboardDraw.fromJson(Map<String, dynamic> json)
  • string getSVG():
    Export to SVG Image format string

Categories

Dependencies

Dependency list 5 items

Source repository

Projects using this package

No data available yet.