SecurityConfig.fromJson constructor

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

Creates a SecurityConfig instance from a JSON map.

This factory constructor parses a JSON map and creates a corresponding SecurityConfig object. It expects the JSON map to contain the keys 'enableEncryption', 'encryptionKey', 'enableSecureStorage', and 'sslPinning'.

Example JSON:

{
  "enableEncryption": true,
  "encryptionKey": "YOUR_ENCRYPTION_KEY",
  "enableSecureStorage": true,
  "sslPinning": false
}

Throws a TypeError if the provided JSON values are not of the expected types.

Implementation

factory SecurityConfig.fromJson(Map<String, dynamic> json) {
  return SecurityConfig(
    enableEncryption: json['enableEncryption'] as bool,
    encryptionKey: json['encryptionKey'] as String,
    enableSecureStorage: json['enableSecureStorage'] as bool,
    sslPinning: json['sslPinning'] as bool,
  );
}