cake_wallet/lib/ionia/ionia_tip.dart
Godwin Asuquo 0931696fa1
CW-143 cake pay custom tip amount (#492)
* Add custom tip logic

* Fix euro currency
2022-09-01 17:29:58 +01:00

13 lines
464 B
Dart

class IoniaTip {
const IoniaTip({this.originalAmount, this.percentage, this.isCustom = false});
final double originalAmount;
final double percentage;
final bool isCustom;
double get additionalAmount => double.parse((originalAmount * percentage / 100).toStringAsFixed(2));
static const tipList = [
IoniaTip(originalAmount: 0, percentage: 0),
IoniaTip(originalAmount: 10, percentage: 10),
IoniaTip(originalAmount: 20, percentage: 20)
];
}