copyWith method
Creates a copy of this theme with the specified properties.
If specified, the returned theme only includes layers of the given types
.
If specified, the returned theme has the given id
.
If specified, the returned theme has only layers matching the given atZoom
.
Implementation
Theme copyWith({Set<ThemeLayerType>? types, String? id, double? atZoom}) {
return Theme(
id: id ?? this.id,
version: version,
layers: layers
.where((layer) => types?.contains(layer.type) ?? true)
.where((layer) => atZoom == null || _matchesZoom(atZoom, layer))
.toList(growable: false));
}