toJson abstract method
      
dynamic
toJson()
      
     
    
Serialises this class into a JSON object.
class Item extends Serializable {
  const(this.name, this.count);
  final String name;
  final int? count;
}
final Item x = Item('apple', 10);
print(x.toJson()); // { 'name': 'apple', 'count': 10 }
Implementation
dynamic toJson();