File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ class Model extends BaseModel {
1919 //
2020 //
2121
22- final Map <String , dynamic > _rootData;
23- Map <String , dynamic > get rootData => Map .unmodifiable (_rootData);
22+ final Map <String , dynamic >? _rootData;
23+ Map <String , dynamic > get rootData => _rootData != null ? Map .unmodifiable (_rootData) : toJson ( );
2424
2525 //
2626 //
@@ -88,7 +88,7 @@ class Model extends BaseModel {
8888 Map <String , dynamic > toJson ({
8989 bool includeNulls = false ,
9090 }) {
91- return includeNulls ? _rootData : _rootData.nonNulls;
91+ return ( includeNulls ? _rootData : _rootData? .nonNulls) ?? {} ;
9292 }
9393
9494 //
Original file line number Diff line number Diff line change 1212
1313name : df_generate_dart_models_core
1414description : A package that provides core dependencies for models generated with df_generate_dart_models.
15- version : 0.8.2
15+ version : 0.8.3
1616repository : https://github.com/DevCetra/df_generate_dart_models_core
1717funding :
1818 - https://www.buymeacoffee.com/robmllze
You can’t perform that action at this time.
0 commit comments