getPreviewParametersAs<T extends OverlayItemParameters> method
Typed accessor for previewData.
Returns
The underlying parameters object only if it is of type T.
This avoids the caller needing to write explicit casts. Returns null if there are no preview parameters or they are of a different subtype.
Implementation
T? getPreviewParametersAs<T extends OverlayItemParameters>() {
final OverlayItemParameters? cp = previewData;
if (cp is T) {
return cp;
}
return null;
}