Merge pull request #139 from WDI-Ideas/jayeshjain25

Jayeshjain25
This commit is contained in:
Jayesh jain
2024-07-26 12:06:00 +05:30
committed by GitHub
17 changed files with 788 additions and 395 deletions

View File

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

View File

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

View File

@@ -61,15 +61,22 @@ class InvestDetailsLayout extends StatelessWidget {
Gap(
20.h,
),
const KeyInvestmentSection(),
KeyInvestmentSection(
keyMerits: state.detailIOModel.data!.keyMerits!,
),
type == "closed" ? const SizedBox() : Gap(20.h),
type == "closed"
? const SizedBox()
: const InvestIncludedDocumentsSection(),
: InvestIncludedDocumentsSection(
documentsList: state.detailIOModel.data!.documents!,
),
type == "closed" ? const SizedBox() : Gap(20.h),
type == "closed"
? 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/features/MainScreens/Invest/domain/model/detail_io_model.dart';
import '../../../../../Globalconst.dart';
import '../../../../../core/styles/app_text.dart';
import '../../../../../core/utils/language/localizations_delegate.dart';
import '../../../../../shared/components/text_widget.dart';
@@ -28,7 +29,9 @@ class InvestDetailDetailsSection extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget().text17W700(
detailIOModel.data!.investmentNameEnglish!,
Globalconst.languageSelected == "ar"
? detailIOModel.data!.investmentNameArabic!
: detailIOModel.data!.investmentNameEnglish!,
clr: AppColor.plainBlack,
),
Gap(
@@ -64,7 +67,9 @@ class InvestDetailDetailsSection extends StatelessWidget {
clr: AppColor.portoflioCardTextColor),
type == "closed" ? const SizedBox() : const Gap(8.0),
TextWidget().text14W400(
detailIOModel.data!.descriptionEnglish!,
Globalconst.languageSelected == "ar"
? detailIOModel.data!.descriptionArabic!
: detailIOModel.data!.descriptionEnglish!,
clr: Colors.grey,
txtAlign: TextAlign.start,
)
@@ -98,7 +103,9 @@ class InvestDetailDetailsSection extends StatelessWidget {
),
),
TextWidget().text14W700(
detailIOModel.data!.sponsor!.sponsorName!,
Globalconst.languageSelected == "ar"
? detailIOModel.data!.sponsor!.sponsorNameArabic!
: detailIOModel.data!.sponsor!.sponsorName!,
clr: AppColor.plainBlack,
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_text.dart';
import '../../../../../core/utils/language/localizations_delegate.dart';
import '../../../../../shared/api/api_endpoints.dart';
import '../../../../../shared/components/text_widget.dart';
import '../../../Portfolio/presentation/bloc/carousel/carousel_bloc.dart';
import '../../../Portfolio/presentation/bloc/carousel/carousel_event.dart';
import '../../../Portfolio/presentation/bloc/carousel/carousel_state.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 {
final String type;
@@ -53,10 +46,10 @@ class InvestDetailCarouselView extends StatelessWidget {
topRight: Radius.circular(20.0),
),
child: CarouselSlider(
items: imgList
items: detailIOModel.data!.artifactsImage!
.map(
(item) => Image.asset(
item['img_path'],
(item) => Image.network(
"${ApiEndpoints.base}${item.artifactPathName!}",
fit: BoxFit.cover,
width: double.infinity,
alignment: Alignment.topCenter,
@@ -86,7 +79,10 @@ class InvestDetailCarouselView extends StatelessWidget {
}
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: imgList.asMap().entries.map((entry) {
children: detailIOModel.data!.artifactsImage!
.asMap()
.entries
.map((entry) {
return GestureDetector(
onTap: () => _controller.animateToPage(entry.key),
child: Container(

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.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/utils/date_time_formatter/date_time_formatter.dart';
import 'package:tanami_app/features/MainScreens/Invest/domain/model/available_io_model.dart';
@@ -34,9 +35,14 @@ class InvestDetailsSection extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextWidget().text17W700(
availableIOModel.investmentNameEnglish!,
clr: AppColor.plainBlack,
SizedBox(
width: 0.6.sw,
child: TextWidget().text17W700(
Globalconst.languageSelected == "ar"
? availableIOModel.investmentNameArabic!
: availableIOModel.investmentNameEnglish!,
clr: AppColor.plainBlack,
txtAlign: TextAlign.start),
),
Container(
height: 28,
@@ -108,7 +114,9 @@ class InvestDetailsSection extends StatelessWidget {
clr: AppColor.portoflioCardTextColor),
const Gap(8.0),
TextWidget().text14W400(
availableIOModel.descriptionEnglish!,
Globalconst.languageSelected == "ar"
? availableIOModel.descriptionArabic!
: availableIOModel.descriptionEnglish!,
clr: Colors.grey,
txtAlign: TextAlign.start,
maxLine: 2,
@@ -141,7 +149,9 @@ class InvestDetailsSection extends StatelessWidget {
),
),
TextWidget().text14W700(
availableIOModel.sponsor!.sponsorName ?? "",
Globalconst.languageSelected == "ar"
? availableIOModel.sponsor!.sponsorNameArabic!
: availableIOModel.sponsor!.sponsorName ?? "",
clr: AppColor.plainBlack,
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/styles/app_color.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 '../../../../../core/styles/app_text.dart';
import '../../../../../core/utils/language/localizations_delegate.dart';
import '../../domain/model/detail_io_model.dart';
class InvestIncludedDocumentsSection extends StatelessWidget {
const InvestIncludedDocumentsSection({super.key});
final List<Documents> documentsList;
const InvestIncludedDocumentsSection(
{super.key, required this.documentsList});
@override
Widget build(BuildContext context) {
@@ -50,7 +54,7 @@ class InvestIncludedDocumentsSection extends StatelessWidget {
crossAxisSpacing: 10.w,
crossAxisCount: 2, // Number of columns
children: List.generate(
6,
documentsList.length,
(index) {
return Center(
child: InkWell(
@@ -59,8 +63,8 @@ class InvestIncludedDocumentsSection extends StatelessWidget {
goRouter.pushNamed(RouteName.pdfReaderScreen,
pathParameters: {
"pdfUrl":
"https://dn790007.ca.archive.org/0/items/atomic-habits-pdfdrive/Atomic%20habits%20%28%20PDFDrive%20%29.pdf",
"title": "Test"
"${ApiEndpoints.base}${documentsList[index].documentPath}",
"title": documentsList[index].documentName!,
});
},
child: Container(
@@ -80,7 +84,8 @@ class InvestIncludedDocumentsSection extends StatelessWidget {
Gap(
7.w,
),
TextWidget().text12W700("Filename.pdf",
TextWidget().text12W700(
documentsList[index].documentName!,
clr: AppColor.plainBlack),
],
),
@@ -93,8 +98,8 @@ class InvestIncludedDocumentsSection extends StatelessWidget {
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
TextWidget().text12W700("512 Mb",
clr: AppColor.portoflioCardTextColor),
// TextWidget().text12W700("512 Mb",
// clr: AppColor.portoflioCardTextColor),
Gap(
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/utils/language/localizations_delegate.dart';
import '../../domain/model/detail_io_model.dart';
class InvestVideoSection extends StatelessWidget {
const InvestVideoSection({super.key});
List<ArtifactsVideo> artifactsVideoList;
InvestVideoSection({super.key, required this.artifactsVideoList});
@override
Widget build(BuildContext context) {
@@ -46,12 +48,14 @@ class InvestVideoSection extends StatelessWidget {
ListView.builder(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: videos.length,
itemCount: artifactsVideoList.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
goRouter.pushNamed(RouteName.vimeoScreen,
pathParameters: {"videoUrl": "989972367"});
goRouter.pushNamed(RouteName.vimeoScreen, pathParameters: {
"videoUrl":
artifactsVideoList[index].artifactStreamingURL!
});
},
child: Padding(
padding: const EdgeInsets.only(bottom: 18.0),
@@ -62,7 +66,7 @@ class InvestVideoSection extends StatelessWidget {
child: Stack(
children: [
Image.asset(
videos[index],
"assets/images/academy_screen/vd_bg.jpg",
fit: BoxFit.cover,
height: 160.h,
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_svg/flutter_svg.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_images.dart';
import 'package:tanami_app/shared/api/api_endpoints.dart';
import 'package:tanami_app/shared/components/text_widget.dart';
import '../../../../../core/styles/app_text.dart';
import '../../../../../core/utils/language/localizations_delegate.dart';
import '../../domain/model/detail_io_model.dart';
class KeyInvestmentSection extends StatelessWidget {
const KeyInvestmentSection({super.key});
final List<KeyMerits> keyMerits;
const KeyInvestmentSection({super.key, required this.keyMerits});
@override
Widget build(BuildContext context) {
@@ -43,7 +47,7 @@ class KeyInvestmentSection extends StatelessWidget {
16.h,
),
ListView.builder(
itemCount: 4,
itemCount: keyMerits.length,
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (ctx, index) {
@@ -52,9 +56,13 @@ class KeyInvestmentSection extends StatelessWidget {
bottom: 12,
),
child: investmentSectionCardText(
imageList[index],
"Nunc vulputate libero et velit interdumb aenfoao",
"ac aliquet odio mattis.",
"${ApiEndpoints.base}${keyMerits[index].icon!.iconFilePath}",
Globalconst.languageSelected == "ar"
? keyMerits[index].meritsHeaderArabic!
: keyMerits[index].meritsHeader!,
Globalconst.languageSelected == "ar"
? keyMerits[index].meritsDescriptionArabic!
: keyMerits[index].meritsDescription!,
),
);
})
@@ -80,7 +88,7 @@ Widget investmentSectionCardText(
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SvgPicture.asset(icon),
SvgPicture.network(icon),
const Gap(8),
Expanded(
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 '../../../../../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';
class GeneralSettingsSection extends StatelessWidget {
@@ -59,17 +61,16 @@ class GeneralSettingsSection extends StatelessWidget {
],
),
const Gap(12),
SettingsListItem(
onTapFunc: () {
goRouter.pushNamed(RouteName.languageChangeScreen);
},
icon: AppImages.languageIcon,
title: localizations.translate(AppText.languageText),
trailing: "English",
// Globalconst.languageSelected == "en"
// ? "English"
// : "اللغة العربية",
),
BlocBuilder<TextLanguageBloc, TextState>(builder: (context, state) {
return SettingsListItem(
onTapFunc: () {
goRouter.pushNamed(RouteName.languageChangeScreen);
},
icon: AppImages.languageIcon,
title: localizations.translate(AppText.languageText),
trailing: state.text,
);
}),
const Gap(10),
const Divider(
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/text_widget.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) {
var localizations = AppLocalizations.of(context);
@@ -47,9 +49,15 @@ Widget bottomSection(BuildContext context) {
.read<LocalizationBloc>()
.add(ChangeLanguage(newLocale));
if (radioBloc.selectedCountry == 1) {
context
.read<TextLanguageBloc>()
.add(const ButtonPressed("اللغة العربية"));
await secureStorageService.write('languageSelected', "ar");
Globalconst.languageSelected = "ar";
} else {
context
.read<TextLanguageBloc>()
.add(const ButtonPressed("English"));
await secureStorageService.write('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/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_event.dart';
import '../bloc/splash/splash_bloc.dart';
@@ -39,6 +41,10 @@ class SplashScreen extends StatelessWidget {
listener: (context, state) async {
// Check if the current 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) {
goRouter.goNamed(RouteName.welcomeScreen);
} 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/choose_country_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/register/presentation/bloc/register_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(
secureStorageService: secureStorageService),
),
BlocProvider(
create: (_) => TextLanguageBloc(),
)
],
child: ScreenUtilInit(
builder: (BuildContext context, Widget? child) =>

View File

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