UserConfig.fromJson constructor

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

Implementation

factory UserConfig.fromJson(Map<String, dynamic> json) {
  final jws = json['jws'] ?? json['key'] ?? json['token'] ?? json['data'];
  if (jws == null || jws is! String || jws.isEmpty) {
    throw const FormatException(
      'Missing "jws" string in user config',
    );
  }
  return UserConfig(jws: jws);
}