RequireWidgetKeyRule.fromJson constructor

RequireWidgetKeyRule.fromJson(
  1. Map<String, dynamic> json
)

Create a rule instance from the given json configuration.

Implementation

factory RequireWidgetKeyRule.fromJson(Map<String, dynamic> json) {
  return RequireWidgetKeyRule(
    exemptWidgets: json['exempt_widgets'] is List
        ? List<String>.from(json['exempt_widgets'] as List)
        : _defaultExemptWidgets,
    severity: (json['severity'] as String?) ?? 'warning',
  );
}