new project stable version

This commit is contained in:
2026-05-10 19:11:31 +03:00
commit 3616f84556
391 changed files with 23857 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
class Tariff {
final int id;
final String title;
final String description;
final bool isActive;
final String currency;
final double holdPrice; // Старт / бронь
final double drivePrice; // Цена минуты
final double pausePrice; // Пауза
final double startPrice; // Старт цена
final double cashback; // Процент кэшбэка
final double insurance; // Страховка
Tariff({
required this.id,
required this.title,
required this.description,
required this.isActive,
required this.currency,
required this.holdPrice,
required this.drivePrice,
required this.pausePrice,
required this.startPrice,
required this.cashback,
required this.insurance,
});
factory Tariff.fromJson(Map<String, dynamic> json) {
final planPrice = json['planPrice'] as Map<String, dynamic>? ?? {};
final currency = json['currency'] as Map<String, dynamic>? ?? {};
return Tariff(
id: json['id'] ?? 0,
title: json['title'] ?? 'Unknown',
description: json['description'] ?? '',
isActive: json['isActive'] ?? false,
currency: currency['currency'] ?? 'BYN',
holdPrice: (planPrice['hold'] as num?)?.toDouble() ?? 0.0,
drivePrice: (planPrice['drive'] as num?)?.toDouble() ?? 0.0,
pausePrice: (planPrice['pause'] as num?)?.toDouble() ?? 0.0,
startPrice: (planPrice['start'] as num?)?.toDouble() ?? 0.0,
cashback: (planPrice['cashback'] as num?)?.toDouble() ?? 0.0,
insurance: (planPrice['insurance'] as num?)?.toDouble() ?? 0.0,
);
}
@override
String toString() {
return 'Tariff{id: $id, title: $title, isActive: $isActive}';
}
}