copyWith method

  1. @override
TranslateModifier copyWith({
  1. double? x,
  2. double? y,
  3. Alignment? alignment,
})
override

Creates a copy of this spec with the given fields replaced by the non-null parameter values.

Implementation

@override
// ignore: avoid-incomplete-copy-with
TranslateModifier copyWith({double? x, double? y, Alignment? alignment}) {
  final matrix = Matrix4.translationValues(x ?? 0.0, y ?? 0.0, 0.0);

  return TranslateModifier._(
    transform: x != null || y != null ? matrix : transform,
    alignment: alignment ?? this.alignment,
  );
}