getPaint method

Paint getPaint([
  1. T? paintId
])

Gets a paint from the collection.

Returns the main paint if no paintId is provided.

Implementation

Paint getPaint([T? paintId]) {
  if (paintId == null) {
    return paint;
  }

  _assertGenerics();
  final _paint = _paints[paintId];

  if (_paint == null) {
    throw ArgumentError('No Paint found for $paintId');
  }

  return _paint;
}