operator - method

IconToo operator -(
  1. dynamic deflation
)

➖ "Subtract" from this IconToo

IconToo operator -(dynamic inflation)

Returns this IconToo if operation does not match a case described below, otherwise copyWith size decremented by deflation.

operator -(dynamic deflation)

  • deflation is numsizeX -= deflation & sizeY -= deflation
  • deflation is List<num> (length==2) ➡ sizeX -= deflation[0] & sizeY -= deflation[1]

Implementation

IconToo operator -(dynamic deflation) => (deflation is num)
    ? copyWith(
        sizeX: (sizeX ?? 0.0) - deflation, sizeY: (sizeY ?? 0.0) - deflation)
    : (deflation is List<num>)
        ? (deflation.length == 2)
            ? copyWith(
                sizeX: (sizeX ?? 0.0) - deflation[0],
                sizeY: (sizeY ?? 0.0) - deflation[1],
              )
            : this
        : this;