applyPercent method

void applyPercent(
  1. double percent
)

Applies a percentage to the reactive double (adds percentage).

Example:

final price = swift(100.0);
price.applyPercent(20); // price.value is now 120.0

Implementation

void applyPercent(double percent) {
  value = value * (1 + percent / 100);
}