IrDesignSystem.fromJson constructor

IrDesignSystem.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory IrDesignSystem.fromJson(Map<String, Object?> json) => IrDesignSystem(
  modes: (json['modes'] as List).cast<String>(),
  activeMode: json['activeMode'] as String,
  colors: [
    for (final c in json['colors'] as List? ?? const [])
      IrColorToken.fromJson(c as Map<String, Object?>),
  ],
  textStyles: [
    for (final t in json['textStyles'] as List? ?? const [])
      IrTextStyleToken.fromJson(t as Map<String, Object?>),
  ],
  shadows: [
    for (final s in json['shadows'] as List? ?? const [])
      IrShadowToken.fromJson(s as Map<String, Object?>),
  ],
  components: [
    for (final c in json['components'] as List? ?? const [])
      IrComponent.fromJson(c as Map<String, Object?>),
  ],
);