FreeStyleDrawable constructor

FreeStyleDrawable({
  1. required List<Offset> path,
  2. double strokeWidth = 1,
  3. Color color = Colors.black,
  4. bool hidden = false,
})

Creates a FreeStyleDrawable to draw path.

The path will be drawn with the passed color and strokeWidth if provided.

Implementation

FreeStyleDrawable({
  required List<Offset> path,
  double strokeWidth = 1,
  this.color = Colors.black,
  bool hidden = false,
})  :
      // An empty path cannot be drawn, so it is an invalid argument.
      assert(path.isNotEmpty, 'The path cannot be an empty list'),

      // The line cannot have a non-positive stroke width.
      assert(strokeWidth > 0,
          'The stroke width cannot be less than or equal to 0'),
      super(path: path, strokeWidth: strokeWidth, hidden: hidden);