toJsonLd method

  1. @override
Map<String, dynamic> toJsonLd()
override

Serialize SchemaMenuItem to JSON-LD

Implementation

@override
Map<String, dynamic> toJsonLd() => removeEmpty({
      ...super.toJsonLd(),
      '@type': 'MenuItem',
      'menuAddOn':
          convertToJsonLd(menuAddOn, [SchemaMenuItem, SchemaMenuSection]),
      'nutrition': convertToJsonLd(nutrition, [SchemaNutritionInformation]),
      'offers': convertToJsonLd(offers, [SchemaDemand, SchemaOffer]),
      'suitableForDiet': convertToJsonLd(
          suitableForDiet, [SchemaDiet, SchemaRestrictedDiet]),
    });