You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When model for a json having a nullable field is generated, the generated toJson Method doesn't recognise nullable DateTime value and returns an exception Null check operator used on a null value.
Null Safety
Output
Input Format: Json
Output Language: Dart
When we parse a large Json with multiple nullable date time object, the toJson Method causes the null check error and it is a lot of manual work to fix this issue
Use a null check before parsing the date on the toJson methods
When model for a json having a nullable field is generated, the generated toJson Method doesn't recognise nullable DateTime value and returns an exception Null check operator used on a null value.
Null Safety
Output
Input Format: Json
Output Language: Dart
When we parse a large Json with multiple nullable date time object, the toJson Method causes the null check error and it is a lot of manual work to fix this issue
Use a null check before parsing the date on the toJson methods
Input Data
{
"debitNoteDate": "2023-01-01",
"dueDate": "2023-01-01"
}
Expected Behaviour / Output
Map<String, dynamic> toJson() => {
Map<String, dynamic> toJson() => {
Current Behaviour / Output
Steps to Reproduce
Possible Solution
The text was updated successfully, but these errors were encountered: