SmartpubConfig.fromJson constructor

SmartpubConfig.fromJson(
  1. Map json
)

Parse from json Map

Implementation

factory SmartpubConfig.fromJson(Map json) {
  return SmartpubConfig(
    ignore: (json['ignore'] as List?)?.cast<String>() ?? const <String>[],
    exclude: (json['exclude'] as List?)?.cast<String>() ?? const <String>[],
    allowPins: json['allow_pins'] as bool? ?? false,
    failOnViolations: json['fail_on_violations'] as bool? ?? true,
    checks: json['checks'] is Map
        ? SmartpubChecksConfig.fromJson(json['checks'] as Map)
        : const SmartpubChecksConfig(),
  );
}