toJson method Null safety

Map<String, dynamic> toJson()

Implementation

core.Map<core.String, core.dynamic> toJson() => {
      if (displayCommand != null) 'displayCommand': displayCommand!,
      if (path != null) 'path': path!,
      if (reason != null) 'reason': reason!,
    };