ShareSettings.fromJson constructor

ShareSettings.fromJson(
  1. Object? j
)

Implementation

factory ShareSettings.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return ShareSettings(
    projectMap: switch (json['projectMap']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): ShareSettingsProjectConfig.fromJson(e.value),
      },
      _ => throw const FormatException('"projectMap" is not an object'),
    },
    shareType: switch (json['shareType']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}