import 'package:equatable/equatable.dart'; class PlanModel extends Equatable { // English: Unique plan identifier. // Arabic: المعرف الفريد للباقة. final int id; // English: Name of the plan (e.g. Free Trial, Pro, Enterprise). // Arabic: اسم الباقة (مثل التجريبية، الاحترافية، الشركات). final String name; // English: Monthly price of the plan. // Arabic: السعر الشهري للباقة. final double price; const PlanModel({ required this.id, required this.name, required this.price, }); // English: Factory constructor to parse PlanModel from JSON data map. // Arabic: منشئ المصنع لتحليل نموذج الباقة من خريطة بيانات جيسون. factory PlanModel.fromJson(Map json) { return PlanModel( id: json['id'] as int? ?? 0, name: json['name'] as String? ?? 'Nabeh Plan', price: (json['price'] as num?)?.toDouble() ?? 0.0, ); } // English: Convert model to JSON map. // Arabic: تحويل النموذج إلى خريطة جيسون. Map toJson() { return { 'id': id, 'name': name, 'price': price, }; } @override List get props => [id, name, price]; }