ProfileFile.fromJson constructor

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

Implementation

factory ProfileFile.fromJson(Map<String, dynamic> json) => ProfileFile(
  profile: ProviderProfile.values.firstWhere(
    (e) => e.name == json['profile'],
    orElse: () => ProviderProfile.openai,
  ),
  env: ProfileEnv.fromJson(json['env'] as Map<String, dynamic>? ?? {}),
  createdAt: json['createdAt'] as String? ?? '',
);