copyWith method

PrintTemplate copyWith({
  1. String? id,
  2. String? name,
  3. String? categoryId,
  4. bool clearCategory = false,
  5. String? paperFormatId,
  6. ReportTemplate? design,
  7. Map<String, dynamic>? settings,
})

Implementation

PrintTemplate copyWith({
  String? id,
  String? name,
  String? categoryId,
  bool clearCategory = false,
  String? paperFormatId,
  ReportTemplate? design,
  Map<String, dynamic>? settings,
}) {
  return PrintTemplate(
    id: id ?? this.id,
    name: name ?? this.name,
    categoryId: clearCategory ? null : (categoryId ?? this.categoryId),
    paperFormatId: paperFormatId ?? this.paperFormatId,
    design: design ?? this.design,
    settings: settings ?? this.settings,
  );
}