handle method
void
handle({ - required void showAlsoFor(
- List<MarkerData> markers, {
- required bool disableAnimation,
}),
- required void showOnlyFor(
- List<MarkerData> markers, {
- required bool disableAnimation,
}),
- required void hideAll({
- required bool disableAnimation,
}),
- required void hideOnlyFor(
- List<MarkerData> markers, {
- required bool disableAnimation,
}),
- required void toggle(
- MarkerData marker, {
- required bool disableAnimation,
}),
})
Implementation
void handle({
required void Function(
List<MarkerData> markers, {
required bool disableAnimation,
})
showAlsoFor,
required void Function(
List<MarkerData> markers, {
required bool disableAnimation,
})
showOnlyFor,
required void Function({required bool disableAnimation}) hideAll,
required void Function(
List<MarkerData> markers, {
required bool disableAnimation,
})
hideOnlyFor,
required void Function(MarkerData marker, {required bool disableAnimation})
toggle,
}) {
final PopupEvent thisEvent = this;
if (thisEvent is ShowPopupsAlsoFor) {
return showAlsoFor(
thisEvent.markers,
disableAnimation: thisEvent.disableAnimation,
);
} else if (thisEvent is ShowPopupsOnlyFor) {
return showOnlyFor(
thisEvent.markers,
disableAnimation: thisEvent.disableAnimation,
);
} else if (thisEvent is HideAllPopupsEvent) {
return hideAll(disableAnimation: thisEvent.disableAnimation);
} else if (thisEvent is HidePopupsOnlyFor) {
return hideOnlyFor(
thisEvent.markers,
disableAnimation: thisEvent.disableAnimation,
);
} else if (thisEvent is TogglePopupEvent) {
return toggle(
thisEvent.marker,
disableAnimation: thisEvent.disableAnimation,
);
} else {
throw 'Unknown PopupEvent type: ${thisEvent.runtimeType}';
}
}