copyWith method

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

Implementation

ExternalModuleConfig 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 ExternalModuleConfig(
    isAbstract: isAbstract ?? this.isAbstract,
    isMethod: isModuleMethod ?? isMethod,
    type: module ?? type,
    initializerName: initializerName ?? this.initializerName,
  );
}