toJson method Null safety

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
      'name': name,
      'parentCategory': parentCategory.toJson(),
      'type': valueType,
    };