MagicStarterProduct class
One product in a catalogue tier row: the thing a purchase names.
A tier is not a price. pro sold monthly and again at a discounted annual
rate is ONE tier and TWO products, and both rails purchase by the product's
key (pro_annual) rather than by a (tier, cycle) pair a call could send
half of. This is the decoded form of one entry in a GET /billing/plans
row's products list.
type and cycle decode to null for a word this build does not know,
never to a guessed member: reading an unknown cycle as monthly is a claim
about what a customer is charged.
A row lists every subscription product of its tier, including ones no
longer sold (sellable false): a customer may still HOLD a grandfathered
product, and the client has to be able to rank it. Nothing may offer one.
- Annotations
Constructors
-
MagicStarterProduct({required String key, required ProductType? type, required String tier, required BillingCycle? cycle, bool sellable = true, MagicStarterStoreIds storeIds = (appStore: null, play: null), Map<
String, MagicStarterWebPrice> webPrices = const {}, int trialDays = 0}) -
const
-
MagicStarterProduct.fromMap(Map<
String, dynamic> map) -
Decodes one
productsentry of a catalogue tier row.factory
Properties
- cycle → BillingCycle?
-
How often a subscription product charges, or
nullfor a one-off product and for a cycle this build does not know.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → String
-
The vendor's catalogue key (e.g.
'pro_annual'), the value a purchase, a checkout and a swap send.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sellable → bool
-
Whether the product is still for sale.
falseis a grandfathered product, kept in the row only so a customer holding it can be ranked; no purchase, checkout or price read may name it.final - storeIds → MagicStarterStoreIds
-
The store product ids this product is sold as.
final
- tier → String
-
The tier id this product belongs to (e.g.
'pro').final - trialDays → int
-
The free days a purchase of this product starts with,
0for none.final - type → ProductType?
-
What the product sells, or
nullfor a type this build does not know.final -
webPrices
→ Map<
String, MagicStarterWebPrice> -
The web rail's prices, keyed by ISO 4217 currency code (
'USD'), in the producer's order. Empty when the producer prices the product for no web currency.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