fromJsonStringOrNull static method
Implementation
static Model? fromJsonStringOrNull(
String? source,
) {
try {
if (source!.isNotEmpty) {
final decoded = letMapOrNull<String, dynamic>(jsonDecode(source));
return Model.fromJson(decoded);
} else {
return const Model();
}
} catch (_) {
return null;
}
}