getStep static method

Map<String, dynamic> getStep(
  1. String stepId
)

Returns step data for a given step ID

Implementation

static Map<String, dynamic> getStep(String stepId) {
  __.in_('getStep');
  try {
    // Ensure instance is initialized
    final instance = ChatScriptLoader();

    // Check if we need to load default data
    if (instance._scriptDataCache.isEmpty) {
      instance._loadDefaultData();
    }

    // Try to get step from cache
    if (instance._scriptDataCache.containsKey(stepId)) {
      return Map<String, dynamic>.from(instance._scriptDataCache[stepId]!);
    }

    // Step not found
    __.warning('Step not found: $stepId');
    return {};
  } catch (e, stackTrace) {
    __.severe('Failed to retrieve step for $stepId', e, stackTrace);
    return {'error': e.toString()};
  } finally {
    __.out_('getStep');
  }
}