post<M> method
Implementation
void post<M>({
M Function(TransitionContext ctx, D data, P payload)? getValue,
M? value,
String? label,
}) {
if (getValue == null && value == null) {
throw ArgumentError('getValue or value must be provided');
} else if (getValue != null && value != null) {
throw ArgumentError('One of getValue or value must be provided');
}
_handler = _TransitionHandlerDescriptor.post<M>(
(transCtx) {
return getValue != null
? getValue(transCtx, transCtx.dataValueOrThrow<D>(), transCtx.payloadOrThrow<P>())
: value!;
},
label,
);
}