copyWith method

StartupContextConfig copyWith({
  1. bool? enabled,
  2. List<String>? applyOn,
  3. int? dailyMemoryDays,
  4. int? maxFileBytes,
  5. int? maxFileChars,
  6. int? maxTotalChars,
  7. bool? markUntrusted,
})

Implementation

StartupContextConfig copyWith({
  bool? enabled,
  List<String>? applyOn,
  int? dailyMemoryDays,
  int? maxFileBytes,
  int? maxFileChars,
  int? maxTotalChars,
  bool? markUntrusted,
}) {
  return StartupContextConfig(
    enabled: enabled ?? this.enabled,
    applyOn: applyOn ?? this.applyOn,
    dailyMemoryDays: (dailyMemoryDays ?? this.dailyMemoryDays)
        .clamp(0, caps.maxDays),
    maxFileBytes: (maxFileBytes ?? this.maxFileBytes)
        .clamp(0, caps.maxFileBytes),
    maxFileChars: (maxFileChars ?? this.maxFileChars)
        .clamp(0, caps.maxFileChars),
    maxTotalChars: (maxTotalChars ?? this.maxTotalChars)
        .clamp(0, caps.maxTotalChars),
    markUntrusted: markUntrusted ?? this.markUntrusted,
  );
}