whiteboardkit 0.1.9 copy "whiteboardkit: ^0.1.9" to clipboard
whiteboardkit: ^0.1.9 copied to clipboard

outdated

An awesome Flutter whiteboard implementation with drawing toolbox.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:whiteboardkit/whiteboardkit.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  GestureWhiteboardController controller;

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

  @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,
              ),
            ),
          ],
        ),
      ),
    );
  }

  @override
  void dispose() {
    controller.close();
    super.dispose();
  }
}
50
likes
0
pub points
46%
popularity

Publisher

unverified uploader

An awesome Flutter whiteboard implementation with drawing toolbox.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, font_awesome_flutter, json_annotation

More

Packages that depend on whiteboardkit