BuildConfig.fromJson constructor

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

Creates a BuildConfig instance from a JSON map.

This factory constructor parses a JSON map and creates a corresponding BuildConfig object. It expects the JSON map to contain the keys 'buildId', 'branchName', and 'commitHash'.

Example JSON:

{
  "buildId": "12345",
  "branchName": "main",
  "commitHash": "a1b2c3d4e5f6"
}

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

Implementation

factory BuildConfig.fromJson(Map<String, dynamic> json) {
  return BuildConfig(
    buildId: json['buildId'] as String,
    branchName: json['branchName'] as String,
    commitHash: json['commitHash'] as String,
  );
}