fromJsonStringOrNull static method
Constructs a new instance of GenerateDartModel,
from jsonString
, which must be a valid JSON String. Returns null
if
jsonString
is null
or if the conversion fails.
Implementation
static GenerateDartModel? fromJsonStringOrNull(
String? jsonString,
) {
try {
if (jsonString!.isNotEmpty) {
final decoded = letMapOrNull<String, dynamic>(jsonDecode(jsonString));
return GenerateDartModel.fromJson(decoded);
} else {
return GenerateDartModel.assertRequired();
}
} catch (_) {
return null;
}
}