fromJsonOrNull static method
Implementation
static Generate? fromJsonOrNull(
Map<String, dynamic>? otherData,
) {
try {
final fallbackDartSdkPath0 = otherData?['fallbackDartSdkPath'];
final fallbackDartSdkPath =
fallbackDartSdkPath0?.toString().trim().nullIfEmpty;
final templateFilePaths0 = otherData?['templateFilePaths'];
final templateFilePaths = letSet(templateFilePaths0)
?.map(
(p0) => p0?.toString().trim().nullIfEmpty,
)
.nonNulls
.nullIfEmpty
?.toSet();
final rootPaths0 = otherData?['rootPaths'];
final rootPaths = letSet(rootPaths0)
?.map(
(p0) => p0?.toString().trim().nullIfEmpty,
)
.nonNulls
.nullIfEmpty
?.toSet();
final subPaths0 = otherData?['subPaths'];
final subPaths = letSet(subPaths0)
?.map(
(p0) => p0?.toString().trim().nullIfEmpty,
)
.nonNulls
.nullIfEmpty
?.toSet();
final pathPatterns0 = otherData?['pathPatterns'];
final pathPatterns = letSet(pathPatterns0)
?.map(
(p0) => p0?.toString().trim().nullIfEmpty,
)
.nonNulls
.nullIfEmpty
?.toSet();
final outputDirPath0 = otherData?['outputDirPath'];
final outputDirPath = outputDirPath0?.toString().trim().nullIfEmpty;
final annotations0 = otherData?['annotations'];
final annotations = letList(annotations0)
?.map(
(p0) => () {
final a = letMap<String, dynamic>(p0);
return a != null ? Model.fromJson(a) : null;
}(),
)
.nonNulls
.nullIfEmpty
?.toList();
return Generate(
fallbackDartSdkPath: fallbackDartSdkPath,
templateFilePaths: templateFilePaths,
rootPaths: rootPaths,
subPaths: subPaths,
pathPatterns: pathPatterns,
outputDirPath: outputDirPath,
annotations: annotations,
);
} catch (e) {
return null;
}
}