PathDrawable constructor

PathDrawable({
  1. required List<Offset> path,
  2. double strokeWidth = 1,
  3. bool hidden = false,
})

Creates a PathDrawable to draw path.

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

Implementation

PathDrawable({
  required this.path,
  this.strokeWidth = 1,
  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(hidden: hidden);