SetupCatalog.parse constructor

SetupCatalog.parse(
  1. String text
)

The catalog of text, as render writes it.

Implementation

factory SetupCatalog.parse(String text) {
  final json = jsonDecode(text) as Map<String, Object?>;
  List<SetupStep> stepsOf(String key) => [
        for (final step in json[key]! as List<Object?>)
          SetupStep.fromJson(step! as Map<String, Object?>),
      ];
  return SetupCatalog(steps: stepsOf('steps'), retired: stepsOf('retired'));
}