Site.fromMap constructor
Implementation
factory Site.fromMap(
Map<String, dynamic> map,
) {
map = {
'\$id': "",
'\$createdAt': "",
'\$updatedAt': "",
'name': "",
'description': "",
'enabled': true,
'live': true,
'logging': true,
'framework': "",
'deploymentRetention': 0,
'deploymentId': "",
'deploymentCreatedAt': "",
'deploymentScreenshotLight': "",
'deploymentScreenshotDark': "",
'latestDeploymentId': "",
'latestDeploymentCreatedAt': "",
'latestDeploymentStatus': "",
'scopes': [],
'vars': [],
'timeout': 15,
'installCommand': "",
'buildCommand': "",
'startCommand': "",
'outputDirectory': "",
'installationId': "",
'providerRepositoryId': "",
'providerBranch': "",
'providerRootDirectory': "",
'providerSilentMode': false,
'providerBranches': [],
'providerPaths': [],
'buildSpecification': "s-1vcpu-512mb",
'runtimeSpecification': "s-1vcpu-512mb",
'buildRuntime': "",
...map,
};
return Site(
$id: map['\$id'].toString(),
$createdAt: map['\$createdAt'].toString(),
$updatedAt: map['\$updatedAt'].toString(),
name: map['name'].toString(),
description: map['description'].toString(),
enabled: map['enabled'],
live: map['live'],
logging: map['logging'],
framework: map['framework'].toString(),
deploymentRetention: map['deploymentRetention'],
deploymentId: map['deploymentId'].toString(),
deploymentCreatedAt: map['deploymentCreatedAt'].toString(),
deploymentScreenshotLight: map['deploymentScreenshotLight'].toString(),
deploymentScreenshotDark: map['deploymentScreenshotDark'].toString(),
latestDeploymentId: map['latestDeploymentId'].toString(),
latestDeploymentCreatedAt: map['latestDeploymentCreatedAt'].toString(),
latestDeploymentStatus: map['latestDeploymentStatus'].toString(),
scopes: List.from(map['scopes'] ?? []),
vars: List<Variable>.from(
map['vars'].map((p) => Variable.fromMap(p)),
),
timeout: map['timeout'],
installCommand: map['installCommand'].toString(),
buildCommand: map['buildCommand'].toString(),
startCommand: map['startCommand'].toString(),
outputDirectory: map['outputDirectory'].toString(),
installationId: map['installationId'].toString(),
providerRepositoryId: map['providerRepositoryId'].toString(),
providerBranch: map['providerBranch'].toString(),
providerRootDirectory: map['providerRootDirectory'].toString(),
providerSilentMode: map['providerSilentMode'],
providerBranches: List.from(map['providerBranches'] ?? []),
providerPaths: List.from(map['providerPaths'] ?? []),
buildSpecification: map['buildSpecification'].toString(),
runtimeSpecification: map['runtimeSpecification'].toString(),
buildRuntime: map['buildRuntime'].toString(),
adapter: map['adapter'].toString(),
fallbackFile: map['fallbackFile'].toString(),
);
}