whiteboardkit 0.1.7 whiteboardkit: ^0.1.7 copied to clipboard
A Flutter whiteboard implementation.
whiteboardkit #
A Flutter whiteboard widget with so much extendability and flexibility to be used with no need to rewrite your own whiteboard. Enjoy !
Installation #
Add the following to pubspec.yaml
dependencies:
...
whiteboardkit: ^0.1.6
Usage Example #
import whiteboardkit.dart
import 'package:whiteboardkit/whiteboardkit.dart';
define GestureWhiteboardController and listen to change event
GestureWhiteboardController controller;
@override
void initState() {
controller = new GestureWhiteboardController();
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,
),
),
],
),
),
);
}