Files
Traders_Circuit/lib/model/HomeModel/home_model.dart
Rajshinde046 f6713e00c3 websocket
2024-06-05 19:57:59 +05:30

702 lines
20 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 ? new Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['status'] = this.status;
data['status_code'] = this.statusCode;
data['message'] = this.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;
String? upstoxAccessToken;
String? upstoxClientId;
String? upstoxSecretKey;
Data(
{this.exploreTheUnseenActiveCalls,
this.exploreTheUnseenExitedCalls,
this.indexLiveData,
this.userData,
this.products,
this.contentByteVideo,
this.isUpstoxTokenRefreshed,
this.upstoxAccessToken,
this.upstoxClientId,
this.upstoxSecretKey});
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(new ExploreTheUnseenActiveCalls.fromJson(v));
});
}
if (json['explore_the_unseen_exited_calls'] != null) {
exploreTheUnseenExitedCalls = <ExploreTheUnseenExitedCalls>[];
json['explore_the_unseen_exited_calls'].forEach((v) {
exploreTheUnseenExitedCalls!
.add(new ExploreTheUnseenExitedCalls.fromJson(v));
});
}
indexLiveData = json['index_live_data'] != null
? new IndexLiveData.fromJson(json['index_live_data'])
: null;
userData = json['user_data'] != null
? new UserData.fromJson(json['user_data'])
: null;
if (json['products'] != null) {
products = <Products>[];
json['products'].forEach((v) {
products!.add(new Products.fromJson(v));
});
}
contentByteVideo = json['content_byte_video'] != null
? new ContentByteVideo.fromJson(json['content_byte_video'])
: null;
isUpstoxTokenRefreshed = json['isUpstoxTokenRefreshed'];
upstoxAccessToken = json['upstoxAccessToken'];
upstoxClientId = json['upstox_client_id'];
upstoxSecretKey = json['upstox_secret_key'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.exploreTheUnseenActiveCalls != null) {
data['explore_the_unseen_active_calls'] =
this.exploreTheUnseenActiveCalls!.map((v) => v.toJson()).toList();
}
if (this.exploreTheUnseenExitedCalls != null) {
data['explore_the_unseen_exited_calls'] =
this.exploreTheUnseenExitedCalls!.map((v) => v.toJson()).toList();
}
if (this.indexLiveData != null) {
data['index_live_data'] = this.indexLiveData!.toJson();
}
if (this.userData != null) {
data['user_data'] = this.userData!.toJson();
}
if (this.products != null) {
data['products'] = this.products!.map((v) => v.toJson()).toList();
}
if (this.contentByteVideo != null) {
data['content_byte_video'] = this.contentByteVideo!.toJson();
}
data['isUpstoxTokenRefreshed'] = this.isUpstoxTokenRefreshed;
data['upstoxAccessToken'] = this.upstoxAccessToken;
data['upstox_client_id'] = this.upstoxClientId;
data['upstox_secret_key'] = this.upstoxSecretKey;
return data;
}
}
class ExploreTheUnseenActiveCalls {
int? id;
int? productTypeXid;
int? recommendationActionsXid;
String? stockName;
String? instrumentKey;
String? stockImage;
String? duration;
String? currentPrice;
String? buyPrice;
String? targetPrice;
String? stopLoss;
int? isSendRecommendationNow;
String? scheduleDateTime;
String? createdAt;
String? docs;
ProductTypeData? productTypeData;
ActionData? actionData;
ExploreTheUnseenActiveCalls(
{this.id,
this.productTypeXid,
this.recommendationActionsXid,
this.stockName,
this.instrumentKey,
this.stockImage,
this.duration,
this.currentPrice,
this.buyPrice,
this.targetPrice,
this.stopLoss,
this.isSendRecommendationNow,
this.scheduleDateTime,
this.createdAt,
this.docs,
this.productTypeData,
this.actionData});
ExploreTheUnseenActiveCalls.fromJson(Map<String, dynamic> json) {
id = json['id'];
productTypeXid = json['product_type_xid'];
recommendationActionsXid = json['recommendation_actions_xid'];
stockName = json['stock_name'];
instrumentKey = json['instrument_key'];
stockImage = json['stock_image'];
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'];
docs = json['docs'];
productTypeData = json['product_type_data'] != null
? new ProductTypeData.fromJson(json['product_type_data'])
: null;
actionData = json['action_data'] != null
? new ActionData.fromJson(json['action_data'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['product_type_xid'] = this.productTypeXid;
data['recommendation_actions_xid'] = this.recommendationActionsXid;
data['stock_name'] = this.stockName;
data['instrument_key'] = this.instrumentKey;
data['stock_image'] = this.stockImage;
data['duration'] = this.duration;
data['current_price'] = this.currentPrice;
data['buy_price'] = this.buyPrice;
data['target_price'] = this.targetPrice;
data['stop_loss'] = this.stopLoss;
data['is_send_recommendation_now'] = this.isSendRecommendationNow;
data['schedule_date_time'] = this.scheduleDateTime;
data['created_at'] = this.createdAt;
data['docs'] = this.docs;
if (this.productTypeData != null) {
data['product_type_data'] = this.productTypeData!.toJson();
}
if (this.actionData != null) {
data['action_data'] = this.actionData!.toJson();
}
return data;
}
}
class ExploreTheUnseenExitedCalls {
int? id;
int? productTypeXid;
int? recommendationActionsXid;
String? stockName;
String? instrumentKey;
String? stockImage;
String? duration;
String? currentPrice;
String? buyPrice;
String? targetPrice;
String? stopLoss;
int? isSendRecommendationNow;
String? scheduleDateTime;
String? createdAt;
String? docs;
ProductTypeData? productTypeData;
ActionData? actionData;
ExploreTheUnseenExitedCalls(
{this.id,
this.productTypeXid,
this.recommendationActionsXid,
this.stockName,
this.instrumentKey,
this.stockImage,
this.duration,
this.currentPrice,
this.buyPrice,
this.targetPrice,
this.stopLoss,
this.isSendRecommendationNow,
this.scheduleDateTime,
this.createdAt,
this.docs,
this.productTypeData,
this.actionData});
ExploreTheUnseenExitedCalls.fromJson(Map<String, dynamic> json) {
id = json['id'];
productTypeXid = json['product_type_xid'];
recommendationActionsXid = json['recommendation_actions_xid'];
stockName = json['stock_name'];
instrumentKey = json['instrument_key'];
stockImage = json['stock_image'];
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'];
docs = json['docs'];
productTypeData = json['product_type_data'] != null
? new ProductTypeData.fromJson(json['product_type_data'])
: null;
actionData = json['action_data'] != null
? new ActionData.fromJson(json['action_data'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['product_type_xid'] = this.productTypeXid;
data['recommendation_actions_xid'] = this.recommendationActionsXid;
data['stock_name'] = this.stockName;
data['instrument_key'] = this.instrumentKey;
data['stock_image'] = this.stockImage;
data['duration'] = this.duration;
data['current_price'] = this.currentPrice;
data['buy_price'] = this.buyPrice;
data['target_price'] = this.targetPrice;
data['stop_loss'] = this.stopLoss;
data['is_send_recommendation_now'] = this.isSendRecommendationNow;
data['schedule_date_time'] = this.scheduleDateTime;
data['created_at'] = this.createdAt;
data['docs'] = this.docs;
if (this.productTypeData != null) {
data['product_type_data'] = this.productTypeData!.toJson();
}
if (this.actionData != null) {
data['action_data'] = this.actionData!.toJson();
}
return data;
}
}
class ProductTypeData {
int? id;
String? title;
String? isActive;
String? createdAt;
ProductTypeData({this.id, this.title, this.isActive, this.createdAt});
ProductTypeData.fromJson(Map<String, dynamic> json) {
id = json['id'];
title = json['title'];
isActive = json['is_active'];
createdAt = json['created_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['title'] = this.title;
data['is_active'] = this.isActive;
data['created_at'] = this.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 = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['is_active'] = this.isActive;
data['created_at'] = this.createdAt;
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 ? new Data1.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['status'] = this.status;
if (this.data != null) {
data['data'] = this.data!.toJson();
}
return data;
}
}
class Data1 {
NSEINDEXNiftyBank? nSEINDEXNiftyBank;
NSEINDEXNifty50? nSEINDEXNifty50;
Data1({this.nSEINDEXNiftyBank, this.nSEINDEXNifty50});
Data1.fromJson(Map<String, dynamic> json) {
nSEINDEXNiftyBank = json['NSE_INDEX:Nifty Bank'] != null
? new NSEINDEXNiftyBank.fromJson(json['NSE_INDEX:Nifty Bank'])
: null;
nSEINDEXNifty50 = json['NSE_INDEX:Nifty 50'] != null
? new NSEINDEXNifty50.fromJson(json['NSE_INDEX:Nifty 50'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.nSEINDEXNiftyBank != null) {
data['NSE_INDEX:Nifty Bank'] = this.nSEINDEXNiftyBank!.toJson();
}
if (this.nSEINDEXNifty50 != null) {
data['NSE_INDEX:Nifty 50'] = this.nSEINDEXNifty50!.toJson();
}
return data;
}
}
class NSEINDEXNiftyBank {
Ohlc? ohlc;
String? timestamp;
String? instrumentToken;
String? symbol;
double? lastPrice;
String? volume;
String? averagePrice;
Null? oi;
int? netChange;
String? totalBuyQuantity;
String? totalSellQuantity;
String? lowerCircuitLimit;
String? upperCircuitLimit;
String? lastTradeTime;
String? oiDayHigh;
String? oiDayLow;
NSEINDEXNiftyBank(
{this.ohlc,
this.timestamp,
this.instrumentToken,
this.symbol,
this.lastPrice,
this.volume,
this.averagePrice,
this.oi,
this.netChange,
this.totalBuyQuantity,
this.totalSellQuantity,
this.lowerCircuitLimit,
this.upperCircuitLimit,
this.lastTradeTime,
this.oiDayHigh,
this.oiDayLow});
NSEINDEXNiftyBank.fromJson(Map<String, dynamic> json) {
ohlc = json['ohlc'] != null ? new Ohlc.fromJson(json['ohlc']) : null;
timestamp = json['timestamp'];
instrumentToken = json['instrument_token'];
symbol = json['symbol'];
lastPrice = json['last_price'];
volume = json['volume'];
averagePrice = json['average_price'];
oi = json['oi'];
netChange = json['net_change'];
totalBuyQuantity = json['total_buy_quantity'];
totalSellQuantity = json['total_sell_quantity'];
lowerCircuitLimit = json['lower_circuit_limit'];
upperCircuitLimit = json['upper_circuit_limit'];
lastTradeTime = json['last_trade_time'];
oiDayHigh = json['oi_day_high'];
oiDayLow = json['oi_day_low'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.ohlc != null) {
data['ohlc'] = this.ohlc!.toJson();
}
data['timestamp'] = this.timestamp;
data['instrument_token'] = this.instrumentToken;
data['symbol'] = this.symbol;
data['last_price'] = this.lastPrice;
data['volume'] = this.volume;
data['average_price'] = this.averagePrice;
data['oi'] = this.oi;
data['net_change'] = this.netChange;
data['total_buy_quantity'] = this.totalBuyQuantity;
data['total_sell_quantity'] = this.totalSellQuantity;
data['lower_circuit_limit'] = this.lowerCircuitLimit;
data['upper_circuit_limit'] = this.upperCircuitLimit;
data['last_trade_time'] = this.lastTradeTime;
data['oi_day_high'] = this.oiDayHigh;
data['oi_day_low'] = this.oiDayLow;
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'];
high = json['high'];
low = json['low'];
close = json['close'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['open'] = this.open;
data['high'] = this.high;
data['low'] = this.low;
data['close'] = this.close;
return data;
}
}
class NSEINDEXNifty50 {
Ohlc? ohlc;
String? timestamp;
String? instrumentToken;
String? symbol;
double? lastPrice;
Null? volume;
Null? averagePrice;
Null? oi;
double? netChange;
String? totalBuyQuantity;
String? totalSellQuantity;
String? lowerCircuitLimit;
String? upperCircuitLimit;
String? lastTradeTime;
String? oiDayHigh;
String? oiDayLow;
NSEINDEXNifty50(
{this.ohlc,
this.timestamp,
this.instrumentToken,
this.symbol,
this.lastPrice,
this.volume,
this.averagePrice,
this.oi,
this.netChange,
this.totalBuyQuantity,
this.totalSellQuantity,
this.lowerCircuitLimit,
this.upperCircuitLimit,
this.lastTradeTime,
this.oiDayHigh,
this.oiDayLow});
NSEINDEXNifty50.fromJson(Map<String, dynamic> json) {
ohlc = json['ohlc'] != null ? new Ohlc.fromJson(json['ohlc']) : null;
timestamp = json['timestamp'];
instrumentToken = json['instrument_token'];
symbol = json['symbol'];
lastPrice = json['last_price'];
volume = json['volume'];
averagePrice = json['average_price'];
oi = json['oi'];
netChange = json['net_change'];
totalBuyQuantity = json['total_buy_quantity'];
totalSellQuantity = json['total_sell_quantity'];
lowerCircuitLimit = json['lower_circuit_limit'];
upperCircuitLimit = json['upper_circuit_limit'];
lastTradeTime = json['last_trade_time'];
oiDayHigh = json['oi_day_high'];
oiDayLow = json['oi_day_low'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.ohlc != null) {
data['ohlc'] = this.ohlc!.toJson();
}
data['timestamp'] = this.timestamp;
data['instrument_token'] = this.instrumentToken;
data['symbol'] = this.symbol;
data['last_price'] = this.lastPrice;
data['volume'] = this.volume;
data['average_price'] = this.averagePrice;
data['oi'] = this.oi;
data['net_change'] = this.netChange;
data['total_buy_quantity'] = this.totalBuyQuantity;
data['total_sell_quantity'] = this.totalSellQuantity;
data['lower_circuit_limit'] = this.lowerCircuitLimit;
data['upper_circuit_limit'] = this.upperCircuitLimit;
data['last_trade_time'] = this.lastTradeTime;
data['oi_day_high'] = this.oiDayHigh;
data['oi_day_low'] = this.oiDayLow;
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 = new Map<String, dynamic>();
data['id'] = this.id;
data['first_name'] = this.firstName;
data['last_name'] = this.lastName;
data['user_name'] = this.userName;
data['profile_photo'] = this.profilePhoto;
data['is_active'] = this.isActive;
data['created_at'] = this.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 = new Map<String, dynamic>();
data['id'] = this.id;
data['title'] = this.title;
data['created_at'] = this.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 = new Map<String, dynamic>();
data['id'] = this.id;
data['content_type'] = this.contentType;
data['title'] = this.title;
data['description'] = this.description;
data['tags'] = this.tags;
data['file'] = this.file;
data['category_id'] = this.categoryId;
data['image'] = this.image;
data['is_active'] = this.isActive;
data['created_at'] = this.createdAt;
data['link'] = this.link;
return data;
}
}