OfferItem class

An active offer/discount code, as returned by ChatService.fetchOffers.

Constructors

OfferItem({required String title, String? code, String? description, String? badge})
Creates an offer.
OfferItem.fromJson(Map<String, dynamic> json)
factory

Properties

badge → String?
Short highlight label for the offer card (e.g. "10% OFF", "$20 OFF", "FREE SHIPPING", "BOGO"). Set by the backend, which knows the actual discount type/value — the client never guesses this from description, since that free text varies per merchant and per discount type (percent, flat amount, free shipping, BXGY, ...) and can't be parsed reliably.
final
code → String?
The coupon code to apply, if any.
final
description → String?
Free-text details (may contain multiple newline-separated facts, e.g. minimum order, usage limit).
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
title → String
The offer's name.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited