diff --git a/lib/Utils/api_urls.dart b/lib/Utils/api_urls.dart index c73a34b..102c602 100644 --- a/lib/Utils/api_urls.dart +++ b/lib/Utils/api_urls.dart @@ -4,7 +4,7 @@ class ApiUrls { static const String pieBase = "https://app.piadvisors.in/"; //Base URL - static const base = "http://192.168.50.82/Trader_circuit/api/"; + static const base = "http://192.168.50.112/Trader_circuit/api/"; //send otp static String sendOtp = "${base}sendOTP"; @@ -30,4 +30,9 @@ class ApiUrls { //RISK PROFILE API static String getRiskProfileQuestionAnswerApi = "${base}riskProfileQueAns"; static String addRiskProfileQuestionAnswerApi = "${base}addUserRiskProfile"; + + //CONTENT BYTES API + static String getContentBytesCategoriesApi = + "${base}getContentByteCategories"; + static String getContentBytesApi = "${base}getContentBytes"; } diff --git a/lib/controller/content_bytes_controller.dart b/lib/controller/content_bytes_controller.dart new file mode 100644 index 0000000..7fa544c --- /dev/null +++ b/lib/controller/content_bytes_controller.dart @@ -0,0 +1,11 @@ +import 'package:get/get.dart'; +import 'package:traderscircuit/model/ContentBytesModel/content_bytes_categories_model.dart'; +import 'package:traderscircuit/model/ContentBytesModel/content_bytes_model.dart'; + +class ContentBytesController extends GetxController { + ContentBytesCategoriesModel contentBytesCategoriesModel = + ContentBytesCategoriesModel(); + ContentBytesModel contentBytesModel = ContentBytesModel(); + int filterId = 0; + RxBool isApiCalling = true.obs; +} diff --git a/lib/model/ContentBytesModel/content_bytes_categories_model.dart b/lib/model/ContentBytesModel/content_bytes_categories_model.dart new file mode 100644 index 0000000..885faef --- /dev/null +++ b/lib/model/ContentBytesModel/content_bytes_categories_model.dart @@ -0,0 +1,83 @@ +class ContentBytesCategoriesModel { + String? status; + int? statusCode; + String? message; + List? data; + + ContentBytesCategoriesModel( + {this.status, this.statusCode, this.message, this.data}); + + ContentBytesCategoriesModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Data { + int? id; + String? contentType; + String? title; + String? description; + String? tags; + String? file; + int? categoryId; + String? image; + String? isActive; + + Data({ + this.id, + this.contentType, + this.title, + this.description, + this.tags, + this.file, + this.categoryId, + this.image, + this.isActive, + }); + + Data.fromJson(Map 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']; + } + + Map toJson() { + final Map data = {}; + 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; + + return data; + } +} diff --git a/lib/model/ContentBytesModel/content_bytes_model.dart b/lib/model/ContentBytesModel/content_bytes_model.dart new file mode 100644 index 0000000..22a9d20 --- /dev/null +++ b/lib/model/ContentBytesModel/content_bytes_model.dart @@ -0,0 +1,222 @@ +class ContentBytesModel { + String? status; + int? statusCode; + String? message; + Data? data; + + ContentBytesModel({this.status, this.statusCode, this.message, this.data}); + + ContentBytesModel.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['status'] = status; + data['status_code'] = statusCode; + data['message'] = message; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + List