price method

double price({
  1. double min = 500.0,
  2. double max = 1500.0,
})

Returns a random price.

min is optional minimum value of price (default is 500).

max is optional maximum value of price (default is 1500).

Example:

Finance().price(); // 722.37
Finance().price(min: 10.0, max: 15.0); // 13.37

Implementation

double price({double min = 500.0, double max = 1500.0}) {
  return .parse(
    (Random(seed).nextDouble() * (max - min) + min).toStringAsFixed(2),
  );
}