mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-09 18:33:11 +00:00
65 lines
1.1 KiB
Dart
65 lines
1.1 KiB
Dart
class Price {
|
|
Price({
|
|
required this.value,
|
|
required this.currency,
|
|
});
|
|
|
|
final double value;
|
|
final Currency currency;
|
|
}
|
|
|
|
enum CurrencyType {
|
|
eur,
|
|
usd,
|
|
unkown,
|
|
}
|
|
|
|
class Currency {
|
|
Currency({
|
|
required this.type,
|
|
required this.shortcode,
|
|
this.fontcode,
|
|
this.symbol,
|
|
});
|
|
|
|
factory Currency.fromType(final CurrencyType type) {
|
|
switch (type) {
|
|
case CurrencyType.eur:
|
|
return Currency(
|
|
type: type,
|
|
shortcode: 'EUR',
|
|
fontcode: 'euro',
|
|
symbol: '€',
|
|
);
|
|
case CurrencyType.usd:
|
|
return Currency(
|
|
type: type,
|
|
shortcode: 'USD',
|
|
fontcode: 'attach_money',
|
|
symbol: '\$',
|
|
);
|
|
default:
|
|
return Currency(
|
|
type: type,
|
|
shortcode: '?',
|
|
fontcode: 'payments',
|
|
symbol: '?',
|
|
);
|
|
}
|
|
}
|
|
|
|
final CurrencyType type;
|
|
final String shortcode;
|
|
final String? fontcode;
|
|
final String? symbol;
|
|
}
|
|
|
|
class AdditionalPricing {
|
|
AdditionalPricing({
|
|
required this.perVolumeGb,
|
|
required this.perPublicIpv4,
|
|
});
|
|
final Price perVolumeGb;
|
|
final Price perPublicIpv4;
|
|
}
|