fromJsonString static method

UserProfileModel? fromJsonString(
  1. String? jsonString
)

从JSON字符串创建

Implementation

static UserProfileModel? fromJsonString(String? jsonString) {
  if (jsonString == null || jsonString.isEmpty) {
    return null;
  }
  try {
    final Map<String, dynamic> jsonMap = json.decode(jsonString);
    return UserProfileModel.fromJson(jsonMap);
  } catch (e) {
    print('Error decoding UserProfileModel JSON: $e');
    return null;
  }
}