DotnetSettings.fromJson constructor

DotnetSettings.fromJson(
  1. Object? j
)

Implementation

factory DotnetSettings.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return DotnetSettings(
    common: switch (json['common']) {
      null => null,
      Object $1 => CommonLanguageSettings.fromJson($1),
    },
    renamedServices: switch (json['renamedServices']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): decodeString(e.value),
      },
      _ => throw const FormatException('"renamedServices" is not an object'),
    },
    renamedResources: switch (json['renamedResources']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): decodeString(e.value),
      },
      _ => throw const FormatException('"renamedResources" is not an object'),
    },
    ignoredResources: switch (json['ignoredResources']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"ignoredResources" is not a list'),
    },
    forcedNamespaceAliases: switch (json['forcedNamespaceAliases']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException(
        '"forcedNamespaceAliases" is not a list',
      ),
    },
    handwrittenSignatures: switch (json['handwrittenSignatures']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException(
        '"handwrittenSignatures" is not a list',
      ),
    },
  );
}