flowStep static method

void flowStep(
  1. String flowName,
  2. String stepName
)

Marks a step within an active flow (e.g. 'onboarding/step_locale').

Records the step with elapsed time since flow start.

Implementation

static void flowStep(String flowName, String stepName) {
  final start = _activeFlows[flowName];
  if (start == null) return;

  final elapsed = DateTime.now().difference(start).inMilliseconds;
  AppConfig.logger.d('[FlowTracker] Step: $flowName/$stepName (${elapsed}ms)');

  _pendingFlows.add(_FlowEntry(
    flowName: flowName,
    stepName: stepName,
    durationMs: elapsed,
    userId: _userId,
    timestamp: DateTime.now(),
  ));

  _tryFlush();
}