dvPurchasesDeclared function

bool dvPurchasesDeclared(
  1. Object? dartvelSection
)

Whether a project's dartvel: section declares purchases: a purchases: map, or purchases: true.

One rule for every half that reads it: the generated backend serves the endpoints, dartvel build ios/macos compiles the StoreKit shim and dartvel build android adds Play Billing, all from this answer. Three readings of the same key is how a build ships the sheet and no server to verify what it sold.

Implementation

bool dvPurchasesDeclared(Object? dartvelSection) {
  if (dartvelSection is! Map) return false;
  final Object? purchases = dartvelSection['purchases'];
  return purchases is Map || purchases == true;
}