You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
3.7 KiB
Dart
129 lines
3.7 KiB
Dart
// To parse this JSON data, do
|
|
//
|
|
// final subscription = subscriptionFromJson(jsonString);
|
|
|
|
import 'dart:convert';
|
|
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
|
|
import '../../utils/enums.dart';
|
|
|
|
Subscription subscriptionFromJson(String str) => Subscription.fromJson(json.decode(str));
|
|
|
|
class SubscriptionModel {
|
|
SubscriptionModel({
|
|
this.messageStatus,
|
|
this.totalItemsCount,
|
|
this.data,
|
|
this.message,
|
|
});
|
|
|
|
int? messageStatus;
|
|
int? totalItemsCount;
|
|
List<Subscription>? data;
|
|
String? message;
|
|
|
|
factory SubscriptionModel.fromJson(Map<String, dynamic> json) => SubscriptionModel(
|
|
messageStatus: json["messageStatus"],
|
|
totalItemsCount: json["totalItemsCount"],
|
|
data: json["data"] == null ? [] : List<Subscription>.from(json["data"]!.map((x) => Subscription.fromJson(x))),
|
|
message: json["message"],
|
|
);
|
|
}
|
|
|
|
class Subscription {
|
|
Subscription(
|
|
{this.id,
|
|
this.name,
|
|
this.description,
|
|
this.durationName,
|
|
this.durationDays,
|
|
this.price,
|
|
this.currency,
|
|
this.countryId,
|
|
this.countryName,
|
|
this.isSubscribed,
|
|
this.subscriptionAppliedId,
|
|
this.serviceProviderId,
|
|
this.dateStart,
|
|
this.dateEnd,
|
|
this.isExpired,
|
|
this.isActive,
|
|
this.subscriptionTypeEnum,
|
|
this.isMyCurrentPackage,
|
|
this.isRenewable,
|
|
this.subscriptionBranches,
|
|
this.subscriptionSubUsers,
|
|
this.subscriptionAds,
|
|
this.totalBranches,
|
|
this.totalSubUsers,
|
|
this.totalAds,
|
|
this.branchesRemaining,
|
|
this.subUsersRemaining,
|
|
this.subscriptionType,
|
|
this.adsRemaining});
|
|
|
|
int? id;
|
|
String? name;
|
|
String? description;
|
|
String? durationName;
|
|
int? durationDays;
|
|
double? price;
|
|
String? currency;
|
|
int? countryId;
|
|
String? countryName;
|
|
bool? isSubscribed;
|
|
int? subscriptionAppliedId;
|
|
int? serviceProviderId;
|
|
String? dateStart;
|
|
String? dateEnd;
|
|
bool? isExpired;
|
|
bool? isActive;
|
|
SubscriptionTypeEnum? subscriptionTypeEnum;
|
|
bool? isMyCurrentPackage;
|
|
bool? isRenewable;
|
|
int? subscriptionType;
|
|
|
|
int? subscriptionBranches;
|
|
int? subscriptionSubUsers;
|
|
int? subscriptionAds;
|
|
int? totalBranches;
|
|
int? totalSubUsers;
|
|
int? totalAds;
|
|
int? branchesRemaining;
|
|
int? subUsersRemaining;
|
|
int? adsRemaining;
|
|
|
|
factory Subscription.fromJson(Map<String, dynamic> json) => Subscription(
|
|
id: json["id"],
|
|
name: json["name"],
|
|
description: json["description"],
|
|
durationName: json["durationName"],
|
|
durationDays: json["durationDays"],
|
|
price: json["price"]?.toDouble(),
|
|
currency: json["currency"],
|
|
countryId: json["countryID"],
|
|
countryName: json["countryName"],
|
|
isSubscribed: json["isSubscribed"],
|
|
subscriptionAppliedId: json["subscriptionAppliedID"],
|
|
serviceProviderId: json["serviceProviderID"],
|
|
dateStart: json["dateStart"],
|
|
dateEnd: json["dateEnd"],
|
|
isExpired: json["isExpired"],
|
|
isActive: json["isActive"],
|
|
isMyCurrentPackage: false,
|
|
isRenewable: json["isRenewable"],
|
|
subscriptionTypeEnum: json["subscriptionType"] == null ? null : ((json['subscriptionType']) as int).toSubscriptionTypeEnum(),
|
|
subscriptionBranches: json["subscriptionBranches"],
|
|
subscriptionSubUsers: json["subscriptionSubUsers"],
|
|
subscriptionAds: json["subscriptionAds"],
|
|
totalBranches: json["totalBranches"],
|
|
totalSubUsers: json["totalBranches"],
|
|
totalAds: json["totalAds"],
|
|
branchesRemaining: json["branchesRemaining"],
|
|
subUsersRemaining: json["subUsersRemaining"],
|
|
adsRemaining: json["adsRemaining"],
|
|
subscriptionType: json["subscriptionType"],
|
|
);
|
|
}
|