copyWith method

FMargins copyWith({
  1. List<double>? margins,
  2. List<double>? marginsTablet,
  3. List<double>? marginsDesktop,
})

Write a copyWith method that returns a new instance of the class with the provided fields replaced with the new values.

Implementation

FMargins copyWith({
  final List<double>? margins,
  final List<double>? marginsTablet,
  final List<double>? marginsDesktop,
}) {
  return FMargins(
    margins: margins ?? this.margins,
    marginsTablet: marginsTablet ?? this.marginsTablet,
    marginsDesktop: marginsDesktop ?? this.marginsDesktop,
  );
}