145 lines
3.6 KiB
Dart
145 lines
3.6 KiB
Dart
import 'dart:convert';
|
|
|
|
class LiveActivityModel {
|
|
String activityName;
|
|
String activityDayBanner;
|
|
dynamic dayDuration;
|
|
String description;
|
|
String date;
|
|
String day;
|
|
String time;
|
|
Subscription subscription;
|
|
String zoomLink;
|
|
List<Schedule> scheduleData;
|
|
List<ActivityData> activityData;
|
|
bool isActive;
|
|
|
|
LiveActivityModel({
|
|
required this.activityName,
|
|
required this.activityDayBanner,
|
|
required this.description,
|
|
required this.isActive,
|
|
required this.subscription,
|
|
required this.scheduleData,
|
|
required this.activityData,
|
|
required this.dayDuration,
|
|
required this.time,
|
|
required this.date,
|
|
required this.day,
|
|
required this.zoomLink,
|
|
});
|
|
|
|
factory LiveActivityModel.fromJson(Map<String, dynamic> json) {
|
|
return LiveActivityModel(
|
|
activityName: json['activity_name'],
|
|
activityDayBanner: json['activity_teaser'],
|
|
description: json['description'],
|
|
isActive: json['is_active'] == "1",
|
|
subscription: Subscription.fromJson(json['subscription']),
|
|
date: json["date"],
|
|
day: json["day"],
|
|
time: json["time"],
|
|
dayDuration: json["activity_duration"],
|
|
zoomLink: json["zoom_link"],
|
|
scheduleData: List<Schedule>.from(
|
|
json['schedule_data'].map(
|
|
(schedule) => Schedule.fromJson(schedule),
|
|
),
|
|
),
|
|
activityData: List<ActivityData>.from(
|
|
json["activity_data"].map(
|
|
(activityData) => ActivityData.fromJson(activityData),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class Subscription {
|
|
String planName;
|
|
bool isActive;
|
|
|
|
Subscription({required this.planName, required this.isActive});
|
|
|
|
factory Subscription.fromJson(Map<String, dynamic> json) {
|
|
return Subscription(
|
|
planName: json['plan_name'],
|
|
isActive: json['is_active'] == "1",
|
|
);
|
|
}
|
|
}
|
|
|
|
class Schedule {
|
|
int activityMasterId;
|
|
String? description;
|
|
String? zoomLink;
|
|
Schedule({
|
|
required this.activityMasterId,
|
|
this.description,
|
|
this.zoomLink,
|
|
});
|
|
|
|
factory Schedule.fromJson(Map<String, dynamic> json) {
|
|
return Schedule(
|
|
activityMasterId: json['activity_master_id'],
|
|
description: json['description'],
|
|
zoomLink: json['zoom_link'],
|
|
);
|
|
}
|
|
}
|
|
|
|
class ActivityData {
|
|
String? activityName;
|
|
String? title;
|
|
String? mainActivityBanner;
|
|
String? description;
|
|
String? startDate;
|
|
String? endDate;
|
|
String? teaserUrl;
|
|
String? benefits;
|
|
String? preRequisites;
|
|
TearcherData techerData;
|
|
ActivityData({
|
|
required this.activityName,
|
|
required this.title,
|
|
required this.mainActivityBanner,
|
|
required this.description,
|
|
required this.startDate,
|
|
required this.endDate,
|
|
required this.teaserUrl,
|
|
required this.benefits,
|
|
required this.preRequisites,
|
|
required this.techerData,
|
|
});
|
|
factory ActivityData.fromJson(Map<String, dynamic> json) {
|
|
return ActivityData(
|
|
activityName: json["activity_name"],
|
|
title: json["title"],
|
|
mainActivityBanner: json["main_activity_banner"],
|
|
description: json["description"],
|
|
startDate: json["start_date"],
|
|
endDate: json["end_date"],
|
|
teaserUrl: json["teaser_url"],
|
|
benefits: json["benefits"],
|
|
preRequisites: json["pre_requisites"],
|
|
techerData: TearcherData.fromJson(json['teacher_data']),
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
class TearcherData {
|
|
String teacherName;
|
|
String teacherImage;
|
|
TearcherData({
|
|
required this.teacherName,
|
|
required this.teacherImage,
|
|
});
|
|
factory TearcherData.fromJson(Map<String, dynamic> json) {
|
|
return TearcherData(
|
|
teacherName: json["teacher_title"],
|
|
teacherImage: json["teacher_image"],
|
|
);
|
|
}
|
|
}
|