Monetization class

Constructors

Monetization(String paymentPointer, {dynamic debug: false})
Initialize Web Monetization supplying a paymentPointer.
factory
Monetization.probabilistic(Map<String, double> paymentPointers, {dynamic debug: false})
Initialize Web Monetization supplying a Map of payment pointers with their respective weights. [...]
factory
Monetization.vanilla(String clientId, String clientSecret, {dynamic debug: false})
Initialize Web Monetization using Vanilla. [...]
factory

Properties

assetCode String
Returns the code identifying the asset's unit. [...]
read-only
assetScale int
Returns the number of places past the decimal for the amount. [...]
read-only
debug bool
Returns whether to log events to the console.
read / write
enabled bool
Returns whether the meta tag is set to receive payments.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
isMonetized bool
Returns whether the user supports Web Monetization.
read-only
isPaying bool
Returns whether the user is streaming payments.
read-only
onPending Stream<Map>
Stream that tracks 'monetizationpending' events. [...]
read / write
onProgress Stream<Map>
Stream that tracks 'monetizationprogress' events. [...]
read / write
onStart Stream<Map>
Stream that tracks 'monetizationstart' events. [...]
read / write
onStop Stream<Map>
Stream that tracks 'monetizationstop' events. [...]
read / write
pointer String
Returns the current payment pointer. [...]
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
state String
Returns the monetization state provided by the browser. [...]
read-only

Methods

disable() → void
Disable Web Monetization.
enable() → void
Enable Web Monetization.
getTotal({bool formatted: true}) double
Returns the amount received by the current pointer on this session. [...]
getVanillaRate() double
Returns the current payment rate per second from Vanilla's proof of payment on "raw" format (disregarding the asset scale).
getVanillaTotal() double
Returns the total amount received from Vanilla's proof of payment in "raw" format (disregarding the asset scale). [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited