copyWith method

LotsLayout copyWith({
  1. Size? size,
  2. Rect? cylinder,
  3. Offset? pivot,
  4. List<Rect>? sticks,
  5. List<double>? angles,
  6. double? riseDistance,
  7. Rect? card,
})

返回只替换非空参数的布局;列表在使用期间不可修改。

sticks.length 必须等于 angles.length,pivot 通常取 cylinder.bottomCenter。 例如 base.copyWith(cylinder: rect, pivot: rect.bottomCenter)。

Implementation

LotsLayout copyWith(
        {Size? size,
        Rect? cylinder,
        Offset? pivot,
        List<Rect>? sticks,
        List<double>? angles,
        double? riseDistance,
        Rect? card}) =>
    LotsLayout(
        size: size ?? this.size,
        cylinder: cylinder ?? this.cylinder,
        pivot: pivot ?? this.pivot,
        sticks: sticks ?? this.sticks,
        angles: angles ?? this.angles,
        riseDistance: riseDistance ?? this.riseDistance,
        card: card ?? this.card);