when<R> method
R
when<R>({
- required R ifSimpleFillSymbol(
- SimpleFillSymbol symbol
- required R ifSimpleMarkerSymbol(
- SimpleMarkerSymbol symbol
- required R ifPictureMarkerSymbol(
- PictureMarkerSymbol symbol
- required R ifSimpleLineSymbol(
- SimpleLineSymbol symbol
- required R ifMeshSymbol3D(
- MeshSymbol3D symbol
Implementation
R when<R>({
required R Function(SimpleFillSymbol symbol) ifSimpleFillSymbol,
required R Function(SimpleMarkerSymbol symbol) ifSimpleMarkerSymbol,
required R Function(PictureMarkerSymbol symbol) ifPictureMarkerSymbol,
required R Function(SimpleLineSymbol symbol) ifSimpleLineSymbol,
required R Function(MeshSymbol3D symbol) ifMeshSymbol3D,
}) {
final self = this;
if (self is SimpleFillSymbol) {
return ifSimpleFillSymbol(self);
}
if (self is SimpleMarkerSymbol) {
return ifSimpleMarkerSymbol(self);
}
if (self is PictureMarkerSymbol) {
return ifPictureMarkerSymbol(self);
}
if (self is SimpleLineSymbol) {
return ifSimpleLineSymbol(self);
}
if (self is MeshSymbol3D) {
return ifMeshSymbol3D(self);
}
throw Exception("Unknown Symbol: $self");
}