copyWith method
Create a copy with updated fields
Advertisement data (services, serviceData, manufacturerDataList) is
carried over unless explicitly overridden, so connection-state updates do
not discard what the scan reported.
Implementation
Printer copyWith({
String? address,
String? name,
ConnectionType? connectionType,
bool? isConnected,
String? vendorId,
String? productId,
List<String>? services,
Map<String, Uint8List>? serviceData,
List<ManufacturerData>? manufacturerDataList,
}) =>
Printer(
address: address ?? this.address,
name: name ?? this.name,
connectionType: connectionType ?? this.connectionType,
isConnected: isConnected ?? this.isConnected,
vendorId: vendorId ?? this.vendorId,
productId: productId ?? this.productId,
services: services ?? this.services,
serviceData: serviceData ?? this.serviceData,
manufacturerDataList: manufacturerDataList ?? this.manufacturerDataList,
);