DonationOffer class

What the donation page offers, as the news feed declares it.

Donorbox charges in the campaign's own currency, so a non-Euro campaign is a change Open Food Facts makes on both sides at once: the feed says what the app shows, the campaign says what the donor is charged.

Constructors

DonationOffer({required String currency, required List<int> amounts, required int scansPerUnit, required List<String> whereItGoes, required int reminderEvery, required int newArmPercent, required int stripHideDays, required int? donorCount, required AppNewsFunding? funding, required int? monthsLeft})
const
DonationOffer.fromNews(AppNewsItem? item)
Falls back field by field, so a feed carrying none of this renders the screen exactly as it shipped.
factory

Properties

amounts → List<int>
final
currency → String
final
defaultAmount → int
no setter
donorCount → int?
Donors so far, for the reminder sheet's headline. Null when the feed carries nothing usable, which falls back to a generic headline.
final
funding → AppNewsFunding?
The campaign meter as the home card shows it; null when the feed carries no usable figures, and the reminder sheet then shows no meter.
final
hashCode → int
The hash code for this object.
no setterinherited
monthsLeft → int?
final
newArmPercent → int
Share of installs, in percent, on the reminder side of the home test.
final
reminderEvery → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scansPerUnit → int
final
stripHideDays → int
final
tiers → List<DonationTier>
no setter
whereItGoes → List<String>
Empty when the feed says nothing, in which case the page keeps its own translated lines.
final

Methods

amountFormat(String localeName) → NumberFormat
arm(int bucket) → DonationTestArm
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
numberFormat(String localeName) → NumberFormat
oneOffUrl({DonationSource? source, DonationTestArm? arm}) → String
Donation form with no amount and no interval, so it opens on its own one-time default.
percentFormat(String localeName) → NumberFormat
tier(int amount) → DonationTier
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

feedList<T>(dynamic value) → List<T>?
Tolerant of the container, not only of its elements: a cast in front of whereType throws on "donation_amounts": 5, and the news parser answers any throw with an empty feed for every user.