io api settings api

This commit is contained in:
jayesh
2024-07-26 12:03:47 +05:30
parent 3c224e1036
commit 2da07cba30
17 changed files with 788 additions and 395 deletions

View File

@@ -8,19 +8,19 @@ class AvailableIOModel {
AvailableIOModel.fromJson(Map<String, dynamic> json) { AvailableIOModel.fromJson(Map<String, dynamic> json) {
statusCode = json['statusCode']; statusCode = json['statusCode'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null; data = json['data'] != null ? Data.fromJson(json['data']) : null;
message = json['message']; message = json['message'];
success = json['success']; success = json['success'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['statusCode'] = this.statusCode; data['statusCode'] = statusCode;
if (this.data != null) { if (this.data != null) {
data['data'] = this.data!.toJson(); data['data'] = this.data!.toJson();
} }
data['message'] = this.message; data['message'] = message;
data['success'] = this.success; data['success'] = success;
return data; return data;
} }
} }
@@ -38,7 +38,7 @@ class Data {
if (json['rows'] != null) { if (json['rows'] != null) {
rows = <Rows>[]; rows = <Rows>[];
json['rows'].forEach((v) { json['rows'].forEach((v) {
rows!.add(new Rows.fromJson(v)); rows!.add(Rows.fromJson(v));
}); });
} }
totalPages = json['totalPages']; totalPages = json['totalPages'];
@@ -46,13 +46,13 @@ class Data {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['totalItems'] = this.totalItems; data['totalItems'] = totalItems;
if (this.rows != null) { if (rows != null) {
data['rows'] = this.rows!.map((v) => v.toJson()).toList(); data['rows'] = rows!.map((v) => v.toJson()).toList();
} }
data['totalPages'] = this.totalPages; data['totalPages'] = totalPages;
data['currentPage'] = this.currentPage; data['currentPage'] = currentPage;
return data; return data;
} }
} }
@@ -79,11 +79,11 @@ class Rows {
bool? isInvestedAmount; bool? isInvestedAmount;
String? amountInvested; String? amountInvested;
bool? isActive; bool? isActive;
Null? createdBy; Null createdBy;
Null? modifiedBy; Null modifiedBy;
String? createdAt; String? createdAt;
String? updatedAt; String? updatedAt;
Null? deletedAt; Null deletedAt;
Sponsor? sponsor; Sponsor? sponsor;
IoStatus? ioStatus; IoStatus? ioStatus;
InvestmentType? investmentType; InvestmentType? investmentType;
@@ -151,71 +151,69 @@ class Rows {
updatedAt = json['updatedAt']; updatedAt = json['updatedAt'];
deletedAt = json['deletedAt']; deletedAt = json['deletedAt'];
sponsor = sponsor =
json['sponsor'] != null ? new Sponsor.fromJson(json['sponsor']) : null; json['sponsor'] != null ? Sponsor.fromJson(json['sponsor']) : null;
ioStatus = json['ioStatus'] != null ioStatus =
? new IoStatus.fromJson(json['ioStatus']) json['ioStatus'] != null ? IoStatus.fromJson(json['ioStatus']) : null;
: null;
investmentType = json['investmentType'] != null investmentType = json['investmentType'] != null
? new InvestmentType.fromJson(json['investmentType']) ? InvestmentType.fromJson(json['investmentType'])
: null; : null;
if (json['artifactsImage'] != null) { if (json['artifactsImage'] != null) {
artifactsImage = <ArtifactsImage>[]; artifactsImage = <ArtifactsImage>[];
json['artifactsImage'].forEach((v) { json['artifactsImage'].forEach((v) {
artifactsImage!.add(new ArtifactsImage.fromJson(v)); artifactsImage!.add(ArtifactsImage.fromJson(v));
}); });
} }
if (json['minInvestmentAmt'] != null) { if (json['minInvestmentAmt'] != null) {
minInvestmentAmt = <MinInvestmentAmt>[]; minInvestmentAmt = <MinInvestmentAmt>[];
json['minInvestmentAmt'].forEach((v) { json['minInvestmentAmt'].forEach((v) {
minInvestmentAmt!.add(new MinInvestmentAmt.fromJson(v)); minInvestmentAmt!.add(MinInvestmentAmt.fromJson(v));
}); });
} }
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = this.id; data['id'] = id;
data['io_id'] = this.ioId; data['io_id'] = ioId;
data['investmentType_xid'] = this.investmentTypeXid; data['investmentType_xid'] = investmentTypeXid;
data['sponsor_xid'] = this.sponsorXid; data['sponsor_xid'] = sponsorXid;
data['ioStatus_xid'] = this.ioStatusXid; data['ioStatus_xid'] = ioStatusXid;
data['investmentNameEnglish'] = this.investmentNameEnglish; data['investmentNameEnglish'] = investmentNameEnglish;
data['investmentNameArabic'] = this.investmentNameArabic; data['investmentNameArabic'] = investmentNameArabic;
data['descriptionEnglish'] = this.descriptionEnglish; data['descriptionEnglish'] = descriptionEnglish;
data['descriptionArabic'] = this.descriptionArabic; data['descriptionArabic'] = descriptionArabic;
data['goalAmount'] = this.goalAmount; data['goalAmount'] = goalAmount;
data['closingDate'] = this.closingDate; data['closingDate'] = closingDate;
data['holdingPeriod'] = this.holdingPeriod; data['holdingPeriod'] = holdingPeriod;
data['expectedReturn'] = this.expectedReturn; data['expectedReturn'] = expectedReturn;
data['originalValuation'] = this.originalValuation; data['originalValuation'] = originalValuation;
data['currentValuation'] = this.currentValuation; data['currentValuation'] = currentValuation;
data['ISIN'] = this.iSIN; data['ISIN'] = iSIN;
data['InvestmentDetails'] = this.investmentDetails; data['InvestmentDetails'] = investmentDetails;
data['comment'] = this.comment; data['comment'] = comment;
data['isInvestedAmount'] = this.isInvestedAmount; data['isInvestedAmount'] = isInvestedAmount;
data['amountInvested'] = this.amountInvested; data['amountInvested'] = amountInvested;
data['isActive'] = this.isActive; data['isActive'] = isActive;
data['createdBy'] = this.createdBy; data['createdBy'] = createdBy;
data['modifiedBy'] = this.modifiedBy; data['modifiedBy'] = modifiedBy;
data['createdAt'] = this.createdAt; data['createdAt'] = createdAt;
data['updatedAt'] = this.updatedAt; data['updatedAt'] = updatedAt;
data['deletedAt'] = this.deletedAt; data['deletedAt'] = deletedAt;
if (this.sponsor != null) { if (sponsor != null) {
data['sponsor'] = this.sponsor!.toJson(); data['sponsor'] = sponsor!.toJson();
} }
if (this.ioStatus != null) { if (ioStatus != null) {
data['ioStatus'] = this.ioStatus!.toJson(); data['ioStatus'] = ioStatus!.toJson();
} }
if (this.investmentType != null) { if (investmentType != null) {
data['investmentType'] = this.investmentType!.toJson(); data['investmentType'] = investmentType!.toJson();
} }
if (this.artifactsImage != null) { if (artifactsImage != null) {
data['artifactsImage'] = data['artifactsImage'] = artifactsImage!.map((v) => v.toJson()).toList();
this.artifactsImage!.map((v) => v.toJson()).toList();
} }
if (this.minInvestmentAmt != null) { if (minInvestmentAmt != null) {
data['minInvestmentAmt'] = data['minInvestmentAmt'] =
this.minInvestmentAmt!.map((v) => v.toJson()).toList(); minInvestmentAmt!.map((v) => v.toJson()).toList();
} }
return data; return data;
} }
@@ -226,17 +224,17 @@ class Sponsor {
String? sponsorName; String? sponsorName;
String? sponsorNameArabic; String? sponsorNameArabic;
String? email; String? email;
Null? profile; Null profile;
Null? address; Null address;
Null? mobileNo; Null mobileNo;
Null? bankName; Null bankName;
Null? accountNumber; Null accountNumber;
bool? isActive; bool? isActive;
Null? createdBy; Null createdBy;
Null? modifiedBy; Null modifiedBy;
String? createdAt; String? createdAt;
String? updatedAt; String? updatedAt;
Null? deletedAt; Null deletedAt;
Sponsor( Sponsor(
{this.id, {this.id,
@@ -274,22 +272,22 @@ class Sponsor {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = this.id; data['id'] = id;
data['sponsorName'] = this.sponsorName; data['sponsorName'] = sponsorName;
data['sponsorNameArabic'] = this.sponsorNameArabic; data['sponsorNameArabic'] = sponsorNameArabic;
data['email'] = this.email; data['email'] = email;
data['profile'] = this.profile; data['profile'] = profile;
data['address'] = this.address; data['address'] = address;
data['mobileNo'] = this.mobileNo; data['mobileNo'] = mobileNo;
data['bankName'] = this.bankName; data['bankName'] = bankName;
data['accountNumber'] = this.accountNumber; data['accountNumber'] = accountNumber;
data['isActive'] = this.isActive; data['isActive'] = isActive;
data['createdBy'] = this.createdBy; data['createdBy'] = createdBy;
data['modifiedBy'] = this.modifiedBy; data['modifiedBy'] = modifiedBy;
data['createdAt'] = this.createdAt; data['createdAt'] = createdAt;
data['updatedAt'] = this.updatedAt; data['updatedAt'] = updatedAt;
data['deletedAt'] = this.deletedAt; data['deletedAt'] = deletedAt;
return data; return data;
} }
} }
@@ -300,11 +298,11 @@ class IoStatus {
String? statusInvest; String? statusInvest;
String? statusPortfolio; String? statusPortfolio;
bool? isActive; bool? isActive;
Null? createdBy; Null createdBy;
Null? modifiedBy; Null modifiedBy;
String? createdAt; String? createdAt;
String? updatedAt; String? updatedAt;
Null? deletedAt; Null deletedAt;
IoStatus( IoStatus(
{this.id, {this.id,
@@ -332,17 +330,17 @@ class IoStatus {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = this.id; data['id'] = id;
data['statusAdmin'] = this.statusAdmin; data['statusAdmin'] = statusAdmin;
data['statusInvest'] = this.statusInvest; data['statusInvest'] = statusInvest;
data['statusPortfolio'] = this.statusPortfolio; data['statusPortfolio'] = statusPortfolio;
data['isActive'] = this.isActive; data['isActive'] = isActive;
data['createdBy'] = this.createdBy; data['createdBy'] = createdBy;
data['modifiedBy'] = this.modifiedBy; data['modifiedBy'] = modifiedBy;
data['createdAt'] = this.createdAt; data['createdAt'] = createdAt;
data['updatedAt'] = this.updatedAt; data['updatedAt'] = updatedAt;
data['deletedAt'] = this.deletedAt; data['deletedAt'] = deletedAt;
return data; return data;
} }
} }
@@ -354,11 +352,11 @@ class InvestmentType {
String? note; String? note;
String? noteArabic; String? noteArabic;
bool? isActive; bool? isActive;
Null? createdBy; Null createdBy;
Null? modifiedBy; Null modifiedBy;
String? createdAt; String? createdAt;
String? updatedAt; String? updatedAt;
Null? deletedAt; Null deletedAt;
InvestmentType( InvestmentType(
{this.id, {this.id,
@@ -388,18 +386,18 @@ class InvestmentType {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = this.id; data['id'] = id;
data['investmentTypeName'] = this.investmentTypeName; data['investmentTypeName'] = investmentTypeName;
data['investmentTypeNameArabic'] = this.investmentTypeNameArabic; data['investmentTypeNameArabic'] = investmentTypeNameArabic;
data['note'] = this.note; data['note'] = note;
data['noteArabic'] = this.noteArabic; data['noteArabic'] = noteArabic;
data['isActive'] = this.isActive; data['isActive'] = isActive;
data['createdBy'] = this.createdBy; data['createdBy'] = createdBy;
data['modifiedBy'] = this.modifiedBy; data['modifiedBy'] = modifiedBy;
data['createdAt'] = this.createdAt; data['createdAt'] = createdAt;
data['updatedAt'] = this.updatedAt; data['updatedAt'] = updatedAt;
data['deletedAt'] = this.deletedAt; data['deletedAt'] = deletedAt;
return data; return data;
} }
} }
@@ -411,11 +409,11 @@ class ArtifactsImage {
String? artifactPathName; String? artifactPathName;
int? displayOrder; int? displayOrder;
bool? isActive; bool? isActive;
Null? createdBy; Null createdBy;
Null? modifiedBy; Null modifiedBy;
String? createdAt; String? createdAt;
String? updatedAt; String? updatedAt;
Null? deletedAt; Null deletedAt;
ArtifactsImage( ArtifactsImage(
{this.id, {this.id,
@@ -445,18 +443,18 @@ class ArtifactsImage {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = this.id; data['id'] = id;
data['io_xid'] = this.ioXid; data['io_xid'] = ioXid;
data['artifactName'] = this.artifactName; data['artifactName'] = artifactName;
data['artifactPathName'] = this.artifactPathName; data['artifactPathName'] = artifactPathName;
data['displayOrder'] = this.displayOrder; data['displayOrder'] = displayOrder;
data['isActive'] = this.isActive; data['isActive'] = isActive;
data['createdBy'] = this.createdBy; data['createdBy'] = createdBy;
data['modifiedBy'] = this.modifiedBy; data['modifiedBy'] = modifiedBy;
data['createdAt'] = this.createdAt; data['createdAt'] = createdAt;
data['updatedAt'] = this.updatedAt; data['updatedAt'] = updatedAt;
data['deletedAt'] = this.deletedAt; data['deletedAt'] = deletedAt;
return data; return data;
} }
} }
@@ -468,11 +466,11 @@ class MinInvestmentAmt {
String? minInvestmentAmt; String? minInvestmentAmt;
String? maxInvestmentAmt; String? maxInvestmentAmt;
bool? isActive; bool? isActive;
Null? createdBy; Null createdBy;
Null? modifiedBy; Null modifiedBy;
String? createdAt; String? createdAt;
String? updatedAt; String? updatedAt;
Null? deletedAt; Null deletedAt;
MinInvestmentAmt( MinInvestmentAmt(
{this.id, {this.id,
@@ -502,18 +500,18 @@ class MinInvestmentAmt {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = this.id; data['id'] = id;
data['io_xid'] = this.ioXid; data['io_xid'] = ioXid;
data['country_xid'] = this.countryXid; data['country_xid'] = countryXid;
data['minInvestmentAmt'] = this.minInvestmentAmt; data['minInvestmentAmt'] = minInvestmentAmt;
data['maxInvestmentAmt'] = this.maxInvestmentAmt; data['maxInvestmentAmt'] = maxInvestmentAmt;
data['isActive'] = this.isActive; data['isActive'] = isActive;
data['createdBy'] = this.createdBy; data['createdBy'] = createdBy;
data['modifiedBy'] = this.modifiedBy; data['modifiedBy'] = modifiedBy;
data['createdAt'] = this.createdAt; data['createdAt'] = createdAt;
data['updatedAt'] = this.updatedAt; data['updatedAt'] = updatedAt;
data['deletedAt'] = this.deletedAt; data['deletedAt'] = deletedAt;
return data; return data;
} }
} }

View File

@@ -8,19 +8,19 @@ class DetailIOModel {
DetailIOModel.fromJson(Map<String, dynamic> json) { DetailIOModel.fromJson(Map<String, dynamic> json) {
statusCode = json['statusCode']; statusCode = json['statusCode'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null; data = json['data'] != null ? Data.fromJson(json['data']) : null;
message = json['message']; message = json['message'];
success = json['success']; success = json['success'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['statusCode'] = this.statusCode; data['statusCode'] = statusCode;
if (this.data != null) { if (this.data != null) {
data['data'] = this.data!.toJson(); data['data'] = this.data!.toJson();
} }
data['message'] = this.message; data['message'] = message;
data['success'] = this.success; data['success'] = success;
return data; return data;
} }
} }
@@ -47,56 +47,55 @@ class Data {
bool? isInvestedAmount; bool? isInvestedAmount;
String? amountInvested; String? amountInvested;
bool? isActive; bool? isActive;
Null? createdBy; Null createdBy;
Null? modifiedBy; Null modifiedBy;
String? createdAt; String? createdAt;
String? updatedAt; String? updatedAt;
Null? deletedAt; Null deletedAt;
Sponsor? sponsor; Sponsor? sponsor;
IoStatus? ioStatus; IoStatus? ioStatus;
InvestmentType? investmentType; InvestmentType? investmentType;
// List<Null>? documents; List<Documents>? documents;
// List<Null>? artifactsVideo; List<ArtifactsVideo>? artifactsVideo;
// List<Null>? artifactsImage; List<ArtifactsImage>? artifactsImage;
List<MinInvestmentAmt>? minInvestmentAmt; List<MinInvestmentAmt>? minInvestmentAmt;
// List<Null>? keyMerits; List<KeyMerits>? keyMerits;
Data({ Data(
this.id, {this.id,
this.ioId, this.ioId,
this.investmentTypeXid, this.investmentTypeXid,
this.sponsorXid, this.sponsorXid,
this.ioStatusXid, this.ioStatusXid,
this.investmentNameEnglish, this.investmentNameEnglish,
this.investmentNameArabic, this.investmentNameArabic,
this.descriptionEnglish, this.descriptionEnglish,
this.descriptionArabic, this.descriptionArabic,
this.goalAmount, this.goalAmount,
this.closingDate, this.closingDate,
this.holdingPeriod, this.holdingPeriod,
this.expectedReturn, this.expectedReturn,
this.originalValuation, this.originalValuation,
this.currentValuation, this.currentValuation,
this.iSIN, this.iSIN,
this.investmentDetails, this.investmentDetails,
this.comment, this.comment,
this.isInvestedAmount, this.isInvestedAmount,
this.amountInvested, this.amountInvested,
this.isActive, this.isActive,
this.createdBy, this.createdBy,
this.modifiedBy, this.modifiedBy,
this.createdAt, this.createdAt,
this.updatedAt, this.updatedAt,
this.deletedAt, this.deletedAt,
this.sponsor, this.sponsor,
this.ioStatus, this.ioStatus,
this.investmentType, this.investmentType,
// this.documents, this.documents,
// this.artifactsVideo, this.artifactsVideo,
// this.artifactsImage, this.artifactsImage,
this.minInvestmentAmt, this.minInvestmentAmt,
// this.keyMerits this.keyMerits});
});
Data.fromJson(Map<String, dynamic> json) { Data.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@@ -126,100 +125,97 @@ class Data {
updatedAt = json['updatedAt']; updatedAt = json['updatedAt'];
deletedAt = json['deletedAt']; deletedAt = json['deletedAt'];
sponsor = sponsor =
json['sponsor'] != null ? new Sponsor.fromJson(json['sponsor']) : null; json['sponsor'] != null ? Sponsor.fromJson(json['sponsor']) : null;
ioStatus = json['ioStatus'] != null ioStatus =
? new IoStatus.fromJson(json['ioStatus']) json['ioStatus'] != null ? IoStatus.fromJson(json['ioStatus']) : null;
: null;
investmentType = json['investmentType'] != null investmentType = json['investmentType'] != null
? new InvestmentType.fromJson(json['investmentType']) ? InvestmentType.fromJson(json['investmentType'])
: null; : null;
// if (json['documents'] != null) { if (json['documents'] != null) {
// documents = <Null>[]; documents = <Documents>[];
// json['documents'].forEach((v) { json['documents'].forEach((v) {
// documents!.add(new Null.fromJson(v)); documents!.add(Documents.fromJson(v));
// }); });
// } }
// if (json['artifactsVideo'] != null) { if (json['artifactsVideo'] != null) {
// artifactsVideo = <Null>[]; artifactsVideo = <ArtifactsVideo>[];
// json['artifactsVideo'].forEach((v) { json['artifactsVideo'].forEach((v) {
// artifactsVideo!.add(new Null.fromJson(v)); artifactsVideo!.add(ArtifactsVideo.fromJson(v));
// }); });
// } }
// if (json['artifactsImage'] != null) { if (json['artifactsImage'] != null) {
// artifactsImage = <Null>[]; artifactsImage = <ArtifactsImage>[];
// json['artifactsImage'].forEach((v) { json['artifactsImage'].forEach((v) {
// artifactsImage!.add(new Null.fromJson(v)); artifactsImage!.add(ArtifactsImage.fromJson(v));
// }); });
// } }
if (json['minInvestmentAmt'] != null) { if (json['minInvestmentAmt'] != null) {
minInvestmentAmt = <MinInvestmentAmt>[]; minInvestmentAmt = <MinInvestmentAmt>[];
json['minInvestmentAmt'].forEach((v) { json['minInvestmentAmt'].forEach((v) {
minInvestmentAmt!.add(new MinInvestmentAmt.fromJson(v)); minInvestmentAmt!.add(MinInvestmentAmt.fromJson(v));
});
}
if (json['keyMerits'] != null) {
keyMerits = <KeyMerits>[];
json['keyMerits'].forEach((v) {
keyMerits!.add(KeyMerits.fromJson(v));
}); });
} }
// if (json['keyMerits'] != null) {
// keyMerits = <Null>[];
// json['keyMerits'].forEach((v) {
// keyMerits!.add(new Null.fromJson(v));
// });
// }
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = this.id; data['id'] = id;
data['io_id'] = this.ioId; data['io_id'] = ioId;
data['investmentType_xid'] = this.investmentTypeXid; data['investmentType_xid'] = investmentTypeXid;
data['sponsor_xid'] = this.sponsorXid; data['sponsor_xid'] = sponsorXid;
data['ioStatus_xid'] = this.ioStatusXid; data['ioStatus_xid'] = ioStatusXid;
data['investmentNameEnglish'] = this.investmentNameEnglish; data['investmentNameEnglish'] = investmentNameEnglish;
data['investmentNameArabic'] = this.investmentNameArabic; data['investmentNameArabic'] = investmentNameArabic;
data['descriptionEnglish'] = this.descriptionEnglish; data['descriptionEnglish'] = descriptionEnglish;
data['descriptionArabic'] = this.descriptionArabic; data['descriptionArabic'] = descriptionArabic;
data['goalAmount'] = this.goalAmount; data['goalAmount'] = goalAmount;
data['closingDate'] = this.closingDate; data['closingDate'] = closingDate;
data['holdingPeriod'] = this.holdingPeriod; data['holdingPeriod'] = holdingPeriod;
data['expectedReturn'] = this.expectedReturn; data['expectedReturn'] = expectedReturn;
data['originalValuation'] = this.originalValuation; data['originalValuation'] = originalValuation;
data['currentValuation'] = this.currentValuation; data['currentValuation'] = currentValuation;
data['ISIN'] = this.iSIN; data['ISIN'] = iSIN;
data['InvestmentDetails'] = this.investmentDetails; data['InvestmentDetails'] = investmentDetails;
data['comment'] = this.comment; data['comment'] = comment;
data['isInvestedAmount'] = this.isInvestedAmount; data['isInvestedAmount'] = isInvestedAmount;
data['amountInvested'] = this.amountInvested; data['amountInvested'] = amountInvested;
data['isActive'] = this.isActive; data['isActive'] = isActive;
data['createdBy'] = this.createdBy; data['createdBy'] = createdBy;
data['modifiedBy'] = this.modifiedBy; data['modifiedBy'] = modifiedBy;
data['createdAt'] = this.createdAt; data['createdAt'] = createdAt;
data['updatedAt'] = this.updatedAt; data['updatedAt'] = updatedAt;
data['deletedAt'] = this.deletedAt; data['deletedAt'] = deletedAt;
if (this.sponsor != null) { if (sponsor != null) {
data['sponsor'] = this.sponsor!.toJson(); data['sponsor'] = sponsor!.toJson();
} }
if (this.ioStatus != null) { if (ioStatus != null) {
data['ioStatus'] = this.ioStatus!.toJson(); data['ioStatus'] = ioStatus!.toJson();
} }
if (this.investmentType != null) { if (investmentType != null) {
data['investmentType'] = this.investmentType!.toJson(); data['investmentType'] = investmentType!.toJson();
} }
// if (this.documents != null) { if (documents != null) {
// data['documents'] = this.documents!.map((v) => v.toJson()).toList(); data['documents'] = documents!.map((v) => v.toJson()).toList();
// } }
// if (this.artifactsVideo != null) { if (artifactsVideo != null) {
// data['artifactsVideo'] = data['artifactsVideo'] = artifactsVideo!.map((v) => v.toJson()).toList();
// this.artifactsVideo!.map((v) => v.toJson()).toList(); }
// } if (artifactsImage != null) {
// if (this.artifactsImage != null) { data['artifactsImage'] = artifactsImage!.map((v) => v.toJson()).toList();
// data['artifactsImage'] = }
// this.artifactsImage!.map((v) => v.toJson()).toList(); if (minInvestmentAmt != null) {
// }
if (this.minInvestmentAmt != null) {
data['minInvestmentAmt'] = data['minInvestmentAmt'] =
this.minInvestmentAmt!.map((v) => v.toJson()).toList(); minInvestmentAmt!.map((v) => v.toJson()).toList();
}
if (keyMerits != null) {
data['keyMerits'] = keyMerits!.map((v) => v.toJson()).toList();
} }
// if (this.keyMerits != null) {
// data['keyMerits'] = this.keyMerits!.map((v) => v.toJson()).toList();
// }
return data; return data;
} }
} }
@@ -229,17 +225,17 @@ class Sponsor {
String? sponsorName; String? sponsorName;
String? sponsorNameArabic; String? sponsorNameArabic;
String? email; String? email;
Null? profile; Null profile;
Null? address; Null address;
Null? mobileNo; Null mobileNo;
Null? bankName; Null bankName;
Null? accountNumber; Null accountNumber;
bool? isActive; bool? isActive;
Null? createdBy; Null createdBy;
Null? modifiedBy; Null modifiedBy;
String? createdAt; String? createdAt;
String? updatedAt; String? updatedAt;
Null? deletedAt; Null deletedAt;
Sponsor( Sponsor(
{this.id, {this.id,
@@ -277,22 +273,22 @@ class Sponsor {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = this.id; data['id'] = id;
data['sponsorName'] = this.sponsorName; data['sponsorName'] = sponsorName;
data['sponsorNameArabic'] = this.sponsorNameArabic; data['sponsorNameArabic'] = sponsorNameArabic;
data['email'] = this.email; data['email'] = email;
data['profile'] = this.profile; data['profile'] = profile;
data['address'] = this.address; data['address'] = address;
data['mobileNo'] = this.mobileNo; data['mobileNo'] = mobileNo;
data['bankName'] = this.bankName; data['bankName'] = bankName;
data['accountNumber'] = this.accountNumber; data['accountNumber'] = accountNumber;
data['isActive'] = this.isActive; data['isActive'] = isActive;
data['createdBy'] = this.createdBy; data['createdBy'] = createdBy;
data['modifiedBy'] = this.modifiedBy; data['modifiedBy'] = modifiedBy;
data['createdAt'] = this.createdAt; data['createdAt'] = createdAt;
data['updatedAt'] = this.updatedAt; data['updatedAt'] = updatedAt;
data['deletedAt'] = this.deletedAt; data['deletedAt'] = deletedAt;
return data; return data;
} }
} }
@@ -303,11 +299,11 @@ class IoStatus {
String? statusInvest; String? statusInvest;
String? statusPortfolio; String? statusPortfolio;
bool? isActive; bool? isActive;
Null? createdBy; Null createdBy;
Null? modifiedBy; Null modifiedBy;
String? createdAt; String? createdAt;
String? updatedAt; String? updatedAt;
Null? deletedAt; Null deletedAt;
IoStatus( IoStatus(
{this.id, {this.id,
@@ -335,17 +331,17 @@ class IoStatus {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = this.id; data['id'] = id;
data['statusAdmin'] = this.statusAdmin; data['statusAdmin'] = statusAdmin;
data['statusInvest'] = this.statusInvest; data['statusInvest'] = statusInvest;
data['statusPortfolio'] = this.statusPortfolio; data['statusPortfolio'] = statusPortfolio;
data['isActive'] = this.isActive; data['isActive'] = isActive;
data['createdBy'] = this.createdBy; data['createdBy'] = createdBy;
data['modifiedBy'] = this.modifiedBy; data['modifiedBy'] = modifiedBy;
data['createdAt'] = this.createdAt; data['createdAt'] = createdAt;
data['updatedAt'] = this.updatedAt; data['updatedAt'] = updatedAt;
data['deletedAt'] = this.deletedAt; data['deletedAt'] = deletedAt;
return data; return data;
} }
} }
@@ -357,11 +353,11 @@ class InvestmentType {
String? note; String? note;
String? noteArabic; String? noteArabic;
bool? isActive; bool? isActive;
Null? createdBy; Null createdBy;
Null? modifiedBy; Null modifiedBy;
String? createdAt; String? createdAt;
String? updatedAt; String? updatedAt;
Null? deletedAt; Null deletedAt;
InvestmentType( InvestmentType(
{this.id, {this.id,
@@ -391,18 +387,193 @@ class InvestmentType {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = this.id; data['id'] = id;
data['investmentTypeName'] = this.investmentTypeName; data['investmentTypeName'] = investmentTypeName;
data['investmentTypeNameArabic'] = this.investmentTypeNameArabic; data['investmentTypeNameArabic'] = investmentTypeNameArabic;
data['note'] = this.note; data['note'] = note;
data['noteArabic'] = this.noteArabic; data['noteArabic'] = noteArabic;
data['isActive'] = this.isActive; data['isActive'] = isActive;
data['createdBy'] = this.createdBy; data['createdBy'] = createdBy;
data['modifiedBy'] = this.modifiedBy; data['modifiedBy'] = modifiedBy;
data['createdAt'] = this.createdAt; data['createdAt'] = createdAt;
data['updatedAt'] = this.updatedAt; data['updatedAt'] = updatedAt;
data['deletedAt'] = this.deletedAt; data['deletedAt'] = deletedAt;
return data;
}
}
class Documents {
int? id;
int? ioXid;
String? documentType;
String? documentName;
String? documentPath;
int? displayOrder;
bool? isActive;
Null createdBy;
Null modifiedBy;
String? createdAt;
String? updatedAt;
Null deletedAt;
Documents(
{this.id,
this.ioXid,
this.documentType,
this.documentName,
this.documentPath,
this.displayOrder,
this.isActive,
this.createdBy,
this.modifiedBy,
this.createdAt,
this.updatedAt,
this.deletedAt});
Documents.fromJson(Map<String, dynamic> json) {
id = json['id'];
ioXid = json['io_xid'];
documentType = json['documentType'];
documentName = json['documentName'];
documentPath = json['documentPath'];
displayOrder = json['displayOrder'];
isActive = json['isActive'];
createdBy = json['createdBy'];
modifiedBy = json['modifiedBy'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
deletedAt = json['deletedAt'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['io_xid'] = ioXid;
data['documentType'] = documentType;
data['documentName'] = documentName;
data['documentPath'] = documentPath;
data['displayOrder'] = displayOrder;
data['isActive'] = isActive;
data['createdBy'] = createdBy;
data['modifiedBy'] = modifiedBy;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['deletedAt'] = deletedAt;
return data;
}
}
class ArtifactsVideo {
int? id;
int? ioXid;
String? artifactName;
String? artifactStreamingURL;
int? displayOrder;
bool? isActive;
Null createdBy;
Null modifiedBy;
String? createdAt;
String? updatedAt;
Null deletedAt;
ArtifactsVideo(
{this.id,
this.ioXid,
this.artifactName,
this.artifactStreamingURL,
this.displayOrder,
this.isActive,
this.createdBy,
this.modifiedBy,
this.createdAt,
this.updatedAt,
this.deletedAt});
ArtifactsVideo.fromJson(Map<String, dynamic> json) {
id = json['id'];
ioXid = json['io_xid'];
artifactName = json['artifactName'];
artifactStreamingURL = json['artifactStreamingURL'];
displayOrder = json['displayOrder'];
isActive = json['isActive'];
createdBy = json['createdBy'];
modifiedBy = json['modifiedBy'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
deletedAt = json['deletedAt'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['io_xid'] = ioXid;
data['artifactName'] = artifactName;
data['artifactStreamingURL'] = artifactStreamingURL;
data['displayOrder'] = displayOrder;
data['isActive'] = isActive;
data['createdBy'] = createdBy;
data['modifiedBy'] = modifiedBy;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['deletedAt'] = deletedAt;
return data;
}
}
class ArtifactsImage {
int? id;
int? ioXid;
String? artifactName;
String? artifactPathName;
int? displayOrder;
bool? isActive;
Null createdBy;
Null modifiedBy;
String? createdAt;
String? updatedAt;
Null deletedAt;
ArtifactsImage(
{this.id,
this.ioXid,
this.artifactName,
this.artifactPathName,
this.displayOrder,
this.isActive,
this.createdBy,
this.modifiedBy,
this.createdAt,
this.updatedAt,
this.deletedAt});
ArtifactsImage.fromJson(Map<String, dynamic> json) {
id = json['id'];
ioXid = json['io_xid'];
artifactName = json['artifactName'];
artifactPathName = json['artifactPathName'];
displayOrder = json['displayOrder'];
isActive = json['isActive'];
createdBy = json['createdBy'];
modifiedBy = json['modifiedBy'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
deletedAt = json['deletedAt'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['io_xid'] = ioXid;
data['artifactName'] = artifactName;
data['artifactPathName'] = artifactPathName;
data['displayOrder'] = displayOrder;
data['isActive'] = isActive;
data['createdBy'] = createdBy;
data['modifiedBy'] = modifiedBy;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['deletedAt'] = deletedAt;
return data; return data;
} }
} }
@@ -414,11 +585,11 @@ class MinInvestmentAmt {
String? minInvestmentAmt; String? minInvestmentAmt;
String? maxInvestmentAmt; String? maxInvestmentAmt;
bool? isActive; bool? isActive;
Null? createdBy; Null createdBy;
Null? modifiedBy; Null modifiedBy;
String? createdAt; String? createdAt;
String? updatedAt; String? updatedAt;
Null? deletedAt; Null deletedAt;
MinInvestmentAmt( MinInvestmentAmt(
{this.id, {this.id,
@@ -448,18 +619,142 @@ class MinInvestmentAmt {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = this.id; data['id'] = id;
data['io_xid'] = this.ioXid; data['io_xid'] = ioXid;
data['country_xid'] = this.countryXid; data['country_xid'] = countryXid;
data['minInvestmentAmt'] = this.minInvestmentAmt; data['minInvestmentAmt'] = minInvestmentAmt;
data['maxInvestmentAmt'] = this.maxInvestmentAmt; data['maxInvestmentAmt'] = maxInvestmentAmt;
data['isActive'] = this.isActive; data['isActive'] = isActive;
data['createdBy'] = this.createdBy; data['createdBy'] = createdBy;
data['modifiedBy'] = this.modifiedBy; data['modifiedBy'] = modifiedBy;
data['createdAt'] = this.createdAt; data['createdAt'] = createdAt;
data['updatedAt'] = this.updatedAt; data['updatedAt'] = updatedAt;
data['deletedAt'] = this.deletedAt; data['deletedAt'] = deletedAt;
return data;
}
}
class KeyMerits {
int? id;
int? ioXid;
int? iconXid;
String? meritsHeader;
String? meritsHeaderArabic;
String? meritsDescription;
String? meritsDescriptionArabic;
int? displayOrder;
bool? isActive;
Null createdBy;
Null modifiedBy;
String? createdAt;
String? updatedAt;
Null deletedAt;
Icon? icon;
KeyMerits(
{this.id,
this.ioXid,
this.iconXid,
this.meritsHeader,
this.meritsHeaderArabic,
this.meritsDescription,
this.meritsDescriptionArabic,
this.displayOrder,
this.isActive,
this.createdBy,
this.modifiedBy,
this.createdAt,
this.updatedAt,
this.deletedAt,
this.icon});
KeyMerits.fromJson(Map<String, dynamic> json) {
id = json['id'];
ioXid = json['io_xid'];
iconXid = json['icon_xid'];
meritsHeader = json['meritsHeader'];
meritsHeaderArabic = json['meritsHeaderArabic'];
meritsDescription = json['meritsDescription'];
meritsDescriptionArabic = json['meritsDescriptionArabic'];
displayOrder = json['displayOrder'];
isActive = json['isActive'];
createdBy = json['createdBy'];
modifiedBy = json['modifiedBy'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
deletedAt = json['deletedAt'];
icon = json['icon'] != null ? Icon.fromJson(json['icon']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['io_xid'] = ioXid;
data['icon_xid'] = iconXid;
data['meritsHeader'] = meritsHeader;
data['meritsHeaderArabic'] = meritsHeaderArabic;
data['meritsDescription'] = meritsDescription;
data['meritsDescriptionArabic'] = meritsDescriptionArabic;
data['displayOrder'] = displayOrder;
data['isActive'] = isActive;
data['createdBy'] = createdBy;
data['modifiedBy'] = modifiedBy;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['deletedAt'] = deletedAt;
if (icon != null) {
data['icon'] = icon!.toJson();
}
return data;
}
}
class Icon {
int? id;
String? iconName;
String? iconFilePath;
bool? isActive;
Null createdBy;
Null modifiedBy;
String? createdAt;
String? updatedAt;
Null deletedAt;
Icon(
{this.id,
this.iconName,
this.iconFilePath,
this.isActive,
this.createdBy,
this.modifiedBy,
this.createdAt,
this.updatedAt,
this.deletedAt});
Icon.fromJson(Map<String, dynamic> json) {
id = json['id'];
iconName = json['iconName'];
iconFilePath = json['iconFilePath'];
isActive = json['isActive'];
createdBy = json['createdBy'];
modifiedBy = json['modifiedBy'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
deletedAt = json['deletedAt'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['iconName'] = iconName;
data['iconFilePath'] = iconFilePath;
data['isActive'] = isActive;
data['createdBy'] = createdBy;
data['modifiedBy'] = modifiedBy;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['deletedAt'] = deletedAt;
return data; return data;
} }
} }

View File

@@ -61,15 +61,22 @@ class InvestDetailsLayout extends StatelessWidget {
Gap( Gap(
20.h, 20.h,
), ),
const KeyInvestmentSection(), KeyInvestmentSection(
keyMerits: state.detailIOModel.data!.keyMerits!,
),
type == "closed" ? const SizedBox() : Gap(20.h), type == "closed" ? const SizedBox() : Gap(20.h),
type == "closed" type == "closed"
? const SizedBox() ? const SizedBox()
: const InvestIncludedDocumentsSection(), : InvestIncludedDocumentsSection(
documentsList: state.detailIOModel.data!.documents!,
),
type == "closed" ? const SizedBox() : Gap(20.h), type == "closed" ? const SizedBox() : Gap(20.h),
type == "closed" type == "closed"
? const SizedBox() ? const SizedBox()
: const InvestVideoSection(), : InvestVideoSection(
artifactsVideoList:
state.detailIOModel.data!.artifactsVideo!,
),
], ],
), ),
), ),

View File

@@ -5,6 +5,7 @@ import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/core/utils/date_time_formatter/date_time_formatter.dart'; import 'package:tanami_app/core/utils/date_time_formatter/date_time_formatter.dart';
import 'package:tanami_app/features/MainScreens/Invest/domain/model/detail_io_model.dart'; import 'package:tanami_app/features/MainScreens/Invest/domain/model/detail_io_model.dart';
import '../../../../../Globalconst.dart';
import '../../../../../core/styles/app_text.dart'; import '../../../../../core/styles/app_text.dart';
import '../../../../../core/utils/language/localizations_delegate.dart'; import '../../../../../core/utils/language/localizations_delegate.dart';
import '../../../../../shared/components/text_widget.dart'; import '../../../../../shared/components/text_widget.dart';
@@ -28,7 +29,9 @@ class InvestDetailDetailsSection extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
TextWidget().text17W700( TextWidget().text17W700(
detailIOModel.data!.investmentNameEnglish!, Globalconst.languageSelected == "ar"
? detailIOModel.data!.investmentNameArabic!
: detailIOModel.data!.investmentNameEnglish!,
clr: AppColor.plainBlack, clr: AppColor.plainBlack,
), ),
Gap( Gap(
@@ -64,7 +67,9 @@ class InvestDetailDetailsSection extends StatelessWidget {
clr: AppColor.portoflioCardTextColor), clr: AppColor.portoflioCardTextColor),
type == "closed" ? const SizedBox() : const Gap(8.0), type == "closed" ? const SizedBox() : const Gap(8.0),
TextWidget().text14W400( TextWidget().text14W400(
detailIOModel.data!.descriptionEnglish!, Globalconst.languageSelected == "ar"
? detailIOModel.data!.descriptionArabic!
: detailIOModel.data!.descriptionEnglish!,
clr: Colors.grey, clr: Colors.grey,
txtAlign: TextAlign.start, txtAlign: TextAlign.start,
) )
@@ -98,7 +103,9 @@ class InvestDetailDetailsSection extends StatelessWidget {
), ),
), ),
TextWidget().text14W700( TextWidget().text14W700(
detailIOModel.data!.sponsor!.sponsorName!, Globalconst.languageSelected == "ar"
? detailIOModel.data!.sponsor!.sponsorNameArabic!
: detailIOModel.data!.sponsor!.sponsorName!,
clr: AppColor.plainBlack, clr: AppColor.plainBlack,
txtAlign: TextAlign.end, txtAlign: TextAlign.end,
) )

View File

@@ -9,20 +9,13 @@ import 'package:tanami_app/core/utils/date_time_formatter/date_time_formatter.da
import '../../../../../core/styles/app_images.dart'; import '../../../../../core/styles/app_images.dart';
import '../../../../../core/styles/app_text.dart'; import '../../../../../core/styles/app_text.dart';
import '../../../../../core/utils/language/localizations_delegate.dart'; import '../../../../../core/utils/language/localizations_delegate.dart';
import '../../../../../shared/api/api_endpoints.dart';
import '../../../../../shared/components/text_widget.dart'; import '../../../../../shared/components/text_widget.dart';
import '../../../Portfolio/presentation/bloc/carousel/carousel_bloc.dart'; import '../../../Portfolio/presentation/bloc/carousel/carousel_bloc.dart';
import '../../../Portfolio/presentation/bloc/carousel/carousel_event.dart'; import '../../../Portfolio/presentation/bloc/carousel/carousel_event.dart';
import '../../../Portfolio/presentation/bloc/carousel/carousel_state.dart'; import '../../../Portfolio/presentation/bloc/carousel/carousel_state.dart';
import '../../domain/model/detail_io_model.dart'; import '../../domain/model/detail_io_model.dart';
final List imgList = [
{'id': 1, 'img_path': 'assets/images/portfolio_screen/detailsbg.png'},
{'id': 2, 'img_path': 'assets/images/portfolio_screen/detailsbg.png'},
{'id': 3, 'img_path': 'assets/images/portfolio_screen/detailsbg.png'},
{'id': 4, 'img_path': 'assets/images/portfolio_screen/detailsbg.png'},
{'id': 5, 'img_path': 'assets/images/portfolio_screen/detailsbg.png'},
];
class InvestDetailCarouselView extends StatelessWidget { class InvestDetailCarouselView extends StatelessWidget {
final String type; final String type;
@@ -53,10 +46,10 @@ class InvestDetailCarouselView extends StatelessWidget {
topRight: Radius.circular(20.0), topRight: Radius.circular(20.0),
), ),
child: CarouselSlider( child: CarouselSlider(
items: imgList items: detailIOModel.data!.artifactsImage!
.map( .map(
(item) => Image.asset( (item) => Image.network(
item['img_path'], "${ApiEndpoints.base}${item.artifactPathName!}",
fit: BoxFit.cover, fit: BoxFit.cover,
width: double.infinity, width: double.infinity,
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
@@ -86,7 +79,10 @@ class InvestDetailCarouselView extends StatelessWidget {
} }
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: imgList.asMap().entries.map((entry) { children: detailIOModel.data!.artifactsImage!
.asMap()
.entries
.map((entry) {
return GestureDetector( return GestureDetector(
onTap: () => _controller.animateToPage(entry.key), onTap: () => _controller.animateToPage(entry.key),
child: Container( child: Container(

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gap/gap.dart'; import 'package:gap/gap.dart';
import 'package:tanami_app/Globalconst.dart';
import 'package:tanami_app/core/styles/app_color.dart'; import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/core/utils/date_time_formatter/date_time_formatter.dart'; import 'package:tanami_app/core/utils/date_time_formatter/date_time_formatter.dart';
import 'package:tanami_app/features/MainScreens/Invest/domain/model/available_io_model.dart'; import 'package:tanami_app/features/MainScreens/Invest/domain/model/available_io_model.dart';
@@ -34,9 +35,14 @@ class InvestDetailsSection extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
TextWidget().text17W700( SizedBox(
availableIOModel.investmentNameEnglish!, width: 0.6.sw,
clr: AppColor.plainBlack, child: TextWidget().text17W700(
Globalconst.languageSelected == "ar"
? availableIOModel.investmentNameArabic!
: availableIOModel.investmentNameEnglish!,
clr: AppColor.plainBlack,
txtAlign: TextAlign.start),
), ),
Container( Container(
height: 28, height: 28,
@@ -108,7 +114,9 @@ class InvestDetailsSection extends StatelessWidget {
clr: AppColor.portoflioCardTextColor), clr: AppColor.portoflioCardTextColor),
const Gap(8.0), const Gap(8.0),
TextWidget().text14W400( TextWidget().text14W400(
availableIOModel.descriptionEnglish!, Globalconst.languageSelected == "ar"
? availableIOModel.descriptionArabic!
: availableIOModel.descriptionEnglish!,
clr: Colors.grey, clr: Colors.grey,
txtAlign: TextAlign.start, txtAlign: TextAlign.start,
maxLine: 2, maxLine: 2,
@@ -141,7 +149,9 @@ class InvestDetailsSection extends StatelessWidget {
), ),
), ),
TextWidget().text14W700( TextWidget().text14W700(
availableIOModel.sponsor!.sponsorName ?? "", Globalconst.languageSelected == "ar"
? availableIOModel.sponsor!.sponsorNameArabic!
: availableIOModel.sponsor!.sponsorName ?? "",
clr: AppColor.plainBlack, clr: AppColor.plainBlack,
txtAlign: TextAlign.end, txtAlign: TextAlign.end,
) )

View File

@@ -5,13 +5,17 @@ import 'package:tanami_app/core/routes/route_name.dart';
import 'package:tanami_app/core/routes/routes.dart'; import 'package:tanami_app/core/routes/routes.dart';
import 'package:tanami_app/core/styles/app_color.dart'; import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/core/styles/app_images.dart'; import 'package:tanami_app/core/styles/app_images.dart';
import 'package:tanami_app/shared/api/api_endpoints.dart';
import 'package:tanami_app/shared/components/text_widget.dart'; import 'package:tanami_app/shared/components/text_widget.dart';
import '../../../../../core/styles/app_text.dart'; import '../../../../../core/styles/app_text.dart';
import '../../../../../core/utils/language/localizations_delegate.dart'; import '../../../../../core/utils/language/localizations_delegate.dart';
import '../../domain/model/detail_io_model.dart';
class InvestIncludedDocumentsSection extends StatelessWidget { class InvestIncludedDocumentsSection extends StatelessWidget {
const InvestIncludedDocumentsSection({super.key}); final List<Documents> documentsList;
const InvestIncludedDocumentsSection(
{super.key, required this.documentsList});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -50,7 +54,7 @@ class InvestIncludedDocumentsSection extends StatelessWidget {
crossAxisSpacing: 10.w, crossAxisSpacing: 10.w,
crossAxisCount: 2, // Number of columns crossAxisCount: 2, // Number of columns
children: List.generate( children: List.generate(
6, documentsList.length,
(index) { (index) {
return Center( return Center(
child: InkWell( child: InkWell(
@@ -59,8 +63,8 @@ class InvestIncludedDocumentsSection extends StatelessWidget {
goRouter.pushNamed(RouteName.pdfReaderScreen, goRouter.pushNamed(RouteName.pdfReaderScreen,
pathParameters: { pathParameters: {
"pdfUrl": "pdfUrl":
"https://dn790007.ca.archive.org/0/items/atomic-habits-pdfdrive/Atomic%20habits%20%28%20PDFDrive%20%29.pdf", "${ApiEndpoints.base}${documentsList[index].documentPath}",
"title": "Test" "title": documentsList[index].documentName!,
}); });
}, },
child: Container( child: Container(
@@ -80,7 +84,8 @@ class InvestIncludedDocumentsSection extends StatelessWidget {
Gap( Gap(
7.w, 7.w,
), ),
TextWidget().text12W700("Filename.pdf", TextWidget().text12W700(
documentsList[index].documentName!,
clr: AppColor.plainBlack), clr: AppColor.plainBlack),
], ],
), ),
@@ -93,8 +98,8 @@ class InvestIncludedDocumentsSection extends StatelessWidget {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
TextWidget().text12W700("512 Mb", // TextWidget().text12W700("512 Mb",
clr: AppColor.portoflioCardTextColor), // clr: AppColor.portoflioCardTextColor),
Gap( Gap(
7.w, 7.w,
), ),

View File

@@ -7,9 +7,11 @@ import 'package:tanami_app/core/styles/app_images.dart';
import '../../../../../core/styles/app_text.dart'; import '../../../../../core/styles/app_text.dart';
import '../../../../../core/utils/language/localizations_delegate.dart'; import '../../../../../core/utils/language/localizations_delegate.dart';
import '../../domain/model/detail_io_model.dart';
class InvestVideoSection extends StatelessWidget { class InvestVideoSection extends StatelessWidget {
const InvestVideoSection({super.key}); List<ArtifactsVideo> artifactsVideoList;
InvestVideoSection({super.key, required this.artifactsVideoList});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -46,12 +48,14 @@ class InvestVideoSection extends StatelessWidget {
ListView.builder( ListView.builder(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemCount: videos.length, itemCount: artifactsVideoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
goRouter.pushNamed(RouteName.vimeoScreen, goRouter.pushNamed(RouteName.vimeoScreen, pathParameters: {
pathParameters: {"videoUrl": "989972367"}); "videoUrl":
artifactsVideoList[index].artifactStreamingURL!
});
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.only(bottom: 18.0), padding: const EdgeInsets.only(bottom: 18.0),
@@ -62,7 +66,7 @@ class InvestVideoSection extends StatelessWidget {
child: Stack( child: Stack(
children: [ children: [
Image.asset( Image.asset(
videos[index], "assets/images/academy_screen/vd_bg.jpg",
fit: BoxFit.cover, fit: BoxFit.cover,
height: 160.h, height: 160.h,
width: 1.sw, width: 1.sw,
@@ -91,7 +95,3 @@ class InvestVideoSection extends StatelessWidget {
); );
} }
} }
List videos = [
'assets/images/academy_screen/vd_bg.jpg',
];

View File

@@ -2,15 +2,19 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:gap/gap.dart'; import 'package:gap/gap.dart';
import 'package:tanami_app/Globalconst.dart';
import 'package:tanami_app/core/styles/app_color.dart'; import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/core/styles/app_images.dart'; import 'package:tanami_app/core/styles/app_images.dart';
import 'package:tanami_app/shared/api/api_endpoints.dart';
import 'package:tanami_app/shared/components/text_widget.dart'; import 'package:tanami_app/shared/components/text_widget.dart';
import '../../../../../core/styles/app_text.dart'; import '../../../../../core/styles/app_text.dart';
import '../../../../../core/utils/language/localizations_delegate.dart'; import '../../../../../core/utils/language/localizations_delegate.dart';
import '../../domain/model/detail_io_model.dart';
class KeyInvestmentSection extends StatelessWidget { class KeyInvestmentSection extends StatelessWidget {
const KeyInvestmentSection({super.key}); final List<KeyMerits> keyMerits;
const KeyInvestmentSection({super.key, required this.keyMerits});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -43,7 +47,7 @@ class KeyInvestmentSection extends StatelessWidget {
16.h, 16.h,
), ),
ListView.builder( ListView.builder(
itemCount: 4, itemCount: keyMerits.length,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (ctx, index) { itemBuilder: (ctx, index) {
@@ -52,9 +56,13 @@ class KeyInvestmentSection extends StatelessWidget {
bottom: 12, bottom: 12,
), ),
child: investmentSectionCardText( child: investmentSectionCardText(
imageList[index], "${ApiEndpoints.base}${keyMerits[index].icon!.iconFilePath}",
"Nunc vulputate libero et velit interdumb aenfoao", Globalconst.languageSelected == "ar"
"ac aliquet odio mattis.", ? keyMerits[index].meritsHeaderArabic!
: keyMerits[index].meritsHeader!,
Globalconst.languageSelected == "ar"
? keyMerits[index].meritsDescriptionArabic!
: keyMerits[index].meritsDescription!,
), ),
); );
}) })
@@ -80,7 +88,7 @@ Widget investmentSectionCardText(
return Row( return Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SvgPicture.asset(icon), SvgPicture.network(icon),
const Gap(8), const Gap(8),
Expanded( Expanded(
child: Column( child: Column(

View File

@@ -11,6 +11,8 @@ import 'package:tanami_app/shared/components/text_widget.dart';
import '../../../../../core/utils/language/localizations_delegate.dart'; import '../../../../../core/utils/language/localizations_delegate.dart';
import '../../../../../shared/components/toggle_widget.dart'; import '../../../../../shared/components/toggle_widget.dart';
import '../../../../languageChange/presentation/bloc/text_bloc/text_bloc.dart';
import '../../../../languageChange/presentation/bloc/text_bloc/text_state.dart';
import 'settings_list_tile_item.dart'; import 'settings_list_tile_item.dart';
class GeneralSettingsSection extends StatelessWidget { class GeneralSettingsSection extends StatelessWidget {
@@ -59,17 +61,16 @@ class GeneralSettingsSection extends StatelessWidget {
], ],
), ),
const Gap(12), const Gap(12),
SettingsListItem( BlocBuilder<TextLanguageBloc, TextState>(builder: (context, state) {
onTapFunc: () { return SettingsListItem(
goRouter.pushNamed(RouteName.languageChangeScreen); onTapFunc: () {
}, goRouter.pushNamed(RouteName.languageChangeScreen);
icon: AppImages.languageIcon, },
title: localizations.translate(AppText.languageText), icon: AppImages.languageIcon,
trailing: "English", title: localizations.translate(AppText.languageText),
// Globalconst.languageSelected == "en" trailing: state.text,
// ? "English" );
// : "اللغة العربية", }),
),
const Gap(10), const Gap(10),
const Divider( const Divider(
color: AppColor.academyCardTextColor, color: AppColor.academyCardTextColor,
@@ -79,3 +80,6 @@ class GeneralSettingsSection extends StatelessWidget {
); );
} }
} }
// Globalconst.languageSelected == "en"
// ? "English"
// ,

View File

@@ -0,0 +1,15 @@
// text_bloc.dart
import 'package:flutter_bloc/flutter_bloc.dart';
import 'text_event.dart';
import 'text_state.dart';
class TextLanguageBloc extends Bloc<TextEvent, TextState> {
TextLanguageBloc() : super(const TextState()) {
on<ButtonPressed>(_onButtonPressed);
}
void _onButtonPressed(ButtonPressed event, Emitter<TextState> emit) {
emit(TextState(text: event.newText));
}
}

View File

@@ -0,0 +1,18 @@
// text_event.dart
import 'package:equatable/equatable.dart';
abstract class TextEvent extends Equatable {
const TextEvent();
@override
List<Object> get props => [];
}
class ButtonPressed extends TextEvent {
final String newText;
const ButtonPressed(this.newText);
@override
List<Object> get props => [newText];
}

View File

@@ -0,0 +1,11 @@
// text_state.dart
import 'package:equatable/equatable.dart';
class TextState extends Equatable {
final String text;
const TextState({this.text = 'English'});
@override
List<Object> get props => [text];
}

View File

@@ -16,6 +16,8 @@ import '../../../../shared/components/bloc/language/lng_event.dart';
import '../../../../shared/components/button_widget.dart'; import '../../../../shared/components/button_widget.dart';
import '../../../../shared/components/text_widget.dart'; import '../../../../shared/components/text_widget.dart';
import '../bloc/choose_language_bloc.dart'; import '../bloc/choose_language_bloc.dart';
import '../bloc/text_bloc/text_bloc.dart';
import '../bloc/text_bloc/text_event.dart';
Widget bottomSection(BuildContext context) { Widget bottomSection(BuildContext context) {
var localizations = AppLocalizations.of(context); var localizations = AppLocalizations.of(context);
@@ -47,9 +49,15 @@ Widget bottomSection(BuildContext context) {
.read<LocalizationBloc>() .read<LocalizationBloc>()
.add(ChangeLanguage(newLocale)); .add(ChangeLanguage(newLocale));
if (radioBloc.selectedCountry == 1) { if (radioBloc.selectedCountry == 1) {
context
.read<TextLanguageBloc>()
.add(const ButtonPressed("اللغة العربية"));
await secureStorageService.write('languageSelected', "ar"); await secureStorageService.write('languageSelected', "ar");
Globalconst.languageSelected = "ar"; Globalconst.languageSelected = "ar";
} else { } else {
context
.read<TextLanguageBloc>()
.add(const ButtonPressed("English"));
await secureStorageService.write('languageSelected', "en"); await secureStorageService.write('languageSelected', "en");
Globalconst.languageSelected = "en"; Globalconst.languageSelected = "en";
} }

View File

@@ -6,6 +6,8 @@ import 'package:tanami_app/core/routes/routes.dart';
import '../../../../core/styles/app_color.dart'; import '../../../../core/styles/app_color.dart';
import '../../../../core/utils/secure/secure_storage_service.dart'; import '../../../../core/utils/secure/secure_storage_service.dart';
import '../../../languageChange/presentation/bloc/text_bloc/text_bloc.dart';
import '../../../languageChange/presentation/bloc/text_bloc/text_event.dart';
import '../bloc/app_version/app_version_bloc.dart'; import '../bloc/app_version/app_version_bloc.dart';
import '../bloc/app_version/app_version_event.dart'; import '../bloc/app_version/app_version_event.dart';
import '../bloc/splash/splash_bloc.dart'; import '../bloc/splash/splash_bloc.dart';
@@ -39,6 +41,10 @@ class SplashScreen extends StatelessWidget {
listener: (context, state) async { listener: (context, state) async {
// Check if the current state is SplashCompleted // Check if the current state is SplashCompleted
if (state is SplashCompleted) { if (state is SplashCompleted) {
String? languageSelected =
await secureStorageService.read('languageSelected');
context.read<TextLanguageBloc>().add(ButtonPressed(
languageSelected == "en" ? "English" : "اللغة العربية"));
if (await secureStorageService.read('isLoginedIn') == null) { if (await secureStorageService.read('isLoginedIn') == null) {
goRouter.goNamed(RouteName.welcomeScreen); goRouter.goNamed(RouteName.welcomeScreen);
} else { } else {

View File

@@ -16,6 +16,7 @@ import 'features/biometric/bloc/biometric_event.dart';
import 'features/countrySelection/bloc/GetCountry/get_country_bloc.dart'; import 'features/countrySelection/bloc/GetCountry/get_country_bloc.dart';
import 'features/countrySelection/bloc/choose_country_bloc.dart'; import 'features/countrySelection/bloc/choose_country_bloc.dart';
import 'features/forgotPassword/presentation/bloc/restore_password_phone_verification_bloc.dart'; import 'features/forgotPassword/presentation/bloc/restore_password_phone_verification_bloc.dart';
import 'features/languageChange/presentation/bloc/text_bloc/text_bloc.dart';
import 'features/otpVerification/bloc/otp_bloc.dart'; import 'features/otpVerification/bloc/otp_bloc.dart';
import 'features/register/presentation/bloc/register_bloc.dart'; import 'features/register/presentation/bloc/register_bloc.dart';
import 'shared/components/bloc/bottom_nav_bar/bottom_navigation_bloc.dart'; import 'shared/components/bloc/bottom_nav_bar/bottom_navigation_bloc.dart';
@@ -126,6 +127,9 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
create: (_) => RestorePasswordPhoneVerificationBloc( create: (_) => RestorePasswordPhoneVerificationBloc(
secureStorageService: secureStorageService), secureStorageService: secureStorageService),
), ),
BlocProvider(
create: (_) => TextLanguageBloc(),
)
], ],
child: ScreenUtilInit( child: ScreenUtilInit(
builder: (BuildContext context, Widget? child) => builder: (BuildContext context, Widget? child) =>

View File

@@ -255,10 +255,11 @@ class TextWidget {
String text, { String text, {
Color? clr, Color? clr,
TextDecoration? textDecoration, TextDecoration? textDecoration,
TextAlign? txtAlign,
}) { }) {
return Text( return Text(
text, text,
textAlign: TextAlign.center, textAlign: txtAlign ?? TextAlign.center,
style: GoogleFonts.dmSans( style: GoogleFonts.dmSans(
fontSize: 17.sp, fontSize: 17.sp,
decorationColor: AppColor.hintTextColor, decorationColor: AppColor.hintTextColor,