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