copyWith method

StructuredResponse copyWith({
  1. String? summary,
  2. List<String>? warnings,
  3. List<String>? nextSteps,
  4. Map<String, Object?>? data,
  5. bool? isError,
  6. bool? textOnly,
  7. List<String>? imagePaths,
})

Returns a copy with the given fields replaced — so callers augmenting a response don't re-list all five fields by hand.

Implementation

StructuredResponse copyWith({
  String? summary,
  List<String>? warnings,
  List<String>? nextSteps,
  Map<String, Object?>? data,
  bool? isError,
  bool? textOnly,
  List<String>? imagePaths,
}) =>
    StructuredResponse(
      summary: summary ?? this.summary,
      warnings: warnings ?? this.warnings,
      nextSteps: nextSteps ?? this.nextSteps,
      data: data ?? this.data,
      isError: isError ?? this.isError,
      textOnly: textOnly ?? this.textOnly,
      imagePaths: imagePaths ?? this.imagePaths,
    );