copyWith method
Marker
copyWith({
- Widget? child,
- Widget? icon,
- MarkerPosition? position,
- VoidCallback? onTap,
- MarkerIconAlignment? iconAlignment,
- double? maxWidth,
Creates a copy of this Marker with the given fields replaced with new values.
This method is useful when you need to create a new marker based on an existing one with slight modifications.
Implementation
Marker copyWith({
Widget? child,
Widget? icon,
MarkerPosition? position,
VoidCallback? onTap,
MarkerIconAlignment? iconAlignment,
double? maxWidth,
}) {
return Marker(
child: child ?? this.child,
icon: icon ?? this.icon,
onTap: onTap ?? this.onTap,
iconAlignment: iconAlignment ?? this.iconAlignment,
position: position ?? this.position,
maxWidth: maxWidth ?? this.maxWidth,
);
}