PaintingBoard constructor

PaintingBoard({
  1. Key? key,
  2. double? boardHeight,
  3. double? boardWidth,
  4. Color? boardBackgroundColor,
  5. BoxDecoration? boardDecoration,
  6. PaintingBoardController? controller,
})

A board where the user can paint.

Implementation

PaintingBoard({
  Key? key,
  double? boardHeight,
  double? boardWidth,
  Color? boardBackgroundColor,
  BoxDecoration? boardDecoration,
  PaintingBoardController? controller,
})  : assert(
        boardBackgroundColor == null || boardDecoration == null,
        'Cannot provide both a boardBackgroundColor and a boardDecoration\n'
        'To provide both, use "boardDecoration: BoxDecoration(color: boardDecoration)".',
      ),
      _boardHeight = boardHeight ?? double.infinity,
      _boardWidth = boardWidth ?? double.infinity,
      _boardBackgroundColor = boardBackgroundColor ??
          (boardDecoration == null ? Colors.black12 : null),
      _boardDecoration = boardDecoration,
      _controller = controller ?? PaintingBoardController(),
      super(key: key);