43 lines
1.4 KiB
Dart
43 lines
1.4 KiB
Dart
/// Model to pass checkout data from Buy Pass screen to Checkout screen
|
|
import 'package:flutter/material.dart';
|
|
|
|
class CheckoutData {
|
|
final String cityName;
|
|
final String heroImage;
|
|
final String cardTypeName; // "unlimited_card" or "selective_pass"
|
|
final String cardDisplayName; // "Unlimited" or "Selective"
|
|
final Color themeColor;
|
|
final int adultCount;
|
|
final int childCount;
|
|
final num adultPrice; // Changed from double to num
|
|
final num childPrice; // Changed from double to num
|
|
final int validityDuration; // Days or attractions count
|
|
final num totalPrice; // Changed from double to num
|
|
final String? description;
|
|
|
|
CheckoutData({
|
|
required this.cityName,
|
|
required this.heroImage,
|
|
required this.cardTypeName,
|
|
required this.cardDisplayName,
|
|
required this.themeColor,
|
|
required this.adultCount,
|
|
required this.childCount,
|
|
required this.adultPrice,
|
|
required this.childPrice,
|
|
required this.validityDuration,
|
|
required this.totalPrice,
|
|
this.description,
|
|
});
|
|
|
|
// Calculate quantity (total adults + children)
|
|
int get totalQuantity => adultCount + childCount;
|
|
|
|
// Check if it's unlimited card
|
|
bool get isUnlimitedCard => cardTypeName == "unlimited_card";
|
|
|
|
// Get validity label
|
|
String get validityLabel => isUnlimitedCard
|
|
? "$validityDuration Days"
|
|
: "$validityDuration Attractions";
|
|
} |