toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => {
      'message': message,
      if (code != null) 'code': code,
      if (path != null) 'path': path,
      if (value != null) 'value': value,
      if (data != null && data!.isNotEmpty) 'data': data,
    };