Map<String, dynamic> toJson() => { 'key': key, 'change': change, if (before != null) 'before': before, if (after != null) 'after': after, };