Converts the object to a Map<String, dynamic>
Map<String, dynamic> toMap() { return <String, dynamic>{ 'text': text, 'index': index, }; }