copyWith method

ModuleConfig copyWith({
  1. bool? isAbstract,
  2. bool? isModuleMethod,
  3. ImportableType? module,
  4. String? initializerName,
})

Implementation

ModuleConfig copyWith({
  bool? isAbstract,
  bool? isModuleMethod,
  ImportableType? module,
  String? initializerName,
}) {
  if ((isAbstract == null || identical(isAbstract, this.isAbstract)) &&
      (isModuleMethod == null || identical(isModuleMethod, isMethod)) &&
      (module == null || identical(module, type)) &&
      (initializerName == null ||
          identical(initializerName, this.initializerName))) {
    return this;
  }

  return ModuleConfig(
    isAbstract: isAbstract ?? this.isAbstract,
    isMethod: isModuleMethod ?? isMethod,
    type: module ?? type,
    initializerName: initializerName ?? this.initializerName,
  );
}