579 lines
15 KiB
Dart
579 lines
15 KiB
Dart
class HomeModel {
|
|
String? status;
|
|
int? statusCode;
|
|
String? message;
|
|
Data? data;
|
|
|
|
HomeModel({this.status, this.statusCode, this.message, this.data});
|
|
|
|
HomeModel.fromJson(Map<String, dynamic> json) {
|
|
status = json['status'];
|
|
statusCode = json['status_code'];
|
|
message = json['message'];
|
|
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['status'] = status;
|
|
data['status_code'] = statusCode;
|
|
data['message'] = message;
|
|
if (this.data != null) {
|
|
data['data'] = this.data!.toJson();
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class Data {
|
|
List<ExploreTheUnseenActiveCalls>? exploreTheUnseenActiveCalls;
|
|
List<ExploreTheUnseenExitedCalls>? exploreTheUnseenExitedCalls;
|
|
IndexLiveData? indexLiveData;
|
|
UserData? userData;
|
|
List<Products>? products;
|
|
ContentByteVideo? contentByteVideo;
|
|
bool? isUpstoxTokenRefreshed;
|
|
|
|
Data(
|
|
{this.exploreTheUnseenActiveCalls,
|
|
this.exploreTheUnseenExitedCalls,
|
|
this.userData,
|
|
this.products,
|
|
this.contentByteVideo,
|
|
this.isUpstoxTokenRefreshed,
|
|
this.indexLiveData});
|
|
|
|
Data.fromJson(Map<String, dynamic> json) {
|
|
if (json['explore_the_unseen_active_calls'] != null) {
|
|
exploreTheUnseenActiveCalls = <ExploreTheUnseenActiveCalls>[];
|
|
json['explore_the_unseen_active_calls'].forEach((v) {
|
|
exploreTheUnseenActiveCalls!
|
|
.add(ExploreTheUnseenActiveCalls.fromJson(v));
|
|
});
|
|
}
|
|
if (json['explore_the_unseen_exited_calls'] != null) {
|
|
exploreTheUnseenExitedCalls = <ExploreTheUnseenExitedCalls>[];
|
|
json['explore_the_unseen_exited_calls'].forEach((v) {
|
|
exploreTheUnseenExitedCalls!
|
|
.add(ExploreTheUnseenExitedCalls.fromJson(v));
|
|
});
|
|
}
|
|
indexLiveData = json['index_live_data'] != null
|
|
? IndexLiveData.fromJson(json['index_live_data'])
|
|
: null;
|
|
userData =
|
|
json['user_data'] != null ? UserData.fromJson(json['user_data']) : null;
|
|
if (json['products'] != null) {
|
|
products = <Products>[];
|
|
json['products'].forEach((v) {
|
|
products!.add(Products.fromJson(v));
|
|
});
|
|
}
|
|
contentByteVideo = json['content_byte_video'] != null
|
|
? ContentByteVideo.fromJson(json['content_byte_video'])
|
|
: null;
|
|
isUpstoxTokenRefreshed = json['isUpstoxTokenRefreshed'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
if (exploreTheUnseenActiveCalls != null) {
|
|
data['explore_the_unseen_active_calls'] =
|
|
exploreTheUnseenActiveCalls!.map((v) => v.toJson()).toList();
|
|
}
|
|
if (exploreTheUnseenExitedCalls != null) {
|
|
data['explore_the_unseen_exited_calls'] =
|
|
exploreTheUnseenExitedCalls!.map((v) => v.toJson()).toList();
|
|
}
|
|
if (indexLiveData != null) {
|
|
data['index_live_data'] = indexLiveData!.toJson();
|
|
}
|
|
if (userData != null) {
|
|
data['user_data'] = userData!.toJson();
|
|
}
|
|
if (products != null) {
|
|
data['products'] = products!.map((v) => v.toJson()).toList();
|
|
}
|
|
if (contentByteVideo != null) {
|
|
data['content_byte_video'] = contentByteVideo!.toJson();
|
|
}
|
|
data['isUpstoxTokenRefreshed'] = isUpstoxTokenRefreshed;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class IndexLiveData {
|
|
String? status;
|
|
Data1? data;
|
|
|
|
IndexLiveData({this.status, this.data});
|
|
|
|
IndexLiveData.fromJson(Map<String, dynamic> json) {
|
|
status = json['status'];
|
|
data = json['data'] != null ? Data1.fromJson(json['data']) : null;
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['status'] = status;
|
|
if (this.data != null) {
|
|
data['data'] = this.data!.toJson();
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class Data1 {
|
|
NSEINDEXNiftyBank? nSEINDEXNiftyBank;
|
|
NSEINDEXNiftyBank? nSEINDEXNifty50;
|
|
|
|
Data1({this.nSEINDEXNiftyBank, this.nSEINDEXNifty50});
|
|
|
|
Data1.fromJson(Map<String, dynamic> json) {
|
|
nSEINDEXNiftyBank = json['NSE_INDEX:Nifty Bank'] != null
|
|
? NSEINDEXNiftyBank.fromJson(json['NSE_INDEX:Nifty Bank'])
|
|
: null;
|
|
nSEINDEXNifty50 = json['NSE_INDEX:Nifty 50'] != null
|
|
? NSEINDEXNiftyBank.fromJson(json['NSE_INDEX:Nifty 50'])
|
|
: null;
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
if (nSEINDEXNiftyBank != null) {
|
|
data['NSE_INDEX:Nifty Bank'] = nSEINDEXNiftyBank!.toJson();
|
|
}
|
|
if (nSEINDEXNifty50 != null) {
|
|
data['NSE_INDEX:Nifty 50'] = nSEINDEXNifty50!.toJson();
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class NSEINDEXNiftyBank {
|
|
Ohlc? ohlc;
|
|
|
|
String? timestamp;
|
|
String? instrumentToken;
|
|
String? symbol;
|
|
double? lastPrice;
|
|
|
|
double? netChange;
|
|
|
|
String? lastTradeTime;
|
|
|
|
NSEINDEXNiftyBank({
|
|
this.ohlc,
|
|
this.timestamp,
|
|
this.instrumentToken,
|
|
this.symbol,
|
|
this.lastPrice,
|
|
this.netChange,
|
|
this.lastTradeTime,
|
|
});
|
|
|
|
NSEINDEXNiftyBank.fromJson(Map<String, dynamic> json) {
|
|
ohlc = json['ohlc'] != null ? Ohlc.fromJson(json['ohlc']) : null;
|
|
|
|
timestamp = json['timestamp'];
|
|
instrumentToken = json['instrument_token'];
|
|
symbol = json['symbol'];
|
|
lastPrice = json['last_price'];
|
|
|
|
netChange = json['net_change'];
|
|
|
|
lastTradeTime = json['last_trade_time'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
if (ohlc != null) {
|
|
data['ohlc'] = ohlc!.toJson();
|
|
}
|
|
|
|
data['timestamp'] = timestamp;
|
|
data['instrument_token'] = instrumentToken;
|
|
data['symbol'] = symbol;
|
|
data['last_price'] = lastPrice;
|
|
|
|
data['net_change'] = netChange;
|
|
|
|
data['last_trade_time'] = lastTradeTime;
|
|
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class Ohlc {
|
|
double? open;
|
|
double? high;
|
|
double? low;
|
|
double? close;
|
|
|
|
Ohlc({this.open, this.high, this.low, this.close});
|
|
|
|
Ohlc.fromJson(Map<String, dynamic> json) {
|
|
open = json['open'].toDouble();
|
|
high = json['high'].toDouble();
|
|
low = json['low'].toDouble();
|
|
close = json['close'].toDouble();
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['open'] = open;
|
|
data['high'] = high;
|
|
data['low'] = low;
|
|
data['close'] = close;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class ExploreTheUnseenActiveCalls {
|
|
int? id;
|
|
int? manageProductXid;
|
|
int? recommendationActionsXid;
|
|
String? stockName;
|
|
String? instrumentKey;
|
|
String? stockImage;
|
|
String? qty;
|
|
String? duration;
|
|
String? currentPrice;
|
|
String? buyPrice;
|
|
String? targetPrice;
|
|
String? stopLoss;
|
|
int? isSendRecommendationNow;
|
|
String? scheduleDateTime;
|
|
String? createdAt;
|
|
ProductData? productData;
|
|
ActionData? actionData;
|
|
|
|
ExploreTheUnseenActiveCalls(
|
|
{this.id,
|
|
this.manageProductXid,
|
|
this.recommendationActionsXid,
|
|
this.stockName,
|
|
this.instrumentKey,
|
|
this.stockImage,
|
|
this.qty,
|
|
this.duration,
|
|
this.currentPrice,
|
|
this.buyPrice,
|
|
this.targetPrice,
|
|
this.stopLoss,
|
|
this.isSendRecommendationNow,
|
|
this.scheduleDateTime,
|
|
this.createdAt,
|
|
this.productData,
|
|
this.actionData});
|
|
|
|
ExploreTheUnseenActiveCalls.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
manageProductXid = json['manage_product_xid'];
|
|
recommendationActionsXid = json['recommendation_actions_xid'];
|
|
stockName = json['stock_name'];
|
|
instrumentKey = json['instrument_key'];
|
|
stockImage = json['stock_image'];
|
|
qty = json['qty'];
|
|
duration = json['duration'];
|
|
currentPrice = json['current_price'];
|
|
buyPrice = json['buy_price'];
|
|
targetPrice = json['target_price'];
|
|
stopLoss = json['stop_loss'];
|
|
isSendRecommendationNow = json['is_send_recommendation_now'];
|
|
scheduleDateTime = json['schedule_date_time'];
|
|
createdAt = json['created_at'];
|
|
productData = json['product_data'] != null
|
|
? ProductData.fromJson(json['product_data'])
|
|
: null;
|
|
actionData = json['action_data'] != null
|
|
? ActionData.fromJson(json['action_data'])
|
|
: null;
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['manage_product_xid'] = manageProductXid;
|
|
data['recommendation_actions_xid'] = recommendationActionsXid;
|
|
data['stock_name'] = stockName;
|
|
data['instrument_key'] = instrumentKey;
|
|
data['stock_image'] = stockImage;
|
|
data['qty'] = qty;
|
|
data['duration'] = duration;
|
|
data['current_price'] = currentPrice;
|
|
data['buy_price'] = buyPrice;
|
|
data['target_price'] = targetPrice;
|
|
data['stop_loss'] = stopLoss;
|
|
data['is_send_recommendation_now'] = isSendRecommendationNow;
|
|
data['schedule_date_time'] = scheduleDateTime;
|
|
data['created_at'] = createdAt;
|
|
if (productData != null) {
|
|
data['product_data'] = productData!.toJson();
|
|
}
|
|
if (actionData != null) {
|
|
data['action_data'] = actionData!.toJson();
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class ExploreTheUnseenExitedCalls {
|
|
int? id;
|
|
int? manageProductXid;
|
|
int? recommendationActionsXid;
|
|
String? stockName;
|
|
String? instrumentKey;
|
|
String? stockImage;
|
|
String? qty;
|
|
String? duration;
|
|
String? currentPrice;
|
|
String? buyPrice;
|
|
String? targetPrice;
|
|
String? stopLoss;
|
|
int? isSendRecommendationNow;
|
|
String? scheduleDateTime;
|
|
String? createdAt;
|
|
ProductData? productData;
|
|
ActionData? actionData;
|
|
|
|
ExploreTheUnseenExitedCalls(
|
|
{this.id,
|
|
this.manageProductXid,
|
|
this.recommendationActionsXid,
|
|
this.stockName,
|
|
this.instrumentKey,
|
|
this.stockImage,
|
|
this.qty,
|
|
this.duration,
|
|
this.currentPrice,
|
|
this.buyPrice,
|
|
this.targetPrice,
|
|
this.stopLoss,
|
|
this.isSendRecommendationNow,
|
|
this.scheduleDateTime,
|
|
this.createdAt,
|
|
this.productData,
|
|
this.actionData});
|
|
|
|
ExploreTheUnseenExitedCalls.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
manageProductXid = json['manage_product_xid'];
|
|
recommendationActionsXid = json['recommendation_actions_xid'];
|
|
stockName = json['stock_name'];
|
|
instrumentKey = json['instrument_key'];
|
|
stockImage = json['stock_image'];
|
|
qty = json['qty'];
|
|
duration = json['duration'];
|
|
currentPrice = json['current_price'];
|
|
buyPrice = json['buy_price'];
|
|
targetPrice = json['target_price'];
|
|
stopLoss = json['stop_loss'];
|
|
isSendRecommendationNow = json['is_send_recommendation_now'];
|
|
scheduleDateTime = json['schedule_date_time'];
|
|
createdAt = json['created_at'];
|
|
productData = json['product_data'] != null
|
|
? ProductData.fromJson(json['product_data'])
|
|
: null;
|
|
actionData = json['action_data'] != null
|
|
? ActionData.fromJson(json['action_data'])
|
|
: null;
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['manage_product_xid'] = manageProductXid;
|
|
data['recommendation_actions_xid'] = recommendationActionsXid;
|
|
data['stock_name'] = stockName;
|
|
data['instrument_key'] = instrumentKey;
|
|
data['stock_image'] = stockImage;
|
|
data['qty'] = qty;
|
|
data['duration'] = duration;
|
|
data['current_price'] = currentPrice;
|
|
data['buy_price'] = buyPrice;
|
|
data['target_price'] = targetPrice;
|
|
data['stop_loss'] = stopLoss;
|
|
data['is_send_recommendation_now'] = isSendRecommendationNow;
|
|
data['schedule_date_time'] = scheduleDateTime;
|
|
data['created_at'] = createdAt;
|
|
if (productData != null) {
|
|
data['product_data'] = productData!.toJson();
|
|
}
|
|
if (actionData != null) {
|
|
data['action_data'] = actionData!.toJson();
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class ProductData {
|
|
int? id;
|
|
String? productName;
|
|
int? isActive;
|
|
String? createdAt;
|
|
|
|
ProductData({this.id, this.productName, this.isActive, this.createdAt});
|
|
|
|
ProductData.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
productName = json['product_name'];
|
|
isActive = json['is_active'];
|
|
createdAt = json['created_at'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['product_name'] = productName;
|
|
data['is_active'] = isActive;
|
|
data['created_at'] = createdAt;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class ActionData {
|
|
int? id;
|
|
String? name;
|
|
int? isActive;
|
|
String? createdAt;
|
|
|
|
ActionData({this.id, this.name, this.isActive, this.createdAt});
|
|
|
|
ActionData.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
name = json['name'];
|
|
isActive = json['is_active'];
|
|
createdAt = json['created_at'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['name'] = name;
|
|
data['is_active'] = isActive;
|
|
data['created_at'] = createdAt;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class UserData {
|
|
int? id;
|
|
String? firstName;
|
|
String? lastName;
|
|
String? userName;
|
|
String? profilePhoto;
|
|
String? isActive;
|
|
String? createdAt;
|
|
|
|
UserData(
|
|
{this.id,
|
|
this.firstName,
|
|
this.lastName,
|
|
this.userName,
|
|
this.profilePhoto,
|
|
this.isActive,
|
|
this.createdAt});
|
|
|
|
UserData.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
firstName = json['first_name'];
|
|
lastName = json['last_name'];
|
|
userName = json['user_name'];
|
|
profilePhoto = json['profile_photo'];
|
|
isActive = json['is_active'];
|
|
createdAt = json['created_at'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['first_name'] = firstName;
|
|
data['last_name'] = lastName;
|
|
data['user_name'] = userName;
|
|
data['profile_photo'] = profilePhoto;
|
|
data['is_active'] = isActive;
|
|
data['created_at'] = createdAt;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class Products {
|
|
int? id;
|
|
String? title;
|
|
String? createdAt;
|
|
|
|
Products({this.id, this.title, this.createdAt});
|
|
|
|
Products.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
title = json['title'];
|
|
createdAt = json['created_at'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['title'] = title;
|
|
data['created_at'] = createdAt;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class ContentByteVideo {
|
|
int? id;
|
|
String? contentType;
|
|
String? title;
|
|
String? description;
|
|
String? tags;
|
|
String? file;
|
|
int? categoryId;
|
|
String? image;
|
|
String? isActive;
|
|
String? createdAt;
|
|
String? link;
|
|
|
|
ContentByteVideo(
|
|
{this.id,
|
|
this.contentType,
|
|
this.title,
|
|
this.description,
|
|
this.tags,
|
|
this.file,
|
|
this.categoryId,
|
|
this.image,
|
|
this.isActive,
|
|
this.createdAt,
|
|
this.link});
|
|
|
|
ContentByteVideo.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
contentType = json['content_type'];
|
|
title = json['title'];
|
|
description = json['description'];
|
|
tags = json['tags'];
|
|
file = json['file'];
|
|
categoryId = json['category_id'];
|
|
image = json['image'];
|
|
isActive = json['is_active'];
|
|
createdAt = json['created_at'];
|
|
link = json['link'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['content_type'] = contentType;
|
|
data['title'] = title;
|
|
data['description'] = description;
|
|
data['tags'] = tags;
|
|
data['file'] = file;
|
|
data['category_id'] = categoryId;
|
|
data['image'] = image;
|
|
data['is_active'] = isActive;
|
|
data['created_at'] = createdAt;
|
|
data['link'] = link;
|
|
return data;
|
|
}
|
|
}
|