toJson method

Map<String, dynamic> toJson()

Converts the ListElements instance into a JSON object.

Implementation

Map<String, dynamic> toJson() {
  return {
    'text': text,
    'icon': icon, // Handle serialization of widgets appropriately.
    'callBack':
        callBack, // Handle serialization of callback functions if necessary.
  };
}