fromDynamic static method

MultiStepStep? fromDynamic(
  1. dynamic map
)

Creates an instance from a JSON-like map structure. This expects the following format:

{
  "debugLabel": <String>,
  "steps": <List<TestStep>>
}

See also:

  • TestStep.fromDynamic

Implementation

static MultiStepStep? fromDynamic(dynamic map) {
  MultiStepStep? result;

  if (map != null) {
    var debugLabel = map['debugLabel'] ?? 'Default MultiStep';
    List stepsList = map['steps'] is List ? map['steps'] : [map['steps']];

    result = MultiStepStep(
      debugLabel: debugLabel,
      steps: stepsList
        ..removeWhere(
          (step) => step == null,
        ),
    );
  }

  return result;
}