getFlowStepTrigger method
Parse a previousDocumentKey of the form "step:N" and return N or null.
Implementation
int? getFlowStepTrigger(String? previousDocumentKey) {
if (previousDocumentKey == null) {
return null;
}
final prefix = '__step__:';
if (previousDocumentKey.startsWith(prefix)) {
final rest = previousDocumentKey.substring(prefix.length);
final n = int.tryParse(rest);
return n;
}
return null;
}