Tariff subsriptionId fix
This commit is contained in:
@@ -10,6 +10,7 @@ class Tariff {
|
|||||||
final double startPrice; // Старт цена
|
final double startPrice; // Старт цена
|
||||||
final double cashback; // Процент кэшбэка
|
final double cashback; // Процент кэшбэка
|
||||||
final double insurance; // Страховка
|
final double insurance; // Страховка
|
||||||
|
final int subscriptionId;
|
||||||
|
|
||||||
Tariff({
|
Tariff({
|
||||||
required this.id,
|
required this.id,
|
||||||
@@ -23,6 +24,7 @@ class Tariff {
|
|||||||
required this.startPrice,
|
required this.startPrice,
|
||||||
required this.cashback,
|
required this.cashback,
|
||||||
required this.insurance,
|
required this.insurance,
|
||||||
|
required this.subscriptionId,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory Tariff.fromJson(Map<String, dynamic> json) {
|
factory Tariff.fromJson(Map<String, dynamic> json) {
|
||||||
@@ -41,6 +43,7 @@ class Tariff {
|
|||||||
startPrice: (planPrice['start'] as num?)?.toDouble() ?? 0.0,
|
startPrice: (planPrice['start'] as num?)?.toDouble() ?? 0.0,
|
||||||
cashback: (planPrice['cashback'] as num?)?.toDouble() ?? 0.0,
|
cashback: (planPrice['cashback'] as num?)?.toDouble() ?? 0.0,
|
||||||
insurance: (planPrice['insurance'] as num?)?.toDouble() ?? 0.0,
|
insurance: (planPrice['insurance'] as num?)?.toDouble() ?? 0.0,
|
||||||
|
subscriptionId: json.containsKey('subscriptionId') ? json['subscriptionId'] : 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ class _TariffSheetState extends State<TariffSheet> {
|
|||||||
BookScooterPressed(
|
BookScooterPressed(
|
||||||
widget.scooter.id,
|
widget.scooter.id,
|
||||||
state.tariffs[_selectedTariffIndex!].id,
|
state.tariffs[_selectedTariffIndex!].id,
|
||||||
0,
|
state.tariffs[_selectedTariffIndex!].subscriptionId,
|
||||||
state.useBalance ? null : state.selectedCard?.id,
|
state.useBalance ? null : state.selectedCard?.id,
|
||||||
state.useBalance,
|
state.useBalance,
|
||||||
state.isInsurance
|
state.isInsurance
|
||||||
|
|||||||
Reference in New Issue
Block a user