Fix minor bugs on transactional items; added building structure transactional; change ui of property assessment and property appraisal
parent
5b1752b813
commit
a8f7fc8d7c
|
@ -18,11 +18,15 @@ class SignatoriesAdminBloc
|
|||
});
|
||||
on<AddSignatories>((event, emit) async {
|
||||
await SQLServices.instance.createSignatories(Signatories(
|
||||
id: event.id,
|
||||
signatoryId: event.signatoryId,
|
||||
firstname: event.firstname,
|
||||
middlename: event.middlename,
|
||||
lastname: event.lastname));
|
||||
id: event.id,
|
||||
signatoryId: event.signatoryId,
|
||||
firstname: event.firstname,
|
||||
middlename: event.middlename,
|
||||
lastname: event.lastname,
|
||||
designation: event.designation,
|
||||
// status: event.status
|
||||
// genCode: event.genCode
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,9 @@ class AddSignatories extends SignatoriesAdminEvent {
|
|||
final String firstname;
|
||||
final String middlename;
|
||||
final String lastname;
|
||||
final String genCode;
|
||||
final String designation;
|
||||
// final String status;
|
||||
|
||||
const AddSignatories({
|
||||
required this.id,
|
||||
|
@ -20,6 +23,9 @@ class AddSignatories extends SignatoriesAdminEvent {
|
|||
required this.firstname,
|
||||
required this.middlename,
|
||||
required this.lastname,
|
||||
required this.genCode,
|
||||
required this.designation,
|
||||
// required this.status
|
||||
});
|
||||
|
||||
@override
|
||||
|
@ -29,6 +35,9 @@ class AddSignatories extends SignatoriesAdminEvent {
|
|||
firstname,
|
||||
middlename,
|
||||
lastname,
|
||||
genCode,
|
||||
designation,
|
||||
// status
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@ class UnitConstructionAdminBloc
|
|||
id: event.id,
|
||||
bldgType: event.bldgType,
|
||||
building: event.building,
|
||||
unitValue: event.unitValue),
|
||||
unitValue: event.unitValue,
|
||||
genCode: event.genCode),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -12,21 +12,18 @@ class AddUnitConstruct extends UnitConstructionAdminEvent {
|
|||
final String bldgType;
|
||||
final String building;
|
||||
final String unitValue;
|
||||
final String genCode;
|
||||
|
||||
const AddUnitConstruct({
|
||||
required this.id,
|
||||
required this.bldgType,
|
||||
required this.building,
|
||||
required this.unitValue,
|
||||
required this.genCode,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object> get props => [
|
||||
id,
|
||||
bldgType,
|
||||
building,
|
||||
unitValue,
|
||||
];
|
||||
List<Object> get props => [id, bldgType, building, unitValue, genCode];
|
||||
}
|
||||
|
||||
class LoadUnitConstruct extends UnitConstructionAdminEvent {
|
||||
|
|
|
@ -55,7 +55,8 @@ class AdditionalItemsOfflineBloc
|
|||
secondhand: event.secondhand == true ? '1' : '0',
|
||||
paintedUnitval: event.paintedUnitval,
|
||||
secondhandUnitval: event.secondhandUnitval,
|
||||
actualUse: event.actualUse));
|
||||
actualUse: event.actualUse,
|
||||
genCode: event.genCode));
|
||||
|
||||
print(item.toJson());
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ class AddAdditionalItems extends AdditionalItemsOfflineEvent {
|
|||
final dynamic paintedUnitval;
|
||||
final dynamic secondhandUnitval;
|
||||
final String actualUse;
|
||||
final String genCode;
|
||||
|
||||
const AddAdditionalItems({
|
||||
required this.id,
|
||||
|
@ -71,6 +72,7 @@ class AddAdditionalItems extends AdditionalItemsOfflineEvent {
|
|||
required this.paintedUnitval,
|
||||
required this.secondhandUnitval,
|
||||
required this.actualUse,
|
||||
required this.genCode,
|
||||
});
|
||||
|
||||
@override
|
||||
|
@ -95,7 +97,8 @@ class AddAdditionalItems extends AdditionalItemsOfflineEvent {
|
|||
secondhand,
|
||||
paintedUnitval,
|
||||
secondhandUnitval,
|
||||
actualUse
|
||||
actualUse,
|
||||
genCode
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -13,23 +13,24 @@ class BldgAppraisalOfflineBloc
|
|||
List<PropertyAppraisal> appraisal = [];
|
||||
on<AddBldgAppraisal>((event, emit) async {
|
||||
await SQLServices.instance.createBldgAppraisal(PropertyAppraisal(
|
||||
id: event.id,
|
||||
bldgapprDetailsId: event.bldgapprDetailsId,
|
||||
assessedById: event.assessedById,
|
||||
assessedByName: event.assessedByName,
|
||||
dateCreated: event.dateCreated,
|
||||
dateModified: event.dateModified,
|
||||
unitconstructCost: event.unitconstructCost,
|
||||
buildingCore: event.buildingCore,
|
||||
unitconstructSubtotal: event.unitconstructSubtotal,
|
||||
depreciationRate: event.depreciationRate,
|
||||
depreciationCost: event.depreciationCost,
|
||||
costAddItems: event.costAddItems,
|
||||
addItemsSubtotal: event.addItemsSubtotal,
|
||||
totalpercentDepreciation: event.totalpercentDepreciation,
|
||||
marketValue: event.marketValue,
|
||||
totalArea: event.totalArea,
|
||||
actualUse: event.actualUse));
|
||||
id: event.id,
|
||||
bldgapprDetailsId: event.bldgapprDetailsId,
|
||||
assessedById: event.assessedById,
|
||||
assessedByName: event.assessedByName,
|
||||
dateCreated: event.dateCreated,
|
||||
dateModified: event.dateModified,
|
||||
unitconstructCost: event.unitconstructCost,
|
||||
buildingCore: event.buildingCore,
|
||||
unitconstructSubtotal: event.unitconstructSubtotal,
|
||||
depreciationRate: event.depreciationRate,
|
||||
depreciationCost: event.depreciationCost,
|
||||
costAddItems: event.costAddItems,
|
||||
addItemsSubtotal: event.addItemsSubtotal,
|
||||
totalpercentDepreciation: event.totalpercentDepreciation,
|
||||
marketValue: event.marketValue,
|
||||
totalArea: event.totalArea,
|
||||
actualUse: event.actualUse,
|
||||
));
|
||||
});
|
||||
on<FetchSingleBldgAppraisal>((event, emit) async {
|
||||
List<Map<String, dynamic>> result =
|
||||
|
|
|
@ -25,6 +25,7 @@ class AddBldgAppraisal extends BldgAppraisalOfflineEvent {
|
|||
final String marketValue;
|
||||
final String totalArea;
|
||||
final String actualUse;
|
||||
final String genCode;
|
||||
|
||||
const AddBldgAppraisal(
|
||||
{required this.id,
|
||||
|
@ -43,7 +44,8 @@ class AddBldgAppraisal extends BldgAppraisalOfflineEvent {
|
|||
required this.totalpercentDepreciation,
|
||||
required this.marketValue,
|
||||
required this.totalArea,
|
||||
required this.actualUse});
|
||||
required this.actualUse,
|
||||
required this.genCode});
|
||||
|
||||
@override
|
||||
List<Object> get props => [
|
||||
|
@ -63,7 +65,8 @@ class AddBldgAppraisal extends BldgAppraisalOfflineEvent {
|
|||
totalpercentDepreciation,
|
||||
marketValue,
|
||||
totalArea,
|
||||
actualUse
|
||||
actualUse,
|
||||
genCode
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -15,13 +15,17 @@ class BldgAssessmentOfflineBloc
|
|||
await SQLServices.instance.createBldgAssessment(PropertyAssessment(
|
||||
id: event.id,
|
||||
bldgapprDetailsId: event.bldgapprDetailsId,
|
||||
assessedById: event.assessedById,
|
||||
assessedByName: event.assessedByName,
|
||||
dateCreated: event.dateCreated,
|
||||
dateModified: event.dateModified,
|
||||
actualUse: event.actualUse,
|
||||
marketValue: event.marketValue,
|
||||
assessmentLevel: event.assessmentLevel,
|
||||
assessedValue: event.assessedValue,
|
||||
taxable: event.taxable,
|
||||
exempt: event.exempt,
|
||||
qtr: event.qtr.toString(),
|
||||
qtr: event.qtr,
|
||||
yr: event.yr.toString(),
|
||||
appraisedbyName: event.appraisedbyName,
|
||||
appraisedbyDate: event.appraisedbyDate,
|
||||
|
@ -32,7 +36,12 @@ class BldgAssessmentOfflineBloc
|
|||
swornstatementNo: event.swornstatementNo,
|
||||
dateReceived: event.dateReceived,
|
||||
entryDateAssessment: event.entryDateAssessment,
|
||||
entryDateBy: event.entryDateBy));
|
||||
entryDateBy: event.entryDateBy,
|
||||
note: event.note,
|
||||
genCode: event.genCode,
|
||||
appraisedbyDesignation: event.appraisedbyDesignation,
|
||||
approvedbyDesignation: event.approvedbyDesignation,
|
||||
recommendapprDesignation: event.recommendapprDesignation));
|
||||
});
|
||||
on<FetchSingleBldgAssessment>((event, emit) async {
|
||||
List<Map<String, dynamic>> result =
|
||||
|
|
|
@ -20,7 +20,7 @@ class AddBldgAssessment extends BldgAssessmentOfflineEvent {
|
|||
final String assessedValue;
|
||||
final String taxable;
|
||||
final String exempt;
|
||||
final int qtr;
|
||||
final String qtr;
|
||||
final int yr;
|
||||
final String appraisedbyName;
|
||||
final String appraisedbyDate;
|
||||
|
@ -32,6 +32,11 @@ class AddBldgAssessment extends BldgAssessmentOfflineEvent {
|
|||
final String dateReceived;
|
||||
final String entryDateAssessment;
|
||||
final String entryDateBy;
|
||||
final String genCode;
|
||||
final String note;
|
||||
final String appraisedbyDesignation;
|
||||
final String recommendapprDesignation;
|
||||
final String approvedbyDesignation;
|
||||
|
||||
const AddBldgAssessment({
|
||||
required this.id,
|
||||
|
@ -58,6 +63,11 @@ class AddBldgAssessment extends BldgAssessmentOfflineEvent {
|
|||
required this.dateReceived,
|
||||
required this.entryDateAssessment,
|
||||
required this.entryDateBy,
|
||||
required this.genCode,
|
||||
required this.note,
|
||||
required this.appraisedbyDesignation,
|
||||
required this.recommendapprDesignation,
|
||||
required this.approvedbyDesignation,
|
||||
});
|
||||
|
||||
@override
|
||||
|
@ -86,6 +96,11 @@ class AddBldgAssessment extends BldgAssessmentOfflineEvent {
|
|||
dateReceived,
|
||||
entryDateAssessment,
|
||||
entryDateBy,
|
||||
genCode,
|
||||
note,
|
||||
appraisedbyDesignation,
|
||||
recommendapprDesignation,
|
||||
approvedbyDesignation,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,8 @@ class GeneralDescriptionBloc
|
|||
totalFloorArea: event.totalFloorArea,
|
||||
floorSketch: event.floorSketch,
|
||||
actualUse: event.actualUse,
|
||||
unitValue: event.unitValue));
|
||||
unitValue: event.unitValue,
|
||||
genCode: event.genCode));
|
||||
});
|
||||
on<FetchSingleGeneralDescription>((event, emit) async {
|
||||
List<Map<String, dynamic>> result =
|
||||
|
|
|
@ -33,6 +33,7 @@ class AddGendesc extends GeneralDescriptionEvent {
|
|||
final dynamic floorSketch;
|
||||
final String actualUse;
|
||||
final String unitValue;
|
||||
final String genCode;
|
||||
|
||||
const AddGendesc(
|
||||
{required this.id,
|
||||
|
@ -59,7 +60,8 @@ class AddGendesc extends GeneralDescriptionEvent {
|
|||
required this.totalFloorArea,
|
||||
required this.floorSketch,
|
||||
required this.actualUse,
|
||||
required this.unitValue});
|
||||
required this.unitValue,
|
||||
required this.genCode});
|
||||
|
||||
@override
|
||||
List<Object> get props => [
|
||||
|
@ -87,7 +89,8 @@ class AddGendesc extends GeneralDescriptionEvent {
|
|||
totalFloorArea,
|
||||
floorSketch,
|
||||
actualUse,
|
||||
unitValue
|
||||
unitValue,
|
||||
genCode
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@ class LandrefLocationBloc
|
|||
tdn: event.tdn,
|
||||
area: event.area,
|
||||
surveyNo: event.surveyNo,
|
||||
blkNo: event.blkNo),
|
||||
blkNo: event.blkNo,
|
||||
genCode: event.genCode),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -51,8 +52,8 @@ class LandrefLocationBloc
|
|||
bldgapprDetailsId: result[0]["bldgapprDetailsId"],
|
||||
assessedById: result[0]["assessedById"],
|
||||
assessedByName: result[0]["assessedByName"],
|
||||
dateCreated: DateTime.now(),
|
||||
dateModified: DateTime.now(),
|
||||
dateCreated: DateTime.now().toString(),
|
||||
dateModified: DateTime.now().toString(),
|
||||
owner: result[0]["owner"],
|
||||
cloaNo: result[0]["cloaNo"],
|
||||
lotNo: result[0]["lotNo"],
|
||||
|
|
|
@ -21,6 +21,7 @@ class AddLandRef extends LandrefLocationEvent {
|
|||
final dynamic blkNo;
|
||||
final String dateCreated;
|
||||
final String dateModified;
|
||||
final String genCode;
|
||||
|
||||
const AddLandRef(
|
||||
{required this.id,
|
||||
|
@ -35,7 +36,8 @@ class AddLandRef extends LandrefLocationEvent {
|
|||
required this.surveyNo,
|
||||
required this.blkNo,
|
||||
required this.dateCreated,
|
||||
required this.dateModified});
|
||||
required this.dateModified,
|
||||
required this.genCode});
|
||||
|
||||
@override
|
||||
List<Object> get props => [
|
||||
|
@ -51,7 +53,8 @@ class AddLandRef extends LandrefLocationEvent {
|
|||
surveyNo,
|
||||
blkNo,
|
||||
dateCreated,
|
||||
dateModified
|
||||
dateModified,
|
||||
genCode
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -12,15 +12,15 @@ class LocationBloc extends Bloc<LocationEvent, LocationState> {
|
|||
List<BldgLoc> todos = [];
|
||||
on<AddLocation>((event, emit) async {
|
||||
await SQLServices.instance.createBldglocation(BldgLoc(
|
||||
id: event.id,
|
||||
bldgapprDetailsId: event.bldgapprDetailsId,
|
||||
assessedById: event.assessedById,
|
||||
assessedByName: event.assessedByName,
|
||||
street: event.street,
|
||||
barangay: event.barangay,
|
||||
municipality: event.municipality,
|
||||
province: event.province,
|
||||
));
|
||||
id: event.id,
|
||||
bldgapprDetailsId: event.bldgapprDetailsId,
|
||||
assessedById: event.assessedById,
|
||||
assessedByName: event.assessedByName,
|
||||
street: event.street,
|
||||
barangay: event.barangay,
|
||||
municipality: event.municipality,
|
||||
province: event.province,
|
||||
genCode: event.genCode));
|
||||
});
|
||||
on<FetchSingleLocation>((event, emit) async {
|
||||
List<Map<String, dynamic>> result =
|
||||
|
|
|
@ -18,6 +18,7 @@ class AddLocation extends LocationEvent {
|
|||
final String province;
|
||||
final String dateCreated;
|
||||
final String dateModified;
|
||||
final String genCode;
|
||||
|
||||
const AddLocation(
|
||||
{required this.id,
|
||||
|
@ -29,7 +30,8 @@ class AddLocation extends LocationEvent {
|
|||
required this.municipality,
|
||||
required this.province,
|
||||
required this.dateCreated,
|
||||
required this.dateModified});
|
||||
required this.dateModified,
|
||||
required this.genCode});
|
||||
|
||||
@override
|
||||
List<Object> get props => [
|
||||
|
@ -41,7 +43,8 @@ class AddLocation extends LocationEvent {
|
|||
municipality,
|
||||
province,
|
||||
dateCreated,
|
||||
dateModified
|
||||
dateModified,
|
||||
genCode
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,10 @@ class CrudBloc extends Bloc<CrudEvent, CrudState> {
|
|||
transCode: event.transCode,
|
||||
tdn: event.tdn,
|
||||
pin: event.pin,
|
||||
owner: event.owner,
|
||||
fname: event.fname,
|
||||
mname: event.mname,
|
||||
lname: event.lname,
|
||||
bday: event.bday,
|
||||
address: event.address,
|
||||
telno: event.telno,
|
||||
tin: event.tin,
|
||||
|
@ -31,7 +34,8 @@ class CrudBloc extends Bloc<CrudEvent, CrudState> {
|
|||
assessedById: event.assessedById,
|
||||
assessedByName: event.assessedByName,
|
||||
dateCreated: event.dateCreated,
|
||||
dateModified: event.dateModified),
|
||||
dateModified: event.dateModified,
|
||||
genCode: event.genCode),
|
||||
);
|
||||
|
||||
propertyOwner.add(ownerInfo);
|
||||
|
|
|
@ -9,7 +9,10 @@ class AddTodo extends CrudEvent {
|
|||
final String transCode;
|
||||
final String tdn;
|
||||
final String pin;
|
||||
final String owner;
|
||||
final String fname;
|
||||
final String mname;
|
||||
final String lname;
|
||||
final String bday;
|
||||
final String address;
|
||||
final String telno;
|
||||
final String tin;
|
||||
|
@ -22,13 +25,17 @@ class AddTodo extends CrudEvent {
|
|||
final String assessedByName;
|
||||
final String dateCreated;
|
||||
final String dateModified;
|
||||
final String genCode;
|
||||
|
||||
const AddTodo(
|
||||
{required this.id,
|
||||
required this.transCode,
|
||||
required this.tdn,
|
||||
required this.pin,
|
||||
required this.owner,
|
||||
required this.fname,
|
||||
required this.mname,
|
||||
required this.lname,
|
||||
required this.bday,
|
||||
required this.address,
|
||||
required this.telno,
|
||||
required this.tin,
|
||||
|
@ -40,7 +47,8 @@ class AddTodo extends CrudEvent {
|
|||
required this.assessedById,
|
||||
required this.assessedByName,
|
||||
required this.dateCreated,
|
||||
required this.dateModified});
|
||||
required this.dateModified,
|
||||
required this.genCode});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
|
@ -48,7 +56,10 @@ class AddTodo extends CrudEvent {
|
|||
transCode,
|
||||
tdn,
|
||||
pin,
|
||||
owner,
|
||||
fname,
|
||||
mname,
|
||||
lname,
|
||||
bday,
|
||||
address,
|
||||
telno,
|
||||
tin,
|
||||
|
@ -60,7 +71,8 @@ class AddTodo extends CrudEvent {
|
|||
assessedById,
|
||||
assessedByName,
|
||||
dateCreated,
|
||||
dateModified
|
||||
dateModified,
|
||||
genCode
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -14,17 +14,21 @@ class StructuralMaterialOfflineBloc extends Bloc<StructuralMaterialOfflineEvent,
|
|||
List<StructureMaterials> materials = [];
|
||||
on<AddStructuralMaterial>((event, emit) async {
|
||||
await SQLServices.instance.createStructuralMaterials(StructureMaterialsII(
|
||||
id: event.id,
|
||||
bldgapprDetailsId: event.bldgapprDetailsId,
|
||||
foundation: event.foundation!.join(', ').split(', '),
|
||||
columns: event.columns!.join(', ').split(', '),
|
||||
beams: event.beams!.join(', ').split(', '),
|
||||
trussFraming: event.trussFraming!.join(', ').split(', '),
|
||||
roof: event.roof!.join(', ').split(', '),
|
||||
flooring: event.flooring!.join(', ').split(', '),
|
||||
walls: event.walls!.join(', ').split(', '),
|
||||
others: event.others!.join(', ').split(', '),
|
||||
));
|
||||
id: event.id,
|
||||
bldgapprDetailsId: event.bldgapprDetailsId,
|
||||
foundation: event.foundation!.join(', ').split(', '),
|
||||
columns: event.columns!.join(', ').split(', '),
|
||||
beams: event.beams!.join(', ').split(', '),
|
||||
trussFraming: event.trussFraming!.join(', ').split(', '),
|
||||
roof: event.roof!.join(', ').split(', '),
|
||||
flooring: event.flooring!.join(', ').split(', '),
|
||||
walls: event.walls!.join(', ').split(', '),
|
||||
others: event.others!.join(', ').split(', '),
|
||||
genCode: event.genCode,
|
||||
assessedById: event.assessedById,
|
||||
assessedByName: event.assessedByName,
|
||||
dateCreated: event.dateCreated,
|
||||
dateModified: event.dateModified));
|
||||
});
|
||||
on<FetchSingleStructuralMaterial>((event, emit) async {
|
||||
List<Map<String, dynamic>> result =
|
||||
|
|
|
@ -22,6 +22,7 @@ class AddStructuralMaterial extends StructuralMaterialOfflineEvent {
|
|||
final String assessedByName;
|
||||
final String dateCreated;
|
||||
final String dateModified;
|
||||
final String genCode;
|
||||
|
||||
const AddStructuralMaterial(
|
||||
{required this.id,
|
||||
|
@ -37,7 +38,8 @@ class AddStructuralMaterial extends StructuralMaterialOfflineEvent {
|
|||
required this.assessedById,
|
||||
required this.assessedByName,
|
||||
required this.dateCreated,
|
||||
required this.dateModified});
|
||||
required this.dateModified,
|
||||
required this.genCode});
|
||||
|
||||
@override
|
||||
List<Object> get props => [
|
||||
|
@ -54,7 +56,8 @@ class AddStructuralMaterial extends StructuralMaterialOfflineEvent {
|
|||
assessedById,
|
||||
assessedByName,
|
||||
dateCreated,
|
||||
dateModified
|
||||
dateModified,
|
||||
genCode
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -29,46 +29,47 @@ class AdditionalItems {
|
|||
final dynamic paintedUnitval;
|
||||
final dynamic secondhandUnitval;
|
||||
final String actualUse;
|
||||
final String genCode;
|
||||
|
||||
AdditionalItems({
|
||||
required this.id,
|
||||
required this.bldgapprDetailsId,
|
||||
required this.classId,
|
||||
required this.className,
|
||||
required this.structType,
|
||||
required this.unitValue,
|
||||
required this.baseUnitValue,
|
||||
required this.area,
|
||||
required this.marketValue,
|
||||
required this.depreciationRate,
|
||||
required this.adjustedMarketVal,
|
||||
required this.amtDepreciation,
|
||||
required this.painted,
|
||||
required this.secondhand,
|
||||
required this.paintedUnitval,
|
||||
required this.secondhandUnitval,
|
||||
required this.actualUse,
|
||||
});
|
||||
AdditionalItems(
|
||||
{required this.id,
|
||||
required this.bldgapprDetailsId,
|
||||
required this.classId,
|
||||
required this.className,
|
||||
required this.structType,
|
||||
required this.unitValue,
|
||||
required this.baseUnitValue,
|
||||
required this.area,
|
||||
required this.marketValue,
|
||||
required this.depreciationRate,
|
||||
required this.adjustedMarketVal,
|
||||
required this.amtDepreciation,
|
||||
required this.painted,
|
||||
required this.secondhand,
|
||||
required this.paintedUnitval,
|
||||
required this.secondhandUnitval,
|
||||
required this.actualUse,
|
||||
required this.genCode});
|
||||
|
||||
AdditionalItems copy({
|
||||
int? id,
|
||||
int? bldgapprDetailsId,
|
||||
int? classId,
|
||||
String? className,
|
||||
String? structType,
|
||||
dynamic unitValue,
|
||||
dynamic baseUnitValue,
|
||||
dynamic area,
|
||||
dynamic marketValue,
|
||||
dynamic depreciationRate,
|
||||
dynamic adjustedMarketVal,
|
||||
dynamic amtDepreciation,
|
||||
String? painted,
|
||||
String? secondhand,
|
||||
dynamic paintedUnitval,
|
||||
dynamic secondhandUnitval,
|
||||
String? actualUse,
|
||||
}) {
|
||||
AdditionalItems copy(
|
||||
{int? id,
|
||||
int? bldgapprDetailsId,
|
||||
int? classId,
|
||||
String? className,
|
||||
String? structType,
|
||||
dynamic unitValue,
|
||||
dynamic baseUnitValue,
|
||||
dynamic area,
|
||||
dynamic marketValue,
|
||||
dynamic depreciationRate,
|
||||
dynamic adjustedMarketVal,
|
||||
dynamic amtDepreciation,
|
||||
String? painted,
|
||||
String? secondhand,
|
||||
dynamic paintedUnitval,
|
||||
dynamic secondhandUnitval,
|
||||
String? actualUse,
|
||||
String? genCode}) {
|
||||
return AdditionalItems(
|
||||
id: id ?? this.id,
|
||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||
|
@ -86,29 +87,30 @@ class AdditionalItems {
|
|||
secondhand: secondhand ?? this.secondhand,
|
||||
paintedUnitval: paintedUnitval ?? this.paintedUnitval,
|
||||
secondhandUnitval: secondhandUnitval ?? this.secondhandUnitval,
|
||||
actualUse: actualUse ?? this.actualUse);
|
||||
actualUse: actualUse ?? this.actualUse,
|
||||
genCode: genCode ?? this.genCode);
|
||||
}
|
||||
|
||||
factory AdditionalItems.fromJson(Map<String, dynamic> json) =>
|
||||
AdditionalItems(
|
||||
id: json["id"],
|
||||
bldgapprDetailsId: json["bldgapprDetailsId"],
|
||||
classId: json["classId"],
|
||||
className: json["className"],
|
||||
structType: json["structType"],
|
||||
unitValue: json["unitValue"],
|
||||
baseUnitValue: json["baseUnitValue"],
|
||||
area: json["area"],
|
||||
marketValue: json["marketValue"],
|
||||
depreciationRate: json["depreciationRate"],
|
||||
adjustedMarketVal: json["adjustedMarketVal"],
|
||||
amtDepreciation: json["amtDepreciation"],
|
||||
painted: json["painted"],
|
||||
secondhand: json["secondhand"],
|
||||
paintedUnitval: json["paintedUnitval"],
|
||||
secondhandUnitval: json["secondhandUnitval"],
|
||||
actualUse: json["actualUse"],
|
||||
);
|
||||
id: json["id"],
|
||||
bldgapprDetailsId: json["bldgapprDetailsId"],
|
||||
classId: json["classId"],
|
||||
className: json["className"],
|
||||
structType: json["structType"],
|
||||
unitValue: json["unitValue"],
|
||||
baseUnitValue: json["baseUnitValue"],
|
||||
area: json["area"],
|
||||
marketValue: json["marketValue"],
|
||||
depreciationRate: json["depreciationRate"],
|
||||
adjustedMarketVal: json["adjustedMarketVal"],
|
||||
amtDepreciation: json["amtDepreciation"],
|
||||
painted: json["painted"],
|
||||
secondhand: json["secondhand"],
|
||||
paintedUnitval: json["paintedUnitval"],
|
||||
secondhandUnitval: json["secondhandUnitval"],
|
||||
actualUse: json["actualUse"],
|
||||
genCode: json["gen_code"]);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
|
@ -128,5 +130,6 @@ class AdditionalItems {
|
|||
"painted_unitval": paintedUnitval,
|
||||
"secondhand_unitval": secondhandUnitval,
|
||||
"actual_use": actualUse,
|
||||
"gen_code": genCode
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,27 +14,30 @@ class Brgy {
|
|||
final String? barangayCode;
|
||||
final String? cityCode;
|
||||
final String? barangayDescription;
|
||||
final String? genCode;
|
||||
|
||||
Brgy({
|
||||
this.id,
|
||||
this.barangayId,
|
||||
this.barangayCode,
|
||||
this.cityCode,
|
||||
this.barangayDescription,
|
||||
});
|
||||
Brgy(
|
||||
{this.id,
|
||||
this.barangayId,
|
||||
this.barangayCode,
|
||||
this.cityCode,
|
||||
this.barangayDescription,
|
||||
this.genCode});
|
||||
|
||||
Brgy copy(
|
||||
{int? id,
|
||||
int? barangayId,
|
||||
String? barangayCode,
|
||||
String? cityCode,
|
||||
String? barangayDescription}) {
|
||||
String? barangayDescription,
|
||||
String? genCode}) {
|
||||
return Brgy(
|
||||
id: id ?? this.id,
|
||||
barangayId: barangayId ?? this.barangayId,
|
||||
barangayCode: barangayCode ?? this.barangayCode,
|
||||
cityCode: cityCode ?? this.cityCode,
|
||||
barangayDescription: barangayDescription ?? this.barangayDescription);
|
||||
barangayDescription: barangayDescription ?? this.barangayDescription,
|
||||
genCode: genCode ?? this.genCode);
|
||||
}
|
||||
|
||||
factory Brgy.fromJson(Map<String, dynamic> json) => Brgy(
|
||||
|
@ -43,6 +46,7 @@ class Brgy {
|
|||
barangayCode: json["barangay_code"],
|
||||
cityCode: json["city_code"],
|
||||
barangayDescription: json["barangay_description"],
|
||||
genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
factory Brgy.fromJson2(Map<String, dynamic> json) => Brgy(
|
||||
|
@ -51,6 +55,7 @@ class Brgy {
|
|||
barangayCode: json["barangayCode"],
|
||||
cityCode: json["cityCode"],
|
||||
barangayDescription: json["barangayDescription"],
|
||||
genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -59,5 +64,6 @@ class Brgy {
|
|||
"barangay_code": barangayCode,
|
||||
"city_code": cityCode,
|
||||
"barangay_description": barangayDescription,
|
||||
"gen_code": genCode,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,12 +13,13 @@ class BldgLoc {
|
|||
final int? bldgapprDetailsId;
|
||||
final String? assessedById;
|
||||
final String? assessedByName;
|
||||
final DateTime? dateCreated;
|
||||
final DateTime? dateModified;
|
||||
final String? dateCreated;
|
||||
final String? dateModified;
|
||||
final dynamic street;
|
||||
final dynamic barangay;
|
||||
final dynamic municipality;
|
||||
final dynamic province;
|
||||
final String? genCode;
|
||||
|
||||
BldgLoc({
|
||||
this.id,
|
||||
|
@ -31,20 +32,21 @@ class BldgLoc {
|
|||
this.barangay,
|
||||
this.municipality,
|
||||
this.province,
|
||||
this.genCode,
|
||||
});
|
||||
|
||||
BldgLoc copy({
|
||||
int? id,
|
||||
int? bldgapprDetailsId,
|
||||
String? assessedById,
|
||||
String? assessedByName,
|
||||
DateTime? dateCreated,
|
||||
DateTime? dateModified,
|
||||
dynamic street,
|
||||
dynamic barangay,
|
||||
dynamic municipality,
|
||||
dynamic province,
|
||||
}) {
|
||||
BldgLoc copy(
|
||||
{int? id,
|
||||
int? bldgapprDetailsId,
|
||||
String? assessedById,
|
||||
String? assessedByName,
|
||||
String? dateCreated,
|
||||
String? dateModified,
|
||||
dynamic street,
|
||||
dynamic barangay,
|
||||
dynamic municipality,
|
||||
dynamic province,
|
||||
String? genCode}) {
|
||||
return BldgLoc(
|
||||
id: id ?? this.id,
|
||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||
|
@ -55,7 +57,8 @@ class BldgLoc {
|
|||
street: street ?? this.street,
|
||||
barangay: barangay ?? this.barangay,
|
||||
municipality: municipality ?? this.municipality,
|
||||
province: province ?? this.province);
|
||||
province: province ?? this.province,
|
||||
genCode: genCode ?? this.genCode);
|
||||
}
|
||||
|
||||
factory BldgLoc.fromJson(Map<String, dynamic> json) => BldgLoc(
|
||||
|
@ -63,16 +66,27 @@ class BldgLoc {
|
|||
bldgapprDetailsId: json["bldgappr_details_id"],
|
||||
assessedById: json["assessed_by_id"],
|
||||
assessedByName: json["assessed_by_name"],
|
||||
dateCreated: json["date_created"] == null
|
||||
? null
|
||||
: DateTime.parse(json["date_created"]),
|
||||
dateModified: json["date_modified"] == null
|
||||
? null
|
||||
: DateTime.parse(json["date_modified"]),
|
||||
dateCreated: json["date_created"],
|
||||
dateModified: json["date_modified"],
|
||||
street: json["street"],
|
||||
barangay: json["barangay"],
|
||||
municipality: json["municipality"],
|
||||
province: json["province"],
|
||||
genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
factory BldgLoc.fromJson2(Map<String, dynamic> json) => BldgLoc(
|
||||
id: json["id"],
|
||||
bldgapprDetailsId: json["bldgapprDetailsId"],
|
||||
assessedById: json["assessedById"],
|
||||
assessedByName: json["assessedByName"],
|
||||
dateCreated: json["dateCreated"],
|
||||
dateModified: json["dateModified"],
|
||||
street: json["street"],
|
||||
barangay: json["barangay"],
|
||||
municipality: json["municipality"],
|
||||
province: json["province"],
|
||||
genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -80,11 +94,12 @@ class BldgLoc {
|
|||
"bldgappr_details_id": bldgapprDetailsId,
|
||||
"assessed_by_id": assessedById,
|
||||
"assessed_by_name": assessedByName,
|
||||
"date_created": dateCreated?.toIso8601String(),
|
||||
"date_modified": dateModified?.toIso8601String(),
|
||||
"date_created": dateCreated,
|
||||
"date_modified": dateModified,
|
||||
"street": street,
|
||||
"barangay": barangay,
|
||||
"municipality": municipality,
|
||||
"province": province,
|
||||
"gen_code": genCode,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,119 +13,107 @@ String bldgAndStructureToJson(BldgAndStructure data) =>
|
|||
class BldgAndStructure {
|
||||
final int? id;
|
||||
final int? bldgapprDetailsId;
|
||||
final String? assessedById;
|
||||
final String? assessedByName;
|
||||
final String? dateCreated;
|
||||
final String? dateModified;
|
||||
final String? bldgType;
|
||||
final String? strucType;
|
||||
final String? structType;
|
||||
final String? description;
|
||||
final String? actualUse;
|
||||
final String? floorCount;
|
||||
final String? bldgArea;
|
||||
final String? unitValue;
|
||||
final String? buccPercentage;
|
||||
final String? depRate;
|
||||
final String? marketValue;
|
||||
final String? depAmount;
|
||||
final String? adjustedMarketValue;
|
||||
final String? genCode;
|
||||
|
||||
BldgAndStructure({
|
||||
this.id,
|
||||
this.bldgapprDetailsId,
|
||||
this.assessedById,
|
||||
this.assessedByName,
|
||||
this.dateCreated,
|
||||
this.dateModified,
|
||||
this.bldgType,
|
||||
this.strucType,
|
||||
this.structType,
|
||||
this.description,
|
||||
this.actualUse,
|
||||
this.floorCount,
|
||||
this.bldgArea,
|
||||
this.unitValue,
|
||||
this.buccPercentage,
|
||||
this.depRate,
|
||||
this.marketValue,
|
||||
this.depAmount,
|
||||
this.adjustedMarketValue,
|
||||
this.genCode,
|
||||
});
|
||||
|
||||
BldgAndStructure copy({
|
||||
int? id,
|
||||
int? bldgapprDetailsId,
|
||||
String? assessedById,
|
||||
String? assessedByName,
|
||||
String? dateCreated,
|
||||
String? dateModified,
|
||||
String? bldgType,
|
||||
String? strucType,
|
||||
String? structType,
|
||||
String? description,
|
||||
String? actualUse,
|
||||
String? floorCount,
|
||||
String? bldgArea,
|
||||
String? unitValue,
|
||||
String? buccPercentage,
|
||||
String? depRate,
|
||||
String? marketValue,
|
||||
String? depAmount,
|
||||
String? adjustedMarketValue,
|
||||
String? genCode,
|
||||
}) =>
|
||||
BldgAndStructure(
|
||||
id: id ?? this.id,
|
||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||
assessedById: assessedById ?? this.assessedById,
|
||||
assessedByName: assessedByName ?? this.assessedByName,
|
||||
dateCreated: dateCreated ?? this.dateCreated,
|
||||
dateModified: dateModified ?? this.dateModified,
|
||||
bldgType: bldgType ?? this.bldgType,
|
||||
strucType: strucType ?? this.strucType,
|
||||
structType: structType ?? this.structType,
|
||||
description: description ?? this.description,
|
||||
actualUse: actualUse ?? this.actualUse,
|
||||
floorCount: floorCount ?? this.floorCount,
|
||||
bldgArea: bldgArea ?? this.bldgArea,
|
||||
unitValue: unitValue ?? this.unitValue,
|
||||
buccPercentage: buccPercentage ?? this.buccPercentage,
|
||||
depRate: depRate ?? this.depRate,
|
||||
marketValue: marketValue ?? this.marketValue,
|
||||
depAmount: depAmount ?? this.depAmount,
|
||||
adjustedMarketValue: adjustedMarketValue ?? this.adjustedMarketValue,
|
||||
genCode: genCode ?? this.genCode,
|
||||
);
|
||||
|
||||
factory BldgAndStructure.fromJson(Map<String, dynamic> json) =>
|
||||
BldgAndStructure(
|
||||
id: json["id"],
|
||||
bldgapprDetailsId: json["bldgapprDetailsId"],
|
||||
assessedById: json["assessedById"],
|
||||
assessedByName: json["assessedByName"],
|
||||
dateCreated: json["dateCreated"],
|
||||
dateModified: json["dateModified"],
|
||||
bldgType: json["bldgType"],
|
||||
strucType: json["strucType"],
|
||||
structType: json["structType"],
|
||||
description: json["description"],
|
||||
actualUse: json["actualUse"],
|
||||
floorCount: json["floorCount"],
|
||||
bldgArea: json["bldgArea"],
|
||||
unitValue: json["unitValue"],
|
||||
buccPercentage: json["buccPercentage"],
|
||||
depRate: json["depRate"],
|
||||
marketValue: json["marketValue"],
|
||||
depAmount: json["depAmount"],
|
||||
adjustedMarketValue: json["adjustedMarketValue"],
|
||||
genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"bldgapprDetailsId": bldgapprDetailsId,
|
||||
"assessedById": assessedById,
|
||||
"assessedByName": assessedByName,
|
||||
"dateCreated": dateCreated,
|
||||
"dateModified": dateModified,
|
||||
"bldgType": bldgType,
|
||||
"strucType": strucType,
|
||||
"bldgappr_details_id": bldgapprDetailsId,
|
||||
"bldg_type": bldgType,
|
||||
"struct_type": structType,
|
||||
"description": description,
|
||||
"actualUse": actualUse,
|
||||
"floorCount": floorCount,
|
||||
"bldgArea": bldgArea,
|
||||
"unitValue": unitValue,
|
||||
"depRate": depRate,
|
||||
"marketValue": marketValue,
|
||||
"depAmount": depAmount,
|
||||
"adjustedMarketValue": adjustedMarketValue,
|
||||
"actual_use": actualUse,
|
||||
"floor_count": floorCount,
|
||||
"bldg_area": bldgArea,
|
||||
"unit_value": unitValue,
|
||||
"bucc_percentage": buccPercentage,
|
||||
"dep_rate": depRate,
|
||||
"market_value": marketValue,
|
||||
"dep_amount": depAmount,
|
||||
"adjusted_market_value": adjustedMarketValue,
|
||||
"gen_code": genCode,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,850 @@
|
|||
// To parse this JSON data, do
|
||||
//
|
||||
// final buildingDetails = buildingDetailsFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
BuildingDetails buildingDetailsFromJson(String str) =>
|
||||
BuildingDetails.fromJson(json.decode(str));
|
||||
|
||||
String buildingDetailsToJson(BuildingDetails data) =>
|
||||
json.encode(data.toJson());
|
||||
|
||||
class BuildingDetails {
|
||||
final String? assessedById;
|
||||
final String? assessedByName;
|
||||
final String? dateCreated;
|
||||
final String? dateModified;
|
||||
final String? transCode;
|
||||
final String? tdn;
|
||||
final String? pin;
|
||||
final String? owner;
|
||||
final String? address;
|
||||
final String? telno;
|
||||
final String? tin;
|
||||
final String? adminUser;
|
||||
final String? adminAddress;
|
||||
final String? adminTelno;
|
||||
final String? adminTin;
|
||||
final String? faasType;
|
||||
final String? genCode;
|
||||
final String? bldgapprLocationDateCreated;
|
||||
final String? bldgapprLocationDateModified;
|
||||
final dynamic bldgapprLocationStreet;
|
||||
final dynamic bldgapprLocationBarangay;
|
||||
final dynamic bldgapprLocationMunicipality;
|
||||
final dynamic bldgapprLocationProvince;
|
||||
final String? bldgapprLocationGenCode;
|
||||
final String? bldgapprLandrefDateCreated;
|
||||
final String? bldgapprLandrefDateModified;
|
||||
final dynamic bldgapprLandrefOwner;
|
||||
final dynamic bldgapprLandrefCloaNo;
|
||||
final dynamic bldgapprLandrefLotNo;
|
||||
final dynamic bldgapprLandrefTdn;
|
||||
final dynamic bldgapprLandrefArea;
|
||||
final dynamic bldgapprLandrefSurveyNo;
|
||||
final dynamic bldgapprLandrefBlkNo;
|
||||
final String? bldgapprLandrefGenCode;
|
||||
final String? bldgapprGeneraldescDateCreated;
|
||||
final String? bldgapprGeneraldescDateModified;
|
||||
final dynamic bldgapprGeneraldescBldgKind;
|
||||
final dynamic bldgapprGeneraldescStrucType;
|
||||
final dynamic bldgapprGeneraldescBldgPermit;
|
||||
final dynamic bldgapprGeneraldescDateIssued;
|
||||
final dynamic bldgapprGeneraldescCct;
|
||||
final dynamic bldgapprGeneraldescCertCompletionIssued;
|
||||
final dynamic bldgapprGeneraldescCertOccupancyIssued;
|
||||
final dynamic bldgapprGeneraldescDateCompleted;
|
||||
final dynamic bldgapprGeneraldescDateOccupied;
|
||||
final dynamic bldgapprGeneraldescBldgAge;
|
||||
final dynamic bldgapprGeneraldescNoStoreys;
|
||||
final dynamic bldgapprGeneraldescArea1Stfloor;
|
||||
final dynamic bldgapprGeneraldescArea2Ndfloor;
|
||||
final dynamic bldgapprGeneraldescArea3Rdfloor;
|
||||
final dynamic bldgapprGeneraldescArea4Thfloor;
|
||||
final dynamic bldgapprGeneraldescTotalFloorArea;
|
||||
final dynamic bldgapprGeneraldescFloorSketch;
|
||||
final dynamic bldgapprGeneraldescActualUse;
|
||||
final dynamic bldgapprGeneraldescUnitValue;
|
||||
final String? bldgapprGeneraldescGenCode;
|
||||
final String? bldgapprStructMaterialsDateCreated;
|
||||
final String? bldgapprStructMaterialsDateModified;
|
||||
final dynamic bldgapprStructMaterialsFoundation;
|
||||
final dynamic bldgapprStructMaterialsColumns;
|
||||
final dynamic bldgapprStructMaterialsBeams;
|
||||
final dynamic bldgapprStructMaterialsTrussFraming;
|
||||
final dynamic bldgapprStructMaterialsRoof;
|
||||
final dynamic bldgapprStructMaterialsFlooring;
|
||||
final dynamic bldgapprStructMaterialsWalls;
|
||||
final dynamic bldgapprStructMaterialsOthers;
|
||||
final String? bldgapprStructMaterialsGenCode;
|
||||
final String? bldgapprPropertyAssessmentDateCreated;
|
||||
final String? bldgapprPropertyAssessmentDateModified;
|
||||
final dynamic bldgapprPropertyAssessmentActualUse;
|
||||
final dynamic bldgapprPropertyAssessmentMarketValue;
|
||||
final dynamic bldgapprPropertyAssessmentAssessmentLevel;
|
||||
final dynamic bldgapprPropertyAssessmentAssessedValue;
|
||||
final dynamic bldgapprPropertyAssessmentTaxable;
|
||||
final dynamic bldgapprPropertyAssessmentExempt;
|
||||
final dynamic bldgapprPropertyAssessmentQtr;
|
||||
final dynamic bldgapprPropertyAssessmentYr;
|
||||
final dynamic bldgapprPropertyAssessmentAppraisedbyName;
|
||||
final dynamic bldgapprPropertyAssessmentAppraisedbyDate;
|
||||
final dynamic bldgapprPropertyAssessmentRecommendapprName;
|
||||
final dynamic bldgapprPropertyAssessmentRecommendapprDate;
|
||||
final dynamic bldgapprPropertyAssessmentApprovedbyName;
|
||||
final dynamic bldgapprPropertyAssessmentApprovedbyDate;
|
||||
final dynamic bldgapprPropertyAssessmentMemoranda;
|
||||
final dynamic bldgapprPropertyAssessmentSwornstatementNo;
|
||||
final dynamic bldgapprPropertyAssessmentDateReceived;
|
||||
final dynamic bldgapprPropertyAssessmentEntryDateAssessment;
|
||||
final dynamic bldgapprPropertyAssessmentEntryDateBy;
|
||||
final String? bldgapprPropertyAssessmentGenCode;
|
||||
final String? bldgapprRecSupersededassDateCreated;
|
||||
final String? bldgapprRecSupersededassDateModified;
|
||||
final dynamic bldgapprRecSupersededassPin;
|
||||
final dynamic bldgapprRecSupersededassTdn;
|
||||
final dynamic bldgapprRecSupersededassTotalAssval;
|
||||
final dynamic bldgapprRecSupersededassOwner;
|
||||
final dynamic bldgapprRecSupersededassEffectivityAss;
|
||||
final dynamic bldgapprRecSupersededassPageNo;
|
||||
final dynamic bldgapprRecSupersededassTotalMarketval;
|
||||
final dynamic bldgapprRecSupersededassTotalArea;
|
||||
final dynamic bldgapprRecSupersededassRecAssessment;
|
||||
final dynamic bldgapprRecSupersededassRecTaxmapping;
|
||||
final dynamic bldgapprRecSupersededassRecRecords;
|
||||
final dynamic bldgapprRecSupersededassDate;
|
||||
final String? bldgapprRecSupersededassGenCode;
|
||||
|
||||
BuildingDetails({
|
||||
this.assessedById,
|
||||
this.assessedByName,
|
||||
this.dateCreated,
|
||||
this.dateModified,
|
||||
this.transCode,
|
||||
this.tdn,
|
||||
this.pin,
|
||||
this.owner,
|
||||
this.address,
|
||||
this.telno,
|
||||
this.tin,
|
||||
this.adminUser,
|
||||
this.adminAddress,
|
||||
this.adminTelno,
|
||||
this.adminTin,
|
||||
this.faasType,
|
||||
this.genCode,
|
||||
this.bldgapprLocationDateCreated,
|
||||
this.bldgapprLocationDateModified,
|
||||
this.bldgapprLocationStreet,
|
||||
this.bldgapprLocationBarangay,
|
||||
this.bldgapprLocationMunicipality,
|
||||
this.bldgapprLocationProvince,
|
||||
this.bldgapprLocationGenCode,
|
||||
this.bldgapprLandrefDateCreated,
|
||||
this.bldgapprLandrefDateModified,
|
||||
this.bldgapprLandrefOwner,
|
||||
this.bldgapprLandrefCloaNo,
|
||||
this.bldgapprLandrefLotNo,
|
||||
this.bldgapprLandrefTdn,
|
||||
this.bldgapprLandrefArea,
|
||||
this.bldgapprLandrefSurveyNo,
|
||||
this.bldgapprLandrefBlkNo,
|
||||
this.bldgapprLandrefGenCode,
|
||||
this.bldgapprGeneraldescDateCreated,
|
||||
this.bldgapprGeneraldescDateModified,
|
||||
this.bldgapprGeneraldescBldgKind,
|
||||
this.bldgapprGeneraldescStrucType,
|
||||
this.bldgapprGeneraldescBldgPermit,
|
||||
this.bldgapprGeneraldescDateIssued,
|
||||
this.bldgapprGeneraldescCct,
|
||||
this.bldgapprGeneraldescCertCompletionIssued,
|
||||
this.bldgapprGeneraldescCertOccupancyIssued,
|
||||
this.bldgapprGeneraldescDateCompleted,
|
||||
this.bldgapprGeneraldescDateOccupied,
|
||||
this.bldgapprGeneraldescBldgAge,
|
||||
this.bldgapprGeneraldescNoStoreys,
|
||||
this.bldgapprGeneraldescArea1Stfloor,
|
||||
this.bldgapprGeneraldescArea2Ndfloor,
|
||||
this.bldgapprGeneraldescArea3Rdfloor,
|
||||
this.bldgapprGeneraldescArea4Thfloor,
|
||||
this.bldgapprGeneraldescTotalFloorArea,
|
||||
this.bldgapprGeneraldescFloorSketch,
|
||||
this.bldgapprGeneraldescActualUse,
|
||||
this.bldgapprGeneraldescUnitValue,
|
||||
this.bldgapprGeneraldescGenCode,
|
||||
this.bldgapprStructMaterialsDateCreated,
|
||||
this.bldgapprStructMaterialsDateModified,
|
||||
this.bldgapprStructMaterialsFoundation,
|
||||
this.bldgapprStructMaterialsColumns,
|
||||
this.bldgapprStructMaterialsBeams,
|
||||
this.bldgapprStructMaterialsTrussFraming,
|
||||
this.bldgapprStructMaterialsRoof,
|
||||
this.bldgapprStructMaterialsFlooring,
|
||||
this.bldgapprStructMaterialsWalls,
|
||||
this.bldgapprStructMaterialsOthers,
|
||||
this.bldgapprStructMaterialsGenCode,
|
||||
this.bldgapprPropertyAssessmentDateCreated,
|
||||
this.bldgapprPropertyAssessmentDateModified,
|
||||
this.bldgapprPropertyAssessmentActualUse,
|
||||
this.bldgapprPropertyAssessmentMarketValue,
|
||||
this.bldgapprPropertyAssessmentAssessmentLevel,
|
||||
this.bldgapprPropertyAssessmentAssessedValue,
|
||||
this.bldgapprPropertyAssessmentTaxable,
|
||||
this.bldgapprPropertyAssessmentExempt,
|
||||
this.bldgapprPropertyAssessmentQtr,
|
||||
this.bldgapprPropertyAssessmentYr,
|
||||
this.bldgapprPropertyAssessmentAppraisedbyName,
|
||||
this.bldgapprPropertyAssessmentAppraisedbyDate,
|
||||
this.bldgapprPropertyAssessmentRecommendapprName,
|
||||
this.bldgapprPropertyAssessmentRecommendapprDate,
|
||||
this.bldgapprPropertyAssessmentApprovedbyName,
|
||||
this.bldgapprPropertyAssessmentApprovedbyDate,
|
||||
this.bldgapprPropertyAssessmentMemoranda,
|
||||
this.bldgapprPropertyAssessmentSwornstatementNo,
|
||||
this.bldgapprPropertyAssessmentDateReceived,
|
||||
this.bldgapprPropertyAssessmentEntryDateAssessment,
|
||||
this.bldgapprPropertyAssessmentEntryDateBy,
|
||||
this.bldgapprPropertyAssessmentGenCode,
|
||||
this.bldgapprRecSupersededassDateCreated,
|
||||
this.bldgapprRecSupersededassDateModified,
|
||||
this.bldgapprRecSupersededassPin,
|
||||
this.bldgapprRecSupersededassTdn,
|
||||
this.bldgapprRecSupersededassTotalAssval,
|
||||
this.bldgapprRecSupersededassOwner,
|
||||
this.bldgapprRecSupersededassEffectivityAss,
|
||||
this.bldgapprRecSupersededassPageNo,
|
||||
this.bldgapprRecSupersededassTotalMarketval,
|
||||
this.bldgapprRecSupersededassTotalArea,
|
||||
this.bldgapprRecSupersededassRecAssessment,
|
||||
this.bldgapprRecSupersededassRecTaxmapping,
|
||||
this.bldgapprRecSupersededassRecRecords,
|
||||
this.bldgapprRecSupersededassDate,
|
||||
this.bldgapprRecSupersededassGenCode,
|
||||
});
|
||||
|
||||
BuildingDetails copyWith({
|
||||
String? assessedById,
|
||||
String? assessedByName,
|
||||
String? dateCreated,
|
||||
String? dateModified,
|
||||
String? transCode,
|
||||
String? tdn,
|
||||
String? pin,
|
||||
String? owner,
|
||||
String? address,
|
||||
String? telno,
|
||||
String? tin,
|
||||
String? adminUser,
|
||||
String? adminAddress,
|
||||
String? adminTelno,
|
||||
String? adminTin,
|
||||
String? faasType,
|
||||
String? genCode,
|
||||
String? bldgapprLocationDateCreated,
|
||||
String? bldgapprLocationDateModified,
|
||||
dynamic bldgapprLocationStreet,
|
||||
dynamic bldgapprLocationBarangay,
|
||||
dynamic bldgapprLocationMunicipality,
|
||||
dynamic bldgapprLocationProvince,
|
||||
String? bldgapprLocationGenCode,
|
||||
String? bldgapprLandrefDateCreated,
|
||||
String? bldgapprLandrefDateModified,
|
||||
dynamic bldgapprLandrefOwner,
|
||||
dynamic bldgapprLandrefCloaNo,
|
||||
dynamic bldgapprLandrefLotNo,
|
||||
dynamic bldgapprLandrefTdn,
|
||||
dynamic bldgapprLandrefArea,
|
||||
dynamic bldgapprLandrefSurveyNo,
|
||||
dynamic bldgapprLandrefBlkNo,
|
||||
String? bldgapprLandrefGenCode,
|
||||
String? bldgapprGeneraldescDateCreated,
|
||||
String? bldgapprGeneraldescDateModified,
|
||||
dynamic bldgapprGeneraldescBldgKind,
|
||||
dynamic bldgapprGeneraldescStrucType,
|
||||
dynamic bldgapprGeneraldescBldgPermit,
|
||||
dynamic bldgapprGeneraldescDateIssued,
|
||||
dynamic bldgapprGeneraldescCct,
|
||||
dynamic bldgapprGeneraldescCertCompletionIssued,
|
||||
dynamic bldgapprGeneraldescCertOccupancyIssued,
|
||||
dynamic bldgapprGeneraldescDateCompleted,
|
||||
dynamic bldgapprGeneraldescDateOccupied,
|
||||
dynamic bldgapprGeneraldescBldgAge,
|
||||
dynamic bldgapprGeneraldescNoStoreys,
|
||||
dynamic bldgapprGeneraldescArea1Stfloor,
|
||||
dynamic bldgapprGeneraldescArea2Ndfloor,
|
||||
dynamic bldgapprGeneraldescArea3Rdfloor,
|
||||
dynamic bldgapprGeneraldescArea4Thfloor,
|
||||
dynamic bldgapprGeneraldescTotalFloorArea,
|
||||
dynamic bldgapprGeneraldescFloorSketch,
|
||||
dynamic bldgapprGeneraldescActualUse,
|
||||
dynamic bldgapprGeneraldescUnitValue,
|
||||
String? bldgapprGeneraldescGenCode,
|
||||
String? bldgapprStructMaterialsDateCreated,
|
||||
String? bldgapprStructMaterialsDateModified,
|
||||
dynamic bldgapprStructMaterialsFoundation,
|
||||
dynamic bldgapprStructMaterialsColumns,
|
||||
dynamic bldgapprStructMaterialsBeams,
|
||||
dynamic bldgapprStructMaterialsTrussFraming,
|
||||
dynamic bldgapprStructMaterialsRoof,
|
||||
dynamic bldgapprStructMaterialsFlooring,
|
||||
dynamic bldgapprStructMaterialsWalls,
|
||||
dynamic bldgapprStructMaterialsOthers,
|
||||
String? bldgapprStructMaterialsGenCode,
|
||||
String? bldgapprPropertyAssessmentDateCreated,
|
||||
String? bldgapprPropertyAssessmentDateModified,
|
||||
dynamic bldgapprPropertyAssessmentActualUse,
|
||||
dynamic bldgapprPropertyAssessmentMarketValue,
|
||||
dynamic bldgapprPropertyAssessmentAssessmentLevel,
|
||||
dynamic bldgapprPropertyAssessmentAssessedValue,
|
||||
dynamic bldgapprPropertyAssessmentTaxable,
|
||||
dynamic bldgapprPropertyAssessmentExempt,
|
||||
dynamic bldgapprPropertyAssessmentQtr,
|
||||
dynamic bldgapprPropertyAssessmentYr,
|
||||
dynamic bldgapprPropertyAssessmentAppraisedbyName,
|
||||
dynamic bldgapprPropertyAssessmentAppraisedbyDate,
|
||||
dynamic bldgapprPropertyAssessmentRecommendapprName,
|
||||
dynamic bldgapprPropertyAssessmentRecommendapprDate,
|
||||
dynamic bldgapprPropertyAssessmentApprovedbyName,
|
||||
dynamic bldgapprPropertyAssessmentApprovedbyDate,
|
||||
dynamic bldgapprPropertyAssessmentMemoranda,
|
||||
dynamic bldgapprPropertyAssessmentSwornstatementNo,
|
||||
dynamic bldgapprPropertyAssessmentDateReceived,
|
||||
dynamic bldgapprPropertyAssessmentEntryDateAssessment,
|
||||
dynamic bldgapprPropertyAssessmentEntryDateBy,
|
||||
String? bldgapprPropertyAssessmentGenCode,
|
||||
String? bldgapprRecSupersededassDateCreated,
|
||||
String? bldgapprRecSupersededassDateModified,
|
||||
dynamic bldgapprRecSupersededassPin,
|
||||
dynamic bldgapprRecSupersededassTdn,
|
||||
dynamic bldgapprRecSupersededassTotalAssval,
|
||||
dynamic bldgapprRecSupersededassOwner,
|
||||
dynamic bldgapprRecSupersededassEffectivityAss,
|
||||
dynamic bldgapprRecSupersededassPageNo,
|
||||
dynamic bldgapprRecSupersededassTotalMarketval,
|
||||
dynamic bldgapprRecSupersededassTotalArea,
|
||||
dynamic bldgapprRecSupersededassRecAssessment,
|
||||
dynamic bldgapprRecSupersededassRecTaxmapping,
|
||||
dynamic bldgapprRecSupersededassRecRecords,
|
||||
dynamic bldgapprRecSupersededassDate,
|
||||
String? bldgapprRecSupersededassGenCode,
|
||||
}) =>
|
||||
BuildingDetails(
|
||||
assessedById: assessedById ?? this.assessedById,
|
||||
assessedByName: assessedByName ?? this.assessedByName,
|
||||
dateCreated: dateCreated ?? this.dateCreated,
|
||||
dateModified: dateModified ?? this.dateModified,
|
||||
transCode: transCode ?? this.transCode,
|
||||
tdn: tdn ?? this.tdn,
|
||||
pin: pin ?? this.pin,
|
||||
owner: owner ?? this.owner,
|
||||
address: address ?? this.address,
|
||||
telno: telno ?? this.telno,
|
||||
tin: tin ?? this.tin,
|
||||
adminUser: adminUser ?? this.adminUser,
|
||||
adminAddress: adminAddress ?? this.adminAddress,
|
||||
adminTelno: adminTelno ?? this.adminTelno,
|
||||
adminTin: adminTin ?? this.adminTin,
|
||||
faasType: faasType ?? this.faasType,
|
||||
genCode: genCode ?? this.genCode,
|
||||
bldgapprLocationDateCreated:
|
||||
bldgapprLocationDateCreated ?? this.bldgapprLocationDateCreated,
|
||||
bldgapprLocationDateModified:
|
||||
bldgapprLocationDateModified ?? this.bldgapprLocationDateModified,
|
||||
bldgapprLocationStreet:
|
||||
bldgapprLocationStreet ?? this.bldgapprLocationStreet,
|
||||
bldgapprLocationBarangay:
|
||||
bldgapprLocationBarangay ?? this.bldgapprLocationBarangay,
|
||||
bldgapprLocationMunicipality:
|
||||
bldgapprLocationMunicipality ?? this.bldgapprLocationMunicipality,
|
||||
bldgapprLocationProvince:
|
||||
bldgapprLocationProvince ?? this.bldgapprLocationProvince,
|
||||
bldgapprLocationGenCode:
|
||||
bldgapprLocationGenCode ?? this.bldgapprLocationGenCode,
|
||||
bldgapprLandrefDateCreated:
|
||||
bldgapprLandrefDateCreated ?? this.bldgapprLandrefDateCreated,
|
||||
bldgapprLandrefDateModified:
|
||||
bldgapprLandrefDateModified ?? this.bldgapprLandrefDateModified,
|
||||
bldgapprLandrefOwner: bldgapprLandrefOwner ?? this.bldgapprLandrefOwner,
|
||||
bldgapprLandrefCloaNo:
|
||||
bldgapprLandrefCloaNo ?? this.bldgapprLandrefCloaNo,
|
||||
bldgapprLandrefLotNo: bldgapprLandrefLotNo ?? this.bldgapprLandrefLotNo,
|
||||
bldgapprLandrefTdn: bldgapprLandrefTdn ?? this.bldgapprLandrefTdn,
|
||||
bldgapprLandrefArea: bldgapprLandrefArea ?? this.bldgapprLandrefArea,
|
||||
bldgapprLandrefSurveyNo:
|
||||
bldgapprLandrefSurveyNo ?? this.bldgapprLandrefSurveyNo,
|
||||
bldgapprLandrefBlkNo: bldgapprLandrefBlkNo ?? this.bldgapprLandrefBlkNo,
|
||||
bldgapprLandrefGenCode:
|
||||
bldgapprLandrefGenCode ?? this.bldgapprLandrefGenCode,
|
||||
bldgapprGeneraldescDateCreated: bldgapprGeneraldescDateCreated ??
|
||||
this.bldgapprGeneraldescDateCreated,
|
||||
bldgapprGeneraldescDateModified: bldgapprGeneraldescDateModified ??
|
||||
this.bldgapprGeneraldescDateModified,
|
||||
bldgapprGeneraldescBldgKind:
|
||||
bldgapprGeneraldescBldgKind ?? this.bldgapprGeneraldescBldgKind,
|
||||
bldgapprGeneraldescStrucType:
|
||||
bldgapprGeneraldescStrucType ?? this.bldgapprGeneraldescStrucType,
|
||||
bldgapprGeneraldescBldgPermit:
|
||||
bldgapprGeneraldescBldgPermit ?? this.bldgapprGeneraldescBldgPermit,
|
||||
bldgapprGeneraldescDateIssued:
|
||||
bldgapprGeneraldescDateIssued ?? this.bldgapprGeneraldescDateIssued,
|
||||
bldgapprGeneraldescCct:
|
||||
bldgapprGeneraldescCct ?? this.bldgapprGeneraldescCct,
|
||||
bldgapprGeneraldescCertCompletionIssued:
|
||||
bldgapprGeneraldescCertCompletionIssued ??
|
||||
this.bldgapprGeneraldescCertCompletionIssued,
|
||||
bldgapprGeneraldescCertOccupancyIssued:
|
||||
bldgapprGeneraldescCertOccupancyIssued ??
|
||||
this.bldgapprGeneraldescCertOccupancyIssued,
|
||||
bldgapprGeneraldescDateCompleted: bldgapprGeneraldescDateCompleted ??
|
||||
this.bldgapprGeneraldescDateCompleted,
|
||||
bldgapprGeneraldescDateOccupied: bldgapprGeneraldescDateOccupied ??
|
||||
this.bldgapprGeneraldescDateOccupied,
|
||||
bldgapprGeneraldescBldgAge:
|
||||
bldgapprGeneraldescBldgAge ?? this.bldgapprGeneraldescBldgAge,
|
||||
bldgapprGeneraldescNoStoreys:
|
||||
bldgapprGeneraldescNoStoreys ?? this.bldgapprGeneraldescNoStoreys,
|
||||
bldgapprGeneraldescArea1Stfloor: bldgapprGeneraldescArea1Stfloor ??
|
||||
this.bldgapprGeneraldescArea1Stfloor,
|
||||
bldgapprGeneraldescArea2Ndfloor: bldgapprGeneraldescArea2Ndfloor ??
|
||||
this.bldgapprGeneraldescArea2Ndfloor,
|
||||
bldgapprGeneraldescArea3Rdfloor: bldgapprGeneraldescArea3Rdfloor ??
|
||||
this.bldgapprGeneraldescArea3Rdfloor,
|
||||
bldgapprGeneraldescArea4Thfloor: bldgapprGeneraldescArea4Thfloor ??
|
||||
this.bldgapprGeneraldescArea4Thfloor,
|
||||
bldgapprGeneraldescTotalFloorArea: bldgapprGeneraldescTotalFloorArea ??
|
||||
this.bldgapprGeneraldescTotalFloorArea,
|
||||
bldgapprGeneraldescFloorSketch: bldgapprGeneraldescFloorSketch ??
|
||||
this.bldgapprGeneraldescFloorSketch,
|
||||
bldgapprGeneraldescActualUse:
|
||||
bldgapprGeneraldescActualUse ?? this.bldgapprGeneraldescActualUse,
|
||||
bldgapprGeneraldescUnitValue:
|
||||
bldgapprGeneraldescUnitValue ?? this.bldgapprGeneraldescUnitValue,
|
||||
bldgapprGeneraldescGenCode:
|
||||
bldgapprGeneraldescGenCode ?? this.bldgapprGeneraldescGenCode,
|
||||
bldgapprStructMaterialsDateCreated:
|
||||
bldgapprStructMaterialsDateCreated ??
|
||||
this.bldgapprStructMaterialsDateCreated,
|
||||
bldgapprStructMaterialsDateModified:
|
||||
bldgapprStructMaterialsDateModified ??
|
||||
this.bldgapprStructMaterialsDateModified,
|
||||
bldgapprStructMaterialsFoundation: bldgapprStructMaterialsFoundation ??
|
||||
this.bldgapprStructMaterialsFoundation,
|
||||
bldgapprStructMaterialsColumns: bldgapprStructMaterialsColumns ??
|
||||
this.bldgapprStructMaterialsColumns,
|
||||
bldgapprStructMaterialsBeams:
|
||||
bldgapprStructMaterialsBeams ?? this.bldgapprStructMaterialsBeams,
|
||||
bldgapprStructMaterialsTrussFraming:
|
||||
bldgapprStructMaterialsTrussFraming ??
|
||||
this.bldgapprStructMaterialsTrussFraming,
|
||||
bldgapprStructMaterialsRoof:
|
||||
bldgapprStructMaterialsRoof ?? this.bldgapprStructMaterialsRoof,
|
||||
bldgapprStructMaterialsFlooring: bldgapprStructMaterialsFlooring ??
|
||||
this.bldgapprStructMaterialsFlooring,
|
||||
bldgapprStructMaterialsWalls:
|
||||
bldgapprStructMaterialsWalls ?? this.bldgapprStructMaterialsWalls,
|
||||
bldgapprStructMaterialsOthers:
|
||||
bldgapprStructMaterialsOthers ?? this.bldgapprStructMaterialsOthers,
|
||||
bldgapprStructMaterialsGenCode: bldgapprStructMaterialsGenCode ??
|
||||
this.bldgapprStructMaterialsGenCode,
|
||||
bldgapprPropertyAssessmentDateCreated:
|
||||
bldgapprPropertyAssessmentDateCreated ??
|
||||
this.bldgapprPropertyAssessmentDateCreated,
|
||||
bldgapprPropertyAssessmentDateModified:
|
||||
bldgapprPropertyAssessmentDateModified ??
|
||||
this.bldgapprPropertyAssessmentDateModified,
|
||||
bldgapprPropertyAssessmentActualUse:
|
||||
bldgapprPropertyAssessmentActualUse ??
|
||||
this.bldgapprPropertyAssessmentActualUse,
|
||||
bldgapprPropertyAssessmentMarketValue:
|
||||
bldgapprPropertyAssessmentMarketValue ??
|
||||
this.bldgapprPropertyAssessmentMarketValue,
|
||||
bldgapprPropertyAssessmentAssessmentLevel:
|
||||
bldgapprPropertyAssessmentAssessmentLevel ??
|
||||
this.bldgapprPropertyAssessmentAssessmentLevel,
|
||||
bldgapprPropertyAssessmentAssessedValue:
|
||||
bldgapprPropertyAssessmentAssessedValue ??
|
||||
this.bldgapprPropertyAssessmentAssessedValue,
|
||||
bldgapprPropertyAssessmentTaxable: bldgapprPropertyAssessmentTaxable ??
|
||||
this.bldgapprPropertyAssessmentTaxable,
|
||||
bldgapprPropertyAssessmentExempt: bldgapprPropertyAssessmentExempt ??
|
||||
this.bldgapprPropertyAssessmentExempt,
|
||||
bldgapprPropertyAssessmentQtr:
|
||||
bldgapprPropertyAssessmentQtr ?? this.bldgapprPropertyAssessmentQtr,
|
||||
bldgapprPropertyAssessmentYr:
|
||||
bldgapprPropertyAssessmentYr ?? this.bldgapprPropertyAssessmentYr,
|
||||
bldgapprPropertyAssessmentAppraisedbyName:
|
||||
bldgapprPropertyAssessmentAppraisedbyName ??
|
||||
this.bldgapprPropertyAssessmentAppraisedbyName,
|
||||
bldgapprPropertyAssessmentAppraisedbyDate:
|
||||
bldgapprPropertyAssessmentAppraisedbyDate ??
|
||||
this.bldgapprPropertyAssessmentAppraisedbyDate,
|
||||
bldgapprPropertyAssessmentRecommendapprName:
|
||||
bldgapprPropertyAssessmentRecommendapprName ??
|
||||
this.bldgapprPropertyAssessmentRecommendapprName,
|
||||
bldgapprPropertyAssessmentRecommendapprDate:
|
||||
bldgapprPropertyAssessmentRecommendapprDate ??
|
||||
this.bldgapprPropertyAssessmentRecommendapprDate,
|
||||
bldgapprPropertyAssessmentApprovedbyName:
|
||||
bldgapprPropertyAssessmentApprovedbyName ??
|
||||
this.bldgapprPropertyAssessmentApprovedbyName,
|
||||
bldgapprPropertyAssessmentApprovedbyDate:
|
||||
bldgapprPropertyAssessmentApprovedbyDate ??
|
||||
this.bldgapprPropertyAssessmentApprovedbyDate,
|
||||
bldgapprPropertyAssessmentMemoranda:
|
||||
bldgapprPropertyAssessmentMemoranda ??
|
||||
this.bldgapprPropertyAssessmentMemoranda,
|
||||
bldgapprPropertyAssessmentSwornstatementNo:
|
||||
bldgapprPropertyAssessmentSwornstatementNo ??
|
||||
this.bldgapprPropertyAssessmentSwornstatementNo,
|
||||
bldgapprPropertyAssessmentDateReceived:
|
||||
bldgapprPropertyAssessmentDateReceived ??
|
||||
this.bldgapprPropertyAssessmentDateReceived,
|
||||
bldgapprPropertyAssessmentEntryDateAssessment:
|
||||
bldgapprPropertyAssessmentEntryDateAssessment ??
|
||||
this.bldgapprPropertyAssessmentEntryDateAssessment,
|
||||
bldgapprPropertyAssessmentEntryDateBy:
|
||||
bldgapprPropertyAssessmentEntryDateBy ??
|
||||
this.bldgapprPropertyAssessmentEntryDateBy,
|
||||
bldgapprPropertyAssessmentGenCode: bldgapprPropertyAssessmentGenCode ??
|
||||
this.bldgapprPropertyAssessmentGenCode,
|
||||
bldgapprRecSupersededassDateCreated:
|
||||
bldgapprRecSupersededassDateCreated ??
|
||||
this.bldgapprRecSupersededassDateCreated,
|
||||
bldgapprRecSupersededassDateModified:
|
||||
bldgapprRecSupersededassDateModified ??
|
||||
this.bldgapprRecSupersededassDateModified,
|
||||
bldgapprRecSupersededassPin:
|
||||
bldgapprRecSupersededassPin ?? this.bldgapprRecSupersededassPin,
|
||||
bldgapprRecSupersededassTdn:
|
||||
bldgapprRecSupersededassTdn ?? this.bldgapprRecSupersededassTdn,
|
||||
bldgapprRecSupersededassTotalAssval:
|
||||
bldgapprRecSupersededassTotalAssval ??
|
||||
this.bldgapprRecSupersededassTotalAssval,
|
||||
bldgapprRecSupersededassOwner:
|
||||
bldgapprRecSupersededassOwner ?? this.bldgapprRecSupersededassOwner,
|
||||
bldgapprRecSupersededassEffectivityAss:
|
||||
bldgapprRecSupersededassEffectivityAss ??
|
||||
this.bldgapprRecSupersededassEffectivityAss,
|
||||
bldgapprRecSupersededassPageNo: bldgapprRecSupersededassPageNo ??
|
||||
this.bldgapprRecSupersededassPageNo,
|
||||
bldgapprRecSupersededassTotalMarketval:
|
||||
bldgapprRecSupersededassTotalMarketval ??
|
||||
this.bldgapprRecSupersededassTotalMarketval,
|
||||
bldgapprRecSupersededassTotalArea: bldgapprRecSupersededassTotalArea ??
|
||||
this.bldgapprRecSupersededassTotalArea,
|
||||
bldgapprRecSupersededassRecAssessment:
|
||||
bldgapprRecSupersededassRecAssessment ??
|
||||
this.bldgapprRecSupersededassRecAssessment,
|
||||
bldgapprRecSupersededassRecTaxmapping:
|
||||
bldgapprRecSupersededassRecTaxmapping ??
|
||||
this.bldgapprRecSupersededassRecTaxmapping,
|
||||
bldgapprRecSupersededassRecRecords:
|
||||
bldgapprRecSupersededassRecRecords ??
|
||||
this.bldgapprRecSupersededassRecRecords,
|
||||
bldgapprRecSupersededassDate:
|
||||
bldgapprRecSupersededassDate ?? this.bldgapprRecSupersededassDate,
|
||||
bldgapprRecSupersededassGenCode: bldgapprRecSupersededassGenCode ??
|
||||
this.bldgapprRecSupersededassGenCode,
|
||||
);
|
||||
|
||||
factory BuildingDetails.fromJson(Map<String, dynamic> json) =>
|
||||
BuildingDetails(
|
||||
assessedById: json["assessed_by_id"],
|
||||
assessedByName: json["assessed_by_name"],
|
||||
dateCreated: json["date_created"],
|
||||
dateModified: json["date_modified"],
|
||||
transCode: json["trans_code"],
|
||||
tdn: json["tdn"],
|
||||
pin: json["pin"],
|
||||
owner: json["owner"],
|
||||
address: json["address"],
|
||||
telno: json["telno"],
|
||||
tin: json["tin"],
|
||||
adminUser: json["admin_user"],
|
||||
adminAddress: json["admin_address"],
|
||||
adminTelno: json["admin_telno"],
|
||||
adminTin: json["admin_tin"],
|
||||
faasType: json["faas_type"],
|
||||
genCode: json["gen_code"],
|
||||
bldgapprLocationDateCreated: json["bldgappr_location.date_created"],
|
||||
bldgapprLocationDateModified: json["bldgappr_location.date_modified"],
|
||||
bldgapprLocationStreet: json["bldgappr_location.street"],
|
||||
bldgapprLocationBarangay: json["bldgappr_location.barangay"],
|
||||
bldgapprLocationMunicipality: json["bldgappr_location.municipality"],
|
||||
bldgapprLocationProvince: json["bldgappr_location.province"],
|
||||
bldgapprLocationGenCode: json["bldgappr_location.gen_code"],
|
||||
bldgapprLandrefDateCreated: json["bldgappr_landref.date_created"],
|
||||
bldgapprLandrefDateModified: json["bldgappr_landref.date_modified"],
|
||||
bldgapprLandrefOwner: json["bldgappr_landref.owner"],
|
||||
bldgapprLandrefCloaNo: json["bldgappr_landref.cloa_no"],
|
||||
bldgapprLandrefLotNo: json["bldgappr_landref.lot_no"],
|
||||
bldgapprLandrefTdn: json["bldgappr_landref.tdn"],
|
||||
bldgapprLandrefArea: json["bldgappr_landref.area"],
|
||||
bldgapprLandrefSurveyNo: json["bldgappr_landref.survey_no"],
|
||||
bldgapprLandrefBlkNo: json["bldgappr_landref.blk_no"],
|
||||
bldgapprLandrefGenCode: json["bldgappr_landref.gen_code"],
|
||||
bldgapprGeneraldescDateCreated:
|
||||
json["bldgappr_generaldesc.date_created"],
|
||||
bldgapprGeneraldescDateModified:
|
||||
json["bldgappr_generaldesc.date_modified"],
|
||||
bldgapprGeneraldescBldgKind: json["bldgappr_generaldesc.bldg_kind"],
|
||||
bldgapprGeneraldescStrucType: json["bldgappr_generaldesc.struc_type"],
|
||||
bldgapprGeneraldescBldgPermit: json["bldgappr_generaldesc.bldg_permit"],
|
||||
bldgapprGeneraldescDateIssued: json["bldgappr_generaldesc.date_issued"],
|
||||
bldgapprGeneraldescCct: json["bldgappr_generaldesc.cct"],
|
||||
bldgapprGeneraldescCertCompletionIssued:
|
||||
json["bldgappr_generaldesc.cert_completion_issued"],
|
||||
bldgapprGeneraldescCertOccupancyIssued:
|
||||
json["bldgappr_generaldesc.cert_occupancy_issued"],
|
||||
bldgapprGeneraldescDateCompleted:
|
||||
json["bldgappr_generaldesc.date_completed"],
|
||||
bldgapprGeneraldescDateOccupied:
|
||||
json["bldgappr_generaldesc.date_occupied"],
|
||||
bldgapprGeneraldescBldgAge: json["bldgappr_generaldesc.bldg_age"],
|
||||
bldgapprGeneraldescNoStoreys: json["bldgappr_generaldesc.no_storeys"],
|
||||
bldgapprGeneraldescArea1Stfloor:
|
||||
json["bldgappr_generaldesc.area_1stfloor"],
|
||||
bldgapprGeneraldescArea2Ndfloor:
|
||||
json["bldgappr_generaldesc.area_2ndfloor"],
|
||||
bldgapprGeneraldescArea3Rdfloor:
|
||||
json["bldgappr_generaldesc.area_3rdfloor"],
|
||||
bldgapprGeneraldescArea4Thfloor:
|
||||
json["bldgappr_generaldesc.area_4thfloor"],
|
||||
bldgapprGeneraldescTotalFloorArea:
|
||||
json["bldgappr_generaldesc.total_floor_area"],
|
||||
bldgapprGeneraldescFloorSketch:
|
||||
json["bldgappr_generaldesc.floor_sketch"],
|
||||
bldgapprGeneraldescActualUse: json["bldgappr_generaldesc.actual_use"],
|
||||
bldgapprGeneraldescUnitValue: json["bldgappr_generaldesc.unit_value"],
|
||||
bldgapprGeneraldescGenCode: json["bldgappr_generaldesc.gen_code"],
|
||||
bldgapprStructMaterialsDateCreated:
|
||||
json["bldgappr_struct_materials.date_created"],
|
||||
bldgapprStructMaterialsDateModified:
|
||||
json["bldgappr_struct_materials.date_modified"],
|
||||
bldgapprStructMaterialsFoundation:
|
||||
json["bldgappr_struct_materials.foundation"],
|
||||
bldgapprStructMaterialsColumns:
|
||||
json["bldgappr_struct_materials.columns"],
|
||||
bldgapprStructMaterialsBeams: json["bldgappr_struct_materials.beams"],
|
||||
bldgapprStructMaterialsTrussFraming:
|
||||
json["bldgappr_struct_materials.truss_framing"],
|
||||
bldgapprStructMaterialsRoof: json["bldgappr_struct_materials.roof"],
|
||||
bldgapprStructMaterialsFlooring:
|
||||
json["bldgappr_struct_materials.flooring"],
|
||||
bldgapprStructMaterialsWalls: json["bldgappr_struct_materials.walls"],
|
||||
bldgapprStructMaterialsOthers: json["bldgappr_struct_materials.others"],
|
||||
bldgapprStructMaterialsGenCode:
|
||||
json["bldgappr_struct_materials.gen_code"],
|
||||
bldgapprPropertyAssessmentDateCreated:
|
||||
json["bldgappr_property_assessment.date_created"],
|
||||
bldgapprPropertyAssessmentDateModified:
|
||||
json["bldgappr_property_assessment.date_modified"],
|
||||
bldgapprPropertyAssessmentActualUse:
|
||||
json["bldgappr_property_assessment.actual_use"],
|
||||
bldgapprPropertyAssessmentMarketValue:
|
||||
json["bldgappr_property_assessment.market_value"],
|
||||
bldgapprPropertyAssessmentAssessmentLevel:
|
||||
json["bldgappr_property_assessment.assessment_level"],
|
||||
bldgapprPropertyAssessmentAssessedValue:
|
||||
json["bldgappr_property_assessment.assessed_value"],
|
||||
bldgapprPropertyAssessmentTaxable:
|
||||
json["bldgappr_property_assessment.taxable"],
|
||||
bldgapprPropertyAssessmentExempt:
|
||||
json["bldgappr_property_assessment.exempt"],
|
||||
bldgapprPropertyAssessmentQtr: json["bldgappr_property_assessment.qtr"],
|
||||
bldgapprPropertyAssessmentYr: json["bldgappr_property_assessment.yr"],
|
||||
bldgapprPropertyAssessmentAppraisedbyName:
|
||||
json["bldgappr_property_assessment.appraisedby_name"],
|
||||
bldgapprPropertyAssessmentAppraisedbyDate:
|
||||
json["bldgappr_property_assessment.appraisedby_date"],
|
||||
bldgapprPropertyAssessmentRecommendapprName:
|
||||
json["bldgappr_property_assessment.recommendappr_name"],
|
||||
bldgapprPropertyAssessmentRecommendapprDate:
|
||||
json["bldgappr_property_assessment.recommendappr_date"],
|
||||
bldgapprPropertyAssessmentApprovedbyName:
|
||||
json["bldgappr_property_assessment.approvedby_name"],
|
||||
bldgapprPropertyAssessmentApprovedbyDate:
|
||||
json["bldgappr_property_assessment.approvedby_date"],
|
||||
bldgapprPropertyAssessmentMemoranda:
|
||||
json["bldgappr_property_assessment.memoranda"],
|
||||
bldgapprPropertyAssessmentSwornstatementNo:
|
||||
json["bldgappr_property_assessment.swornstatement_no"],
|
||||
bldgapprPropertyAssessmentDateReceived:
|
||||
json["bldgappr_property_assessment.date_received"],
|
||||
bldgapprPropertyAssessmentEntryDateAssessment:
|
||||
json["bldgappr_property_assessment.entry_date_assessment"],
|
||||
bldgapprPropertyAssessmentEntryDateBy:
|
||||
json["bldgappr_property_assessment.entry_date_by"],
|
||||
bldgapprPropertyAssessmentGenCode:
|
||||
json["bldgappr_property_assessment.gen_code"],
|
||||
bldgapprRecSupersededassDateCreated:
|
||||
json["bldgappr_rec_supersededass.date_created"],
|
||||
bldgapprRecSupersededassDateModified:
|
||||
json["bldgappr_rec_supersededass.date_modified"],
|
||||
bldgapprRecSupersededassPin: json["bldgappr_rec_supersededass.pin"],
|
||||
bldgapprRecSupersededassTdn: json["bldgappr_rec_supersededass.tdn"],
|
||||
bldgapprRecSupersededassTotalAssval:
|
||||
json["bldgappr_rec_supersededass.total_assval"],
|
||||
bldgapprRecSupersededassOwner: json["bldgappr_rec_supersededass.owner"],
|
||||
bldgapprRecSupersededassEffectivityAss:
|
||||
json["bldgappr_rec_supersededass.effectivity_ass"],
|
||||
bldgapprRecSupersededassPageNo:
|
||||
json["bldgappr_rec_supersededass.page_no"],
|
||||
bldgapprRecSupersededassTotalMarketval:
|
||||
json["bldgappr_rec_supersededass.total_marketval"],
|
||||
bldgapprRecSupersededassTotalArea:
|
||||
json["bldgappr_rec_supersededass.total_area"],
|
||||
bldgapprRecSupersededassRecAssessment:
|
||||
json["bldgappr_rec_supersededass.rec_assessment"],
|
||||
bldgapprRecSupersededassRecTaxmapping:
|
||||
json["bldgappr_rec_supersededass.rec_taxmapping"],
|
||||
bldgapprRecSupersededassRecRecords:
|
||||
json["bldgappr_rec_supersededass.rec_records"],
|
||||
bldgapprRecSupersededassDate: json["bldgappr_rec_supersededass.date"],
|
||||
bldgapprRecSupersededassGenCode:
|
||||
json["bldgappr_rec_supersededass.gen_code"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"assessed_by_id": assessedById,
|
||||
"assessed_by_name": assessedByName,
|
||||
"date_created": dateCreated,
|
||||
"date_modified": dateModified,
|
||||
"trans_code": transCode,
|
||||
"tdn": tdn,
|
||||
"pin": pin,
|
||||
"owner": owner,
|
||||
"address": address,
|
||||
"telno": telno,
|
||||
"tin": tin,
|
||||
"admin_user": adminUser,
|
||||
"admin_address": adminAddress,
|
||||
"admin_telno": adminTelno,
|
||||
"admin_tin": adminTin,
|
||||
"faas_type": faasType,
|
||||
"gen_code": genCode,
|
||||
"bldgappr_location.date_created": bldgapprLocationDateCreated,
|
||||
"bldgappr_location.date_modified": bldgapprLocationDateModified,
|
||||
"bldgappr_location.street": bldgapprLocationStreet,
|
||||
"bldgappr_location.barangay": bldgapprLocationBarangay,
|
||||
"bldgappr_location.municipality": bldgapprLocationMunicipality,
|
||||
"bldgappr_location.province": bldgapprLocationProvince,
|
||||
"bldgappr_location.gen_code": bldgapprLocationGenCode,
|
||||
"bldgappr_landref.date_created": bldgapprLandrefDateCreated,
|
||||
"bldgappr_landref.date_modified": bldgapprLandrefDateModified,
|
||||
"bldgappr_landref.owner": bldgapprLandrefOwner,
|
||||
"bldgappr_landref.cloa_no": bldgapprLandrefCloaNo,
|
||||
"bldgappr_landref.lot_no": bldgapprLandrefLotNo,
|
||||
"bldgappr_landref.tdn": bldgapprLandrefTdn,
|
||||
"bldgappr_landref.area": bldgapprLandrefArea,
|
||||
"bldgappr_landref.survey_no": bldgapprLandrefSurveyNo,
|
||||
"bldgappr_landref.blk_no": bldgapprLandrefBlkNo,
|
||||
"bldgappr_landref.gen_code": bldgapprLandrefGenCode,
|
||||
"bldgappr_generaldesc.date_created": bldgapprGeneraldescDateCreated,
|
||||
"bldgappr_generaldesc.date_modified": bldgapprGeneraldescDateModified,
|
||||
"bldgappr_generaldesc.bldg_kind": bldgapprGeneraldescBldgKind,
|
||||
"bldgappr_generaldesc.struc_type": bldgapprGeneraldescStrucType,
|
||||
"bldgappr_generaldesc.bldg_permit": bldgapprGeneraldescBldgPermit,
|
||||
"bldgappr_generaldesc.date_issued": bldgapprGeneraldescDateIssued,
|
||||
"bldgappr_generaldesc.cct": bldgapprGeneraldescCct,
|
||||
"bldgappr_generaldesc.cert_completion_issued":
|
||||
bldgapprGeneraldescCertCompletionIssued,
|
||||
"bldgappr_generaldesc.cert_occupancy_issued":
|
||||
bldgapprGeneraldescCertOccupancyIssued,
|
||||
"bldgappr_generaldesc.date_completed": bldgapprGeneraldescDateCompleted,
|
||||
"bldgappr_generaldesc.date_occupied": bldgapprGeneraldescDateOccupied,
|
||||
"bldgappr_generaldesc.bldg_age": bldgapprGeneraldescBldgAge,
|
||||
"bldgappr_generaldesc.no_storeys": bldgapprGeneraldescNoStoreys,
|
||||
"bldgappr_generaldesc.area_1stfloor": bldgapprGeneraldescArea1Stfloor,
|
||||
"bldgappr_generaldesc.area_2ndfloor": bldgapprGeneraldescArea2Ndfloor,
|
||||
"bldgappr_generaldesc.area_3rdfloor": bldgapprGeneraldescArea3Rdfloor,
|
||||
"bldgappr_generaldesc.area_4thfloor": bldgapprGeneraldescArea4Thfloor,
|
||||
"bldgappr_generaldesc.total_floor_area":
|
||||
bldgapprGeneraldescTotalFloorArea,
|
||||
"bldgappr_generaldesc.floor_sketch": bldgapprGeneraldescFloorSketch,
|
||||
"bldgappr_generaldesc.actual_use": bldgapprGeneraldescActualUse,
|
||||
"bldgappr_generaldesc.unit_value": bldgapprGeneraldescUnitValue,
|
||||
"bldgappr_generaldesc.gen_code": bldgapprGeneraldescGenCode,
|
||||
"bldgappr_struct_materials.date_created":
|
||||
bldgapprStructMaterialsDateCreated,
|
||||
"bldgappr_struct_materials.date_modified":
|
||||
bldgapprStructMaterialsDateModified,
|
||||
"bldgappr_struct_materials.foundation":
|
||||
bldgapprStructMaterialsFoundation,
|
||||
"bldgappr_struct_materials.columns": bldgapprStructMaterialsColumns,
|
||||
"bldgappr_struct_materials.beams": bldgapprStructMaterialsBeams,
|
||||
"bldgappr_struct_materials.truss_framing":
|
||||
bldgapprStructMaterialsTrussFraming,
|
||||
"bldgappr_struct_materials.roof": bldgapprStructMaterialsRoof,
|
||||
"bldgappr_struct_materials.flooring": bldgapprStructMaterialsFlooring,
|
||||
"bldgappr_struct_materials.walls": bldgapprStructMaterialsWalls,
|
||||
"bldgappr_struct_materials.others": bldgapprStructMaterialsOthers,
|
||||
"bldgappr_struct_materials.gen_code": bldgapprStructMaterialsGenCode,
|
||||
"bldgappr_property_assessment.date_created":
|
||||
bldgapprPropertyAssessmentDateCreated,
|
||||
"bldgappr_property_assessment.date_modified":
|
||||
bldgapprPropertyAssessmentDateModified,
|
||||
"bldgappr_property_assessment.actual_use":
|
||||
bldgapprPropertyAssessmentActualUse,
|
||||
"bldgappr_property_assessment.market_value":
|
||||
bldgapprPropertyAssessmentMarketValue,
|
||||
"bldgappr_property_assessment.assessment_level":
|
||||
bldgapprPropertyAssessmentAssessmentLevel,
|
||||
"bldgappr_property_assessment.assessed_value":
|
||||
bldgapprPropertyAssessmentAssessedValue,
|
||||
"bldgappr_property_assessment.taxable":
|
||||
bldgapprPropertyAssessmentTaxable,
|
||||
"bldgappr_property_assessment.exempt": bldgapprPropertyAssessmentExempt,
|
||||
"bldgappr_property_assessment.qtr": bldgapprPropertyAssessmentQtr,
|
||||
"bldgappr_property_assessment.yr": bldgapprPropertyAssessmentYr,
|
||||
"bldgappr_property_assessment.appraisedby_name":
|
||||
bldgapprPropertyAssessmentAppraisedbyName,
|
||||
"bldgappr_property_assessment.appraisedby_date":
|
||||
bldgapprPropertyAssessmentAppraisedbyDate,
|
||||
"bldgappr_property_assessment.recommendappr_name":
|
||||
bldgapprPropertyAssessmentRecommendapprName,
|
||||
"bldgappr_property_assessment.recommendappr_date":
|
||||
bldgapprPropertyAssessmentRecommendapprDate,
|
||||
"bldgappr_property_assessment.approvedby_name":
|
||||
bldgapprPropertyAssessmentApprovedbyName,
|
||||
"bldgappr_property_assessment.approvedby_date":
|
||||
bldgapprPropertyAssessmentApprovedbyDate,
|
||||
"bldgappr_property_assessment.memoranda":
|
||||
bldgapprPropertyAssessmentMemoranda,
|
||||
"bldgappr_property_assessment.swornstatement_no":
|
||||
bldgapprPropertyAssessmentSwornstatementNo,
|
||||
"bldgappr_property_assessment.date_received":
|
||||
bldgapprPropertyAssessmentDateReceived,
|
||||
"bldgappr_property_assessment.entry_date_assessment":
|
||||
bldgapprPropertyAssessmentEntryDateAssessment,
|
||||
"bldgappr_property_assessment.entry_date_by":
|
||||
bldgapprPropertyAssessmentEntryDateBy,
|
||||
"bldgappr_property_assessment.gen_code":
|
||||
bldgapprPropertyAssessmentGenCode,
|
||||
"bldgappr_rec_supersededass.date_created":
|
||||
bldgapprRecSupersededassDateCreated,
|
||||
"bldgappr_rec_supersededass.date_modified":
|
||||
bldgapprRecSupersededassDateModified,
|
||||
"bldgappr_rec_supersededass.pin": bldgapprRecSupersededassPin,
|
||||
"bldgappr_rec_supersededass.tdn": bldgapprRecSupersededassTdn,
|
||||
"bldgappr_rec_supersededass.total_assval":
|
||||
bldgapprRecSupersededassTotalAssval,
|
||||
"bldgappr_rec_supersededass.owner": bldgapprRecSupersededassOwner,
|
||||
"bldgappr_rec_supersededass.effectivity_ass":
|
||||
bldgapprRecSupersededassEffectivityAss,
|
||||
"bldgappr_rec_supersededass.page_no": bldgapprRecSupersededassPageNo,
|
||||
"bldgappr_rec_supersededass.total_marketval":
|
||||
bldgapprRecSupersededassTotalMarketval,
|
||||
"bldgappr_rec_supersededass.total_area":
|
||||
bldgapprRecSupersededassTotalArea,
|
||||
"bldgappr_rec_supersededass.rec_assessment":
|
||||
bldgapprRecSupersededassRecAssessment,
|
||||
"bldgappr_rec_supersededass.rec_taxmapping":
|
||||
bldgapprRecSupersededassRecTaxmapping,
|
||||
"bldgappr_rec_supersededass.rec_records":
|
||||
bldgapprRecSupersededassRecRecords,
|
||||
"bldgappr_rec_supersededass.date": bldgapprRecSupersededassDate,
|
||||
"bldgappr_rec_supersededass.gen_code": bldgapprRecSupersededassGenCode,
|
||||
};
|
||||
}
|
|
@ -12,35 +12,37 @@ class City {
|
|||
final int? id;
|
||||
final String? cityCode;
|
||||
final String? cityDescription;
|
||||
final String? genCode;
|
||||
|
||||
City({
|
||||
this.id,
|
||||
this.cityCode,
|
||||
this.cityDescription,
|
||||
});
|
||||
City({this.id, this.cityCode, this.cityDescription, this.genCode});
|
||||
|
||||
City copy({int? id, String? cityCode, String? cityDescription}) {
|
||||
City copy(
|
||||
{int? id, String? cityCode, String? cityDescription, String? genCode}) {
|
||||
return City(
|
||||
id: id ?? this.id,
|
||||
cityCode: cityCode ?? this.cityCode,
|
||||
cityDescription: cityDescription ?? this.cityDescription);
|
||||
id: id ?? this.id,
|
||||
cityCode: cityCode ?? this.cityCode,
|
||||
cityDescription: cityDescription ?? this.cityDescription,
|
||||
genCode: genCode ?? this.genCode,
|
||||
);
|
||||
}
|
||||
|
||||
factory City.fromJson(Map<String, dynamic> json) => City(
|
||||
id: json["id"],
|
||||
cityCode: json["city_code"],
|
||||
cityDescription: json["city_description"],
|
||||
genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
factory City.fromJson2(Map<String, dynamic> json) => City(
|
||||
id: json["id"],
|
||||
cityCode: json["cityCode"],
|
||||
cityDescription: json["cityDescription"],
|
||||
);
|
||||
id: json["id"],
|
||||
cityCode: json["cityCode"],
|
||||
cityDescription: json["cityDescription"],
|
||||
genCode: json["genCode"]);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"city_code": cityCode,
|
||||
"city_description": cityDescription,
|
||||
"gen_code": genCode
|
||||
};
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ class ClassComponentsOffline {
|
|||
final String? roughFinish;
|
||||
final String? highFinish;
|
||||
final int? withoutBucc;
|
||||
// final String? genCode;
|
||||
|
||||
ClassComponentsOffline({
|
||||
this.id,
|
||||
|
@ -48,6 +49,7 @@ class ClassComponentsOffline {
|
|||
this.roughFinish,
|
||||
this.highFinish,
|
||||
this.withoutBucc,
|
||||
// this.genCode
|
||||
});
|
||||
|
||||
ClassComponentsOffline copy({
|
||||
|
@ -68,6 +70,7 @@ class ClassComponentsOffline {
|
|||
String? roughFinish,
|
||||
String? highFinish,
|
||||
int? withoutBucc,
|
||||
// String? genCode,
|
||||
}) {
|
||||
return ClassComponentsOffline(
|
||||
id: id ?? this.id,
|
||||
|
@ -89,6 +92,7 @@ class ClassComponentsOffline {
|
|||
roughFinish: roughFinish ?? this.roughFinish,
|
||||
highFinish: highFinish ?? this.highFinish,
|
||||
withoutBucc: withoutBucc ?? this.withoutBucc,
|
||||
// genCode: genCode ?? this.genCode,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -111,6 +115,7 @@ class ClassComponentsOffline {
|
|||
roughFinish: json["rough_finish"],
|
||||
highFinish: json["high_finish"],
|
||||
withoutBucc: json["without_bucc"],
|
||||
// genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
factory ClassComponentsOffline.fromJson2(Map<String, dynamic> json) =>
|
||||
|
@ -132,6 +137,7 @@ class ClassComponentsOffline {
|
|||
roughFinish: json["roughFinish"],
|
||||
highFinish: json["highFinish"],
|
||||
withoutBucc: json["withoutBucc"],
|
||||
// genCode: json["genCode"]
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -152,5 +158,6 @@ class ClassComponentsOffline {
|
|||
"rough_finish": roughFinish,
|
||||
"high_finish": highFinish,
|
||||
"without_bucc": withoutBucc,
|
||||
// "gen_code": genCode
|
||||
};
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ class ClassComponents {
|
|||
final String roughFinish;
|
||||
final String highFinish;
|
||||
final bool withoutBucc;
|
||||
// final String genCode;
|
||||
|
||||
ClassComponents({
|
||||
required this.id,
|
||||
|
@ -48,6 +49,7 @@ class ClassComponents {
|
|||
required this.roughFinish,
|
||||
required this.highFinish,
|
||||
required this.withoutBucc,
|
||||
// required this.genCode,
|
||||
});
|
||||
|
||||
factory ClassComponents.fromJson(Map<String, dynamic> json) =>
|
||||
|
@ -69,6 +71,7 @@ class ClassComponents {
|
|||
roughFinish: json["rough_finish"],
|
||||
highFinish: json["high_finish"],
|
||||
withoutBucc: json["without_bucc"],
|
||||
// genCode: json["gen_code"]
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -89,5 +92,6 @@ class ClassComponents {
|
|||
"rough_finish": roughFinish,
|
||||
"high_finish": highFinish,
|
||||
"without_bucc": withoutBucc,
|
||||
// "gen_code": genCode,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -35,86 +35,93 @@ class GeneralDesc {
|
|||
final dynamic floorSketch;
|
||||
final String? actualUse;
|
||||
final String? unitValue;
|
||||
final String? genCode;
|
||||
|
||||
GeneralDesc(
|
||||
{this.id,
|
||||
this.bldgapprDetailsId,
|
||||
this.assessedById,
|
||||
this.assessedByName,
|
||||
this.dateCreated,
|
||||
this.dateModified,
|
||||
this.bldgKind,
|
||||
this.strucType,
|
||||
this.bldgPermit,
|
||||
this.dateIssued,
|
||||
this.cct,
|
||||
this.certCompletionIssued,
|
||||
this.certOccupancyIssued,
|
||||
this.dateCompleted,
|
||||
this.dateOccupied,
|
||||
this.bldgAge,
|
||||
this.noStoreys,
|
||||
this.area1Stfloor,
|
||||
this.area2Ndfloor,
|
||||
this.area3Rdfloor,
|
||||
this.area4Thfloor,
|
||||
this.totalFloorArea,
|
||||
this.floorSketch,
|
||||
this.actualUse,
|
||||
this.unitValue});
|
||||
GeneralDesc({
|
||||
this.id,
|
||||
this.bldgapprDetailsId,
|
||||
this.assessedById,
|
||||
this.assessedByName,
|
||||
this.dateCreated,
|
||||
this.dateModified,
|
||||
this.bldgKind,
|
||||
this.strucType,
|
||||
this.bldgPermit,
|
||||
this.dateIssued,
|
||||
this.cct,
|
||||
this.certCompletionIssued,
|
||||
this.certOccupancyIssued,
|
||||
this.dateCompleted,
|
||||
this.dateOccupied,
|
||||
this.bldgAge,
|
||||
this.noStoreys,
|
||||
this.area1Stfloor,
|
||||
this.area2Ndfloor,
|
||||
this.area3Rdfloor,
|
||||
this.area4Thfloor,
|
||||
this.totalFloorArea,
|
||||
this.floorSketch,
|
||||
this.actualUse,
|
||||
this.unitValue,
|
||||
this.genCode,
|
||||
});
|
||||
|
||||
GeneralDesc copy(
|
||||
{int? id,
|
||||
int? bldgapprDetailsId,
|
||||
String? assessedById,
|
||||
String? assessedByName,
|
||||
String? dateCreated,
|
||||
String? dateModified,
|
||||
String? bldgKind,
|
||||
String? strucType,
|
||||
String? bldgPermit,
|
||||
String? dateIssued,
|
||||
String? cct,
|
||||
String? certCompletionIssued,
|
||||
String? certOccupancyIssued,
|
||||
String? dateCompleted,
|
||||
String? dateOccupied,
|
||||
String? bldgAge,
|
||||
String? noStoreys,
|
||||
String? area1Stfloor,
|
||||
String? area2Ndfloor,
|
||||
String? area3Rdfloor,
|
||||
String? area4Thfloor,
|
||||
String? totalFloorArea,
|
||||
dynamic floorSketch,
|
||||
String? actualUse,
|
||||
String? unitValue}) {
|
||||
GeneralDesc copy({
|
||||
int? id,
|
||||
int? bldgapprDetailsId,
|
||||
String? assessedById,
|
||||
String? assessedByName,
|
||||
String? dateCreated,
|
||||
String? dateModified,
|
||||
String? bldgKind,
|
||||
String? strucType,
|
||||
String? bldgPermit,
|
||||
String? dateIssued,
|
||||
String? cct,
|
||||
String? certCompletionIssued,
|
||||
String? certOccupancyIssued,
|
||||
String? dateCompleted,
|
||||
String? dateOccupied,
|
||||
String? bldgAge,
|
||||
String? noStoreys,
|
||||
String? area1Stfloor,
|
||||
String? area2Ndfloor,
|
||||
String? area3Rdfloor,
|
||||
String? area4Thfloor,
|
||||
String? totalFloorArea,
|
||||
dynamic floorSketch,
|
||||
String? actualUse,
|
||||
String? unitValue,
|
||||
String? genCode,
|
||||
}) {
|
||||
return GeneralDesc(
|
||||
id: id ?? this.id,
|
||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||
assessedById: assessedById ?? this.assessedById,
|
||||
assessedByName: assessedByName ?? this.assessedByName,
|
||||
dateCreated: dateCreated ?? this.dateCreated,
|
||||
dateModified: dateModified ?? this.dateModified,
|
||||
bldgKind: bldgKind ?? this.bldgKind,
|
||||
strucType: strucType ?? this.strucType,
|
||||
bldgPermit: bldgPermit ?? this.bldgPermit,
|
||||
dateIssued: dateIssued ?? this.dateIssued,
|
||||
cct: cct ?? this.cct,
|
||||
certCompletionIssued: certCompletionIssued ?? this.certCompletionIssued,
|
||||
certOccupancyIssued: certOccupancyIssued ?? this.certOccupancyIssued,
|
||||
dateCompleted: dateCompleted ?? this.dateCompleted,
|
||||
dateOccupied: dateOccupied ?? this.dateOccupied,
|
||||
bldgAge: bldgAge ?? this.bldgAge,
|
||||
noStoreys: noStoreys ?? this.noStoreys,
|
||||
area1Stfloor: area1Stfloor ?? this.area1Stfloor,
|
||||
area2Ndfloor: area2Ndfloor ?? this.area2Ndfloor,
|
||||
area3Rdfloor: area3Rdfloor ?? this.area3Rdfloor,
|
||||
area4Thfloor: area4Thfloor ?? this.area4Thfloor,
|
||||
totalFloorArea: totalFloorArea ?? this.totalFloorArea,
|
||||
floorSketch: floorSketch ?? this.floorSketch,
|
||||
actualUse: actualUse ?? this.actualUse,
|
||||
unitValue: unitValue ?? this.unitValue);
|
||||
id: id ?? this.id,
|
||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||
assessedById: assessedById ?? this.assessedById,
|
||||
assessedByName: assessedByName ?? this.assessedByName,
|
||||
dateCreated: dateCreated ?? this.dateCreated,
|
||||
dateModified: dateModified ?? this.dateModified,
|
||||
bldgKind: bldgKind ?? this.bldgKind,
|
||||
strucType: strucType ?? this.strucType,
|
||||
bldgPermit: bldgPermit ?? this.bldgPermit,
|
||||
dateIssued: dateIssued ?? this.dateIssued,
|
||||
cct: cct ?? this.cct,
|
||||
certCompletionIssued: certCompletionIssued ?? this.certCompletionIssued,
|
||||
certOccupancyIssued: certOccupancyIssued ?? this.certOccupancyIssued,
|
||||
dateCompleted: dateCompleted ?? this.dateCompleted,
|
||||
dateOccupied: dateOccupied ?? this.dateOccupied,
|
||||
bldgAge: bldgAge ?? this.bldgAge,
|
||||
noStoreys: noStoreys ?? this.noStoreys,
|
||||
area1Stfloor: area1Stfloor ?? this.area1Stfloor,
|
||||
area2Ndfloor: area2Ndfloor ?? this.area2Ndfloor,
|
||||
area3Rdfloor: area3Rdfloor ?? this.area3Rdfloor,
|
||||
area4Thfloor: area4Thfloor ?? this.area4Thfloor,
|
||||
totalFloorArea: totalFloorArea ?? this.totalFloorArea,
|
||||
floorSketch: floorSketch ?? this.floorSketch,
|
||||
actualUse: actualUse ?? this.actualUse,
|
||||
unitValue: unitValue ?? this.unitValue,
|
||||
genCode: genCode ?? this.genCode,
|
||||
);
|
||||
}
|
||||
|
||||
factory GeneralDesc.fromJson(Map<String, dynamic> json) => GeneralDesc(
|
||||
|
@ -142,7 +149,8 @@ class GeneralDesc {
|
|||
totalFloorArea: json["total_floor_area"],
|
||||
floorSketch: json["floor_sketch"],
|
||||
actualUse: json["actual_use"],
|
||||
unitValue: json["unit_value"]);
|
||||
unitValue: json["unit_value"],
|
||||
genCode: json["gen_code"]);
|
||||
|
||||
factory GeneralDesc.fromJson2(Map<String, dynamic> json) => GeneralDesc(
|
||||
id: json["id"],
|
||||
|
@ -169,7 +177,8 @@ class GeneralDesc {
|
|||
totalFloorArea: json["totalFloorArea"],
|
||||
floorSketch: json["floorSketch"],
|
||||
actualUse: json["actualUse"],
|
||||
unitValue: json["unitValue"]);
|
||||
unitValue: json["unitValue"],
|
||||
genCode: json["gen_code"]);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
|
@ -196,6 +205,7 @@ class GeneralDesc {
|
|||
"total_floor_area": totalFloorArea,
|
||||
"floor_sketch": floorSketch,
|
||||
"actual_use": actualUse,
|
||||
"unit_value": unitValue
|
||||
"unit_value": unitValue,
|
||||
"gen_code": genCode,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -30,6 +30,9 @@ class LandExt {
|
|||
final String? dateReceived;
|
||||
final String? entryDateAssessment;
|
||||
final String? entryDateBy;
|
||||
final String? appraisedbyDesignation;
|
||||
final String? recommendapprDesignation;
|
||||
final String? approvedbyDesignation;
|
||||
|
||||
LandExt({
|
||||
this.id,
|
||||
|
@ -53,6 +56,9 @@ class LandExt {
|
|||
this.dateReceived,
|
||||
this.entryDateAssessment,
|
||||
this.entryDateBy,
|
||||
this.appraisedbyDesignation,
|
||||
this.recommendapprDesignation,
|
||||
this.approvedbyDesignation,
|
||||
});
|
||||
|
||||
LandExt copy({
|
||||
|
@ -77,6 +83,9 @@ class LandExt {
|
|||
final String? dateReceived,
|
||||
final String? entryDateAssessment,
|
||||
final String? entryDateBy,
|
||||
final String? appraisedbyDesignation,
|
||||
final String? recommendapprDesignation,
|
||||
final String? approvedbyDesignation,
|
||||
}) {
|
||||
return LandExt(
|
||||
id: id ?? this.id,
|
||||
|
@ -100,6 +109,12 @@ class LandExt {
|
|||
dateReceived: dateReceived ?? this.dateReceived,
|
||||
entryDateAssessment: entryDateAssessment ?? this.entryDateAssessment,
|
||||
entryDateBy: entryDateBy ?? this.entryDateBy,
|
||||
appraisedbyDesignation:
|
||||
appraisedbyDesignation ?? this.appraisedbyDesignation,
|
||||
recommendapprDesignation:
|
||||
recommendapprDesignation ?? this.recommendapprDesignation,
|
||||
approvedbyDesignation:
|
||||
approvedbyDesignation ?? this.approvedbyDesignation,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -125,6 +140,9 @@ class LandExt {
|
|||
dateReceived: json["date_received"],
|
||||
entryDateAssessment: json["entry_date_assessment"],
|
||||
entryDateBy: json["entry_date_by"],
|
||||
appraisedbyDesignation: json["appraisedby_designation"],
|
||||
recommendapprDesignation: json["recommendappr_designation"],
|
||||
approvedbyDesignation: json["approvedby_designation"],
|
||||
);
|
||||
|
||||
factory LandExt.fromJson2(Map<String, dynamic> json) => LandExt(
|
||||
|
@ -149,6 +167,9 @@ class LandExt {
|
|||
dateReceived: json["dateReceived"],
|
||||
entryDateAssessment: json["entryDateAssessment"],
|
||||
entryDateBy: json["entryDateBy"],
|
||||
appraisedbyDesignation: json["appraisedby_designation"],
|
||||
recommendapprDesignation: json["recommendappr_designation"],
|
||||
approvedbyDesignation: json["approvedby_designation"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -173,5 +194,8 @@ class LandExt {
|
|||
"date_received": dateReceived,
|
||||
"entry_date_assessment": entryDateAssessment,
|
||||
"entry_date_by": entryDateBy,
|
||||
"appraisedby_designation": appraisedbyDesignation,
|
||||
"recommendappr_designation": recommendapprDesignation,
|
||||
"approvedby_designation": approvedbyDesignation,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ class LandRef {
|
|||
final int? bldgapprDetailsId;
|
||||
final String? assessedById;
|
||||
final String? assessedByName;
|
||||
final DateTime? dateCreated;
|
||||
final DateTime? dateModified;
|
||||
final String? dateCreated;
|
||||
final String? dateModified;
|
||||
final dynamic owner;
|
||||
final dynamic cloaNo;
|
||||
final dynamic lotNo;
|
||||
|
@ -22,6 +22,7 @@ class LandRef {
|
|||
final dynamic area;
|
||||
final dynamic surveyNo;
|
||||
final dynamic blkNo;
|
||||
final String? genCode;
|
||||
|
||||
LandRef({
|
||||
this.id,
|
||||
|
@ -37,6 +38,7 @@ class LandRef {
|
|||
this.area,
|
||||
this.surveyNo,
|
||||
this.blkNo,
|
||||
this.genCode,
|
||||
});
|
||||
|
||||
LandRef copy({
|
||||
|
@ -44,8 +46,8 @@ class LandRef {
|
|||
int? bldgapprDetailsId,
|
||||
String? assessedById,
|
||||
String? assessedByName,
|
||||
DateTime? dateCreated,
|
||||
DateTime? dateModified,
|
||||
String? dateCreated,
|
||||
String? dateModified,
|
||||
String? owner,
|
||||
String? cloaNo,
|
||||
String? lotNo,
|
||||
|
@ -53,6 +55,7 @@ class LandRef {
|
|||
String? area,
|
||||
String? surveyNo,
|
||||
String? blkNo,
|
||||
String? genCode,
|
||||
}) {
|
||||
return LandRef(
|
||||
id: id ?? this.id,
|
||||
|
@ -68,40 +71,32 @@ class LandRef {
|
|||
area: area ?? this.area,
|
||||
surveyNo: surveyNo ?? this.surveyNo,
|
||||
blkNo: blkNo ?? this.blkNo,
|
||||
genCode: genCode ?? this.genCode,
|
||||
);
|
||||
}
|
||||
|
||||
factory LandRef.fromJson(Map<String, dynamic> json) => LandRef(
|
||||
id: json["id"],
|
||||
bldgapprDetailsId: json["bldgappr_details_id"],
|
||||
assessedById: json["assessed_by_id"],
|
||||
assessedByName: json["assessed_by_name"],
|
||||
dateCreated: json["date_created"] == null
|
||||
? null
|
||||
: DateTime.parse(json["date_created"]),
|
||||
dateModified: json["date_modified"] == null
|
||||
? null
|
||||
: DateTime.parse(json["date_modified"]),
|
||||
owner: json["owner"],
|
||||
cloaNo: json["cloa_no"],
|
||||
lotNo: json["lot_no"],
|
||||
tdn: json["tdn"],
|
||||
area: json["area"],
|
||||
surveyNo: json["survey_no"],
|
||||
blkNo: json["blk_no"],
|
||||
);
|
||||
id: json["id"],
|
||||
bldgapprDetailsId: json["bldgappr_details_id"],
|
||||
assessedById: json["assessed_by_id"],
|
||||
assessedByName: json["assessed_by_name"],
|
||||
dateCreated: json["date_created"],
|
||||
owner: json["owner"],
|
||||
cloaNo: json["cloa_no"],
|
||||
lotNo: json["lot_no"],
|
||||
tdn: json["tdn"],
|
||||
area: json["area"],
|
||||
surveyNo: json["survey_no"],
|
||||
blkNo: json["blk_no"],
|
||||
genCode: json["gen_code"]);
|
||||
|
||||
factory LandRef.fromJson2(Map<String, dynamic> json) => LandRef(
|
||||
id: json["id"],
|
||||
bldgapprDetailsId: json["bldgapprDetailsId"],
|
||||
assessedById: json["assessedById"],
|
||||
assessedByName: json["assessedByName"],
|
||||
dateCreated: json["dateCreated"] == null
|
||||
? null
|
||||
: DateTime.parse(json["dateCreated"]),
|
||||
dateModified: json["dateModified"] == null
|
||||
? null
|
||||
: DateTime.parse(json["dateModified"]),
|
||||
dateCreated: json["dateCreated"],
|
||||
dateModified: json["dateModified"],
|
||||
owner: json["owner"],
|
||||
cloaNo: json["cloaNo"],
|
||||
lotNo: json["lotNo"],
|
||||
|
@ -109,6 +104,7 @@ class LandRef {
|
|||
area: json["area"],
|
||||
surveyNo: json["surveyNo"],
|
||||
blkNo: json["blkNo"],
|
||||
genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -116,8 +112,8 @@ class LandRef {
|
|||
"bldgappr_details_id": bldgapprDetailsId,
|
||||
"assessed_by_id": assessedById,
|
||||
"assessed_by_name": assessedByName,
|
||||
"date_created": dateCreated?.toIso8601String(),
|
||||
"date_modified": dateModified?.toIso8601String(),
|
||||
"date_created": dateCreated,
|
||||
"date_modified": dateModified,
|
||||
"owner": owner,
|
||||
"cloa_no": cloaNo,
|
||||
"lot_no": lotNo,
|
||||
|
@ -125,5 +121,6 @@ class LandRef {
|
|||
"area": area,
|
||||
"survey_no": surveyNo,
|
||||
"blk_no": blkNo,
|
||||
"gen_code": genCode,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -12,39 +12,44 @@ class Memoranda {
|
|||
final int? id;
|
||||
final String? code;
|
||||
final String? memoranda;
|
||||
final String? genCode;
|
||||
|
||||
Memoranda({
|
||||
this.id,
|
||||
this.code,
|
||||
this.memoranda,
|
||||
this.genCode,
|
||||
});
|
||||
|
||||
Memoranda copy({
|
||||
int? id,
|
||||
String? code,
|
||||
String? memoranda,
|
||||
String? genCode,
|
||||
}) {
|
||||
return Memoranda(
|
||||
id: id ?? this.id,
|
||||
code: code ?? this.code,
|
||||
memoranda: memoranda ?? this.memoranda);
|
||||
memoranda: memoranda ?? this.memoranda,
|
||||
genCode: genCode ?? this.genCode);
|
||||
}
|
||||
|
||||
factory Memoranda.fromJson(Map<String, dynamic> json) => Memoranda(
|
||||
id: json["id"],
|
||||
code: json["code"],
|
||||
memoranda: json["memoranda"],
|
||||
);
|
||||
id: json["id"],
|
||||
code: json["code"],
|
||||
memoranda: json["memoranda"],
|
||||
genCode: json["gen_code"]);
|
||||
|
||||
factory Memoranda.fromJson2(Map<String, dynamic> json) => Memoranda(
|
||||
id: json["id"],
|
||||
code: json["code"],
|
||||
memoranda: json["memoranda"],
|
||||
);
|
||||
id: json["id"],
|
||||
code: json["code"],
|
||||
memoranda: json["memoranda"],
|
||||
genCode: json["genCode"]);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"code": code,
|
||||
"memoranda": memoranda,
|
||||
"gen_code": genCode,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,6 +14,10 @@ String propertyAssessmentToJson(PropertyAssessment data) =>
|
|||
class PropertyAssessment {
|
||||
final int id;
|
||||
final int bldgapprDetailsId;
|
||||
final String? assessedById;
|
||||
final String? assessedByName;
|
||||
final String? dateCreated;
|
||||
final String? dateModified;
|
||||
final String actualUse;
|
||||
final String marketValue;
|
||||
final String assessmentLevel;
|
||||
|
@ -32,10 +36,19 @@ class PropertyAssessment {
|
|||
final String dateReceived;
|
||||
final String entryDateAssessment;
|
||||
final String entryDateBy;
|
||||
final String genCode;
|
||||
final String note;
|
||||
final String? appraisedbyDesignation;
|
||||
final String? recommendapprDesignation;
|
||||
final String? approvedbyDesignation;
|
||||
|
||||
PropertyAssessment({
|
||||
required this.id,
|
||||
required this.bldgapprDetailsId,
|
||||
required this.assessedById,
|
||||
required this.assessedByName,
|
||||
required this.dateCreated,
|
||||
required this.dateModified,
|
||||
required this.actualUse,
|
||||
required this.marketValue,
|
||||
required this.assessmentLevel,
|
||||
|
@ -54,11 +67,21 @@ class PropertyAssessment {
|
|||
required this.dateReceived,
|
||||
required this.entryDateAssessment,
|
||||
required this.entryDateBy,
|
||||
required this.genCode,
|
||||
required this.note,
|
||||
required this.appraisedbyDesignation,
|
||||
required this.recommendapprDesignation,
|
||||
required this.approvedbyDesignation,
|
||||
});
|
||||
|
||||
PropertyAssessment copy({
|
||||
int? id,
|
||||
int? bldgapprDetailsId,
|
||||
String? ass,
|
||||
String? assessedById,
|
||||
String? assessedByName,
|
||||
String? dateCreated,
|
||||
String? dateModified,
|
||||
String? actualUse,
|
||||
String? marketValue,
|
||||
String? assessmentLevel,
|
||||
|
@ -77,10 +100,19 @@ class PropertyAssessment {
|
|||
String? dateReceived,
|
||||
String? entryDateAssessment,
|
||||
String? entryDateBy,
|
||||
String? genCode,
|
||||
String? note,
|
||||
String? appraisedbyDesignation,
|
||||
String? recommendapprDesignation,
|
||||
String? approvedbyDesignation,
|
||||
}) =>
|
||||
PropertyAssessment(
|
||||
id: id ?? this.id,
|
||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||
assessedById: assessedById ?? this.assessedById,
|
||||
assessedByName: assessedByName ?? this.assessedByName,
|
||||
dateCreated: dateCreated ?? this.dateCreated,
|
||||
dateModified: dateModified ?? this.dateModified,
|
||||
actualUse: actualUse ?? this.actualUse,
|
||||
marketValue: marketValue ?? this.marketValue,
|
||||
assessmentLevel: assessmentLevel ?? this.assessmentLevel,
|
||||
|
@ -99,12 +131,24 @@ class PropertyAssessment {
|
|||
dateReceived: dateReceived ?? this.dateReceived,
|
||||
entryDateAssessment: entryDateAssessment ?? this.entryDateAssessment,
|
||||
entryDateBy: entryDateBy ?? this.entryDateBy,
|
||||
genCode: genCode ?? this.genCode,
|
||||
note: note ?? this.note,
|
||||
appraisedbyDesignation:
|
||||
appraisedbyDesignation ?? this.appraisedbyDesignation,
|
||||
recommendapprDesignation:
|
||||
recommendapprDesignation ?? this.recommendapprDesignation,
|
||||
approvedbyDesignation:
|
||||
approvedbyDesignation ?? this.approvedbyDesignation,
|
||||
);
|
||||
|
||||
factory PropertyAssessment.fromJson(Map<String, dynamic> json) =>
|
||||
PropertyAssessment(
|
||||
id: json["id"],
|
||||
bldgapprDetailsId: json["bldgappr_details_id"],
|
||||
assessedById: json["assessed_by_id"],
|
||||
assessedByName: json["assessed_by_name"],
|
||||
dateCreated: json["date_created"],
|
||||
dateModified: json["date_modified"],
|
||||
actualUse: json["actual_use"],
|
||||
marketValue: json["market_value"],
|
||||
assessmentLevel: json["assessment_level"],
|
||||
|
@ -123,12 +167,21 @@ class PropertyAssessment {
|
|||
dateReceived: json["date_received"],
|
||||
entryDateAssessment: json["entry_date_assessment"],
|
||||
entryDateBy: json["entry_date_by"],
|
||||
genCode: json["gen_code"],
|
||||
note: json["note"],
|
||||
appraisedbyDesignation: json["appraisedby_designation"],
|
||||
recommendapprDesignation: json["recommendappr_designation"],
|
||||
approvedbyDesignation: json["approvedby_designation"],
|
||||
);
|
||||
|
||||
factory PropertyAssessment.fromJson2(Map<String, dynamic> json) =>
|
||||
PropertyAssessment(
|
||||
id: json["id"],
|
||||
bldgapprDetailsId: json["bldgapprDetailsId"],
|
||||
assessedById: json["assessedById"],
|
||||
assessedByName: json["assessedByName"],
|
||||
dateCreated: json["dateCreated"],
|
||||
dateModified: json["dateModified"],
|
||||
actualUse: json["actualUse"],
|
||||
marketValue: json["marketValue"],
|
||||
assessmentLevel: json["assessmentLevel"],
|
||||
|
@ -147,11 +200,20 @@ class PropertyAssessment {
|
|||
dateReceived: json["dateReceived"],
|
||||
entryDateAssessment: json["entryDateAssessment"],
|
||||
entryDateBy: json["entryDateBy"],
|
||||
genCode: json["gen_code"],
|
||||
note: json["note"],
|
||||
appraisedbyDesignation: json["appraisedby_designation"],
|
||||
recommendapprDesignation: json["recommendappr_designation"],
|
||||
approvedbyDesignation: json["approvedby_designation"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"bldgappr_details_id": bldgapprDetailsId,
|
||||
"assessed_by_id": assessedById,
|
||||
"assessed_by_name": assessedByName,
|
||||
"date_created": dateCreated,
|
||||
"date_modified": dateModified,
|
||||
"actual_use": actualUse,
|
||||
"market_value": marketValue,
|
||||
"assessment_level": assessmentLevel,
|
||||
|
@ -169,5 +231,10 @@ class PropertyAssessment {
|
|||
"swornstatement_no": swornstatementNo,
|
||||
"date_received": dateReceived,
|
||||
"entry_date_by": entryDateBy,
|
||||
"gen_code": genCode,
|
||||
"note": note,
|
||||
"appraisedby_designation": appraisedbyDesignation,
|
||||
"recommendappr_designation": recommendapprDesignation,
|
||||
"approvedby_designation": approvedbyDesignation,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -18,7 +18,10 @@ class PropertyInfo {
|
|||
final String? transCode;
|
||||
final String? tdn;
|
||||
final String? pin;
|
||||
final String? owner;
|
||||
final String? fname;
|
||||
final String? mname;
|
||||
final String? lname;
|
||||
final String? bday;
|
||||
final String? address;
|
||||
final String? telno;
|
||||
final String? tin;
|
||||
|
@ -27,6 +30,7 @@ class PropertyInfo {
|
|||
final String? adminTelno;
|
||||
final String? adminTin;
|
||||
final String? faasType;
|
||||
final String? genCode;
|
||||
|
||||
PropertyInfo({
|
||||
this.id,
|
||||
|
@ -37,7 +41,10 @@ class PropertyInfo {
|
|||
this.transCode,
|
||||
this.tdn,
|
||||
this.pin,
|
||||
this.owner,
|
||||
this.fname,
|
||||
this.mname,
|
||||
this.lname,
|
||||
this.bday,
|
||||
this.address,
|
||||
this.telno,
|
||||
this.tin,
|
||||
|
@ -46,6 +53,7 @@ class PropertyInfo {
|
|||
this.adminTelno,
|
||||
this.adminTin,
|
||||
this.faasType,
|
||||
this.genCode,
|
||||
});
|
||||
|
||||
PropertyInfo copy({
|
||||
|
@ -66,6 +74,7 @@ class PropertyInfo {
|
|||
String? adminTelno,
|
||||
String? adminTin,
|
||||
String? faasType,
|
||||
String? genCode,
|
||||
}) =>
|
||||
PropertyInfo(
|
||||
id: id ?? this.id,
|
||||
|
@ -76,7 +85,10 @@ class PropertyInfo {
|
|||
transCode: transCode ?? this.transCode,
|
||||
tdn: tdn ?? this.tdn,
|
||||
pin: pin ?? this.pin,
|
||||
owner: owner ?? this.owner,
|
||||
fname: fname ?? this.fname,
|
||||
mname: mname ?? this.mname,
|
||||
lname: lname ?? this.lname,
|
||||
bday: bday ?? this.bday,
|
||||
address: address ?? this.address,
|
||||
telno: telno ?? this.telno,
|
||||
tin: tin ?? this.tin,
|
||||
|
@ -85,6 +97,7 @@ class PropertyInfo {
|
|||
adminTelno: adminTelno ?? this.adminTelno,
|
||||
adminTin: adminTin ?? this.adminTin,
|
||||
faasType: faasType ?? this.faasType,
|
||||
genCode: genCode ?? this.genCode,
|
||||
);
|
||||
|
||||
factory PropertyInfo.fromJson(Map<String, dynamic> json) => PropertyInfo(
|
||||
|
@ -100,7 +113,10 @@ class PropertyInfo {
|
|||
transCode: json["trans_code"],
|
||||
tdn: json["tdn"],
|
||||
pin: json["pin"],
|
||||
owner: json["owner"],
|
||||
fname: json["fname"],
|
||||
mname: json["mname"],
|
||||
lname: json["lname"],
|
||||
bday: json["bday"],
|
||||
address: json["address"],
|
||||
telno: json["telno"],
|
||||
tin: json["tin"],
|
||||
|
@ -109,6 +125,7 @@ class PropertyInfo {
|
|||
adminTelno: json["admin_telno"],
|
||||
adminTin: json["admin_tin"],
|
||||
faasType: json["faas_type"],
|
||||
genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
factory PropertyInfo.fromJson2(Map<String, dynamic> json) => PropertyInfo(
|
||||
|
@ -124,8 +141,12 @@ class PropertyInfo {
|
|||
transCode: json["transCode"],
|
||||
tdn: json["tdn"],
|
||||
pin: json["pin"],
|
||||
owner: json["owner"],
|
||||
fname: json["fname"],
|
||||
mname: json["mname"],
|
||||
lname: json["lname"],
|
||||
bday: json["bday"],
|
||||
address: json["address"],
|
||||
|
||||
telno: json["telno"],
|
||||
tin: json["tin"],
|
||||
adminUser: json["adminUser"],
|
||||
|
@ -133,27 +154,31 @@ class PropertyInfo {
|
|||
adminTelno: json["adminTelno"],
|
||||
adminTin: json["adminTin"],
|
||||
faasType: json["faasType"],
|
||||
genCode: json["genCode"],
|
||||
);
|
||||
|
||||
factory PropertyInfo.fromMap(Map<String, dynamic> map) => PropertyInfo(
|
||||
id: map["id"],
|
||||
assessedById: map["assessedById"],
|
||||
assessedByName: map["assessedByName"],
|
||||
dateCreated: map["dateCreated"],
|
||||
dateModified: map["dateModified"],
|
||||
transCode: map["transCode"],
|
||||
tdn: map["tdn"],
|
||||
pin: map["pin"],
|
||||
owner: map["owner"],
|
||||
address: map["address"],
|
||||
telno: map["telno"],
|
||||
tin: map["tin"],
|
||||
adminUser: map["adminUser"],
|
||||
adminAddress: map["adminUser"],
|
||||
adminTelno: map["adminTelno"],
|
||||
adminTin: map["adminTin"],
|
||||
faasType: map["faasType"],
|
||||
);
|
||||
id: map["id"],
|
||||
assessedById: map["assessedById"],
|
||||
assessedByName: map["assessedByName"],
|
||||
dateCreated: map["dateCreated"],
|
||||
dateModified: map["dateModified"],
|
||||
transCode: map["transCode"],
|
||||
tdn: map["tdn"],
|
||||
pin: map["pin"],
|
||||
fname: map["fname"],
|
||||
mname: map["mname"],
|
||||
lname: map["lname"],
|
||||
bday: map["bday"],
|
||||
address: map["address"],
|
||||
telno: map["telno"],
|
||||
tin: map["tin"],
|
||||
adminUser: map["adminUser"],
|
||||
adminAddress: map["adminUser"],
|
||||
adminTelno: map["adminTelno"],
|
||||
adminTin: map["adminTin"],
|
||||
faasType: map["faasType"],
|
||||
genCode: map["genCode"]);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
|
@ -164,7 +189,10 @@ class PropertyInfo {
|
|||
"trans_code": transCode,
|
||||
"tdn": tdn,
|
||||
"pin": pin,
|
||||
"owner": owner,
|
||||
"fname": fname,
|
||||
"mname": mname,
|
||||
"lname": lname,
|
||||
"bday": bday,
|
||||
"address": address,
|
||||
"telno": telno,
|
||||
"tin": tin,
|
||||
|
@ -173,5 +201,6 @@ class PropertyInfo {
|
|||
"admin_telno": adminTelno,
|
||||
"admin_tin": adminTin,
|
||||
"faas_type": faasType,
|
||||
"gen_code": genCode,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,6 +15,9 @@ class Signatories {
|
|||
final String firstname;
|
||||
final String middlename;
|
||||
final String lastname;
|
||||
final String designation;
|
||||
// final String status;
|
||||
// final String genCode;
|
||||
|
||||
Signatories({
|
||||
this.id,
|
||||
|
@ -22,20 +25,31 @@ class Signatories {
|
|||
required this.firstname,
|
||||
required this.middlename,
|
||||
required this.lastname,
|
||||
required this.designation,
|
||||
// required this.status
|
||||
// required this.genCode,
|
||||
});
|
||||
|
||||
Signatories copy(
|
||||
{int? id,
|
||||
int? signatoryId,
|
||||
String? firstname,
|
||||
String? middlename,
|
||||
String? lastname}) {
|
||||
Signatories copy({
|
||||
int? id,
|
||||
int? signatoryId,
|
||||
String? firstname,
|
||||
String? middlename,
|
||||
String? lastname,
|
||||
String? designation,
|
||||
// String? status
|
||||
// String? genCode
|
||||
}) {
|
||||
return Signatories(
|
||||
id: id ?? this.id,
|
||||
signatoryId: signatoryId ?? this.signatoryId,
|
||||
firstname: firstname ?? this.firstname,
|
||||
middlename: middlename ?? this.middlename,
|
||||
lastname: lastname ?? this.lastname);
|
||||
id: id ?? this.id,
|
||||
signatoryId: signatoryId ?? this.signatoryId,
|
||||
firstname: firstname ?? this.firstname,
|
||||
middlename: middlename ?? this.middlename,
|
||||
lastname: lastname ?? this.lastname,
|
||||
designation: designation ?? this.designation,
|
||||
// status: status ?? this.status
|
||||
// genCode: genCode ?? this.genCode
|
||||
);
|
||||
}
|
||||
|
||||
factory Signatories.fromJson(Map<String, dynamic> json) => Signatories(
|
||||
|
@ -44,6 +58,9 @@ class Signatories {
|
|||
firstname: json["firstname"],
|
||||
middlename: json["middlename"],
|
||||
lastname: json["lastname"],
|
||||
designation: json["designation"],
|
||||
// status: json["status"]
|
||||
// genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
factory Signatories.fromJson2(Map<String, dynamic> json) => Signatories(
|
||||
|
@ -52,6 +69,9 @@ class Signatories {
|
|||
firstname: json["firstname"],
|
||||
middlename: json["middlename"],
|
||||
lastname: json["lastname"],
|
||||
designation: json["designation"],
|
||||
// status: json["status"]
|
||||
// genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -60,5 +80,8 @@ class Signatories {
|
|||
"firstname": firstname,
|
||||
"middlename": middlename,
|
||||
"lastname": lastname,
|
||||
"designation": designation,
|
||||
// "status": status
|
||||
// "gen_code": genCode
|
||||
};
|
||||
}
|
||||
|
|
|
@ -22,6 +22,11 @@ class StructureMaterialsII {
|
|||
final List<String>? flooring;
|
||||
final List<String>? walls;
|
||||
final List<String>? others;
|
||||
final String? genCode;
|
||||
final String? assessedById;
|
||||
final String? assessedByName;
|
||||
final String? dateCreated;
|
||||
final String? dateModified;
|
||||
|
||||
StructureMaterialsII(
|
||||
{this.id,
|
||||
|
@ -33,7 +38,12 @@ class StructureMaterialsII {
|
|||
this.roof,
|
||||
this.flooring,
|
||||
this.walls,
|
||||
this.others});
|
||||
this.others,
|
||||
this.genCode,
|
||||
this.assessedById,
|
||||
this.assessedByName,
|
||||
this.dateCreated,
|
||||
this.dateModified});
|
||||
|
||||
factory StructureMaterialsII.fromJson(Map<String, dynamic> json) =>
|
||||
StructureMaterialsII(
|
||||
|
@ -47,6 +57,11 @@ class StructureMaterialsII {
|
|||
flooring: List<String>.from(json["flooring"].map((x) => x)),
|
||||
walls: List<String>.from(json["walls"].map((x) => x)),
|
||||
others: List<String>.from(json["others"].map((x) => x)),
|
||||
genCode: json["gen_code"],
|
||||
assessedById: json["assessed_by_id"],
|
||||
assessedByName: json["assessed_by_name"],
|
||||
dateCreated: json["date_created"],
|
||||
dateModified: json["date_modified"],
|
||||
);
|
||||
|
||||
factory StructureMaterialsII.fromJson2(Map<String, dynamic> json) =>
|
||||
|
@ -61,30 +76,47 @@ class StructureMaterialsII {
|
|||
flooring: List<String>.from(json["flooring"].map((x) => x)),
|
||||
walls: List<String>.from(json["walls"].map((x) => x)),
|
||||
others: List<String>.from(json["others"].map((x) => x)),
|
||||
genCode: json["genCode"],
|
||||
assessedById: json["assessedById"],
|
||||
assessedByName: json["assessedByName"],
|
||||
dateCreated: json["dateCreated"],
|
||||
dateModified: json["dateModified"],
|
||||
);
|
||||
|
||||
StructureMaterialsII copy(
|
||||
{int? id,
|
||||
int? bldgapprDetailsId,
|
||||
List<String>? foundation,
|
||||
List<String>? columns,
|
||||
List<String>? beams,
|
||||
List<String>? trussFraming,
|
||||
List<String>? roof,
|
||||
List<String>? flooring,
|
||||
List<String>? walls,
|
||||
List<String>? others}) =>
|
||||
StructureMaterialsII copy({
|
||||
int? id,
|
||||
int? bldgapprDetailsId,
|
||||
List<String>? foundation,
|
||||
List<String>? columns,
|
||||
List<String>? beams,
|
||||
List<String>? trussFraming,
|
||||
List<String>? roof,
|
||||
List<String>? flooring,
|
||||
List<String>? walls,
|
||||
List<String>? others,
|
||||
String? genCode,
|
||||
String? assessedById,
|
||||
String? assessedByName,
|
||||
String? dateCreated,
|
||||
String? dateModified,
|
||||
}) =>
|
||||
StructureMaterialsII(
|
||||
id: id ?? this.id,
|
||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||
foundation: foundation ?? this.foundation,
|
||||
columns: columns ?? this.columns,
|
||||
beams: beams ?? this.beams,
|
||||
trussFraming: trussFraming ?? this.trussFraming,
|
||||
roof: roof ?? this.roof,
|
||||
flooring: flooring ?? this.flooring,
|
||||
walls: walls ?? this.walls,
|
||||
others: others ?? this.others);
|
||||
id: id ?? this.id,
|
||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||
foundation: foundation ?? this.foundation,
|
||||
columns: columns ?? this.columns,
|
||||
beams: beams ?? this.beams,
|
||||
trussFraming: trussFraming ?? this.trussFraming,
|
||||
roof: roof ?? this.roof,
|
||||
flooring: flooring ?? this.flooring,
|
||||
walls: walls ?? this.walls,
|
||||
others: others ?? this.others,
|
||||
genCode: genCode ?? this.genCode,
|
||||
assessedById: assessedById ?? this.assessedById,
|
||||
assessedByName: assessedByName ?? this.assessedByName,
|
||||
dateCreated: dateCreated ?? this.dateCreated,
|
||||
dateModified: dateModified ?? this.dateModified,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
|
@ -97,5 +129,10 @@ class StructureMaterialsII {
|
|||
"flooring": List<dynamic>.from(flooring!.map((x) => x)),
|
||||
"walls": List<dynamic>.from(walls!.map((x) => x)),
|
||||
"others": List<dynamic>.from(others!.map((x) => x)),
|
||||
"gen_code": genCode,
|
||||
"assessed_by_id": assessedById,
|
||||
"assessed_by_name": assessedByName,
|
||||
"date_created": dateCreated,
|
||||
"date_modified": dateModified,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ class StructureMaterials {
|
|||
final String? flooring;
|
||||
final String? walls;
|
||||
final String? others;
|
||||
final String? genCode;
|
||||
|
||||
StructureMaterials(
|
||||
{this.id,
|
||||
|
@ -33,7 +34,8 @@ class StructureMaterials {
|
|||
this.roof,
|
||||
this.flooring,
|
||||
this.walls,
|
||||
this.others});
|
||||
this.others,
|
||||
this.genCode});
|
||||
|
||||
StructureMaterials copy(
|
||||
{int? id,
|
||||
|
@ -45,7 +47,8 @@ class StructureMaterials {
|
|||
String? roof,
|
||||
String? flooring,
|
||||
String? walls,
|
||||
String? others}) =>
|
||||
String? others,
|
||||
String? genCode}) =>
|
||||
StructureMaterials(
|
||||
id: id ?? this.id,
|
||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||
|
@ -56,7 +59,8 @@ class StructureMaterials {
|
|||
roof: roof ?? this.roof,
|
||||
flooring: flooring ?? this.flooring,
|
||||
walls: walls ?? this.walls,
|
||||
others: others ?? this.others);
|
||||
others: others ?? this.others,
|
||||
genCode: genCode ?? this.genCode);
|
||||
|
||||
factory StructureMaterials.fromJson(Map<String, dynamic> json) =>
|
||||
StructureMaterials(
|
||||
|
@ -69,7 +73,8 @@ class StructureMaterials {
|
|||
roof: json["roof"],
|
||||
flooring: json["flooring"],
|
||||
walls: json["walls"],
|
||||
others: json["others"]);
|
||||
others: json["others"],
|
||||
genCode: json["gen_code"]);
|
||||
|
||||
factory StructureMaterials.fromJson2(Map<String, dynamic> json) =>
|
||||
StructureMaterials(
|
||||
|
@ -82,7 +87,8 @@ class StructureMaterials {
|
|||
roof: json["roof"],
|
||||
flooring: json["flooring"],
|
||||
walls: json["walls"],
|
||||
others: json["others"]);
|
||||
others: json["others"],
|
||||
genCode: json["gen_code"]);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
|
@ -94,6 +100,7 @@ class StructureMaterials {
|
|||
"roof": roof,
|
||||
"flooring": flooring,
|
||||
"walls": walls,
|
||||
"others": others
|
||||
"others": others,
|
||||
"gen_code": genCode,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,12 +14,14 @@ class UnitConstruct {
|
|||
final String bldgType;
|
||||
final String building;
|
||||
final String unitValue;
|
||||
final String genCode;
|
||||
|
||||
UnitConstruct({
|
||||
required this.id,
|
||||
required this.bldgType,
|
||||
required this.building,
|
||||
required this.unitValue,
|
||||
required this.genCode,
|
||||
});
|
||||
|
||||
UnitConstruct copy({
|
||||
|
@ -27,12 +29,15 @@ class UnitConstruct {
|
|||
String? bldgType,
|
||||
String? building,
|
||||
String? unitValue,
|
||||
String? genCode,
|
||||
}) {
|
||||
return UnitConstruct(
|
||||
id: id ?? this.id,
|
||||
bldgType: bldgType ?? this.bldgType,
|
||||
building: building ?? this.building,
|
||||
unitValue: unitValue ?? this.unitValue);
|
||||
id: id ?? this.id,
|
||||
bldgType: bldgType ?? this.bldgType,
|
||||
building: building ?? this.building,
|
||||
unitValue: unitValue ?? this.unitValue,
|
||||
genCode: genCode ?? this.genCode,
|
||||
);
|
||||
}
|
||||
|
||||
factory UnitConstruct.fromJson2(Map<String, dynamic> json) => UnitConstruct(
|
||||
|
@ -40,6 +45,7 @@ class UnitConstruct {
|
|||
bldgType: json["bldgType"],
|
||||
building: json["building"],
|
||||
unitValue: json["unitValue"],
|
||||
genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
factory UnitConstruct.fromJson(Map<String, dynamic> json) => UnitConstruct(
|
||||
|
@ -47,6 +53,7 @@ class UnitConstruct {
|
|||
bldgType: json["bldg_type"],
|
||||
building: json["building"],
|
||||
unitValue: json["unit_value"],
|
||||
genCode: json["gen_code"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -54,5 +61,6 @@ class UnitConstruct {
|
|||
"bldg_type": bldgType,
|
||||
"building": building,
|
||||
"unit_value": unitValue,
|
||||
"gen_code": genCode,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import 'package:fluttericon/font_awesome5_icons.dart';
|
|||
import 'package:unit2/bloc/offline/offline_bloc/offline_bloc.dart';
|
||||
import 'package:unit2/model/offline/offlane_modules.dart';
|
||||
import 'package:unit2/screens/offline/passo/passo_offline_dashboard.dart';
|
||||
import 'package:unit2/screens/passo/passo_dashboard.dart';
|
||||
import 'package:unit2/screens/unit2/homepage.dart/components/dashboard/shared_card_label.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/admin/class_components_admin.dart/class_components_admin_bloc.dart';
|
||||
|
@ -7,9 +9,10 @@ import 'package:unit2/model/passo/class_components.dart';
|
|||
import 'package:unit2/sevices/offline/offline_passo/admin/api_services/class_components_api_services.dart';
|
||||
import 'package:unit2/sevices/offline/offline_passo/admin/api_services/municipalities_api_services.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
|
||||
import 'package:http/http.dart';
|
||||
import '../../../../model/passo/city.dart';
|
||||
import '../../../../sevices/offline/offline_passo/admin/sql_services/sql_services.dart';
|
||||
import '../../../../utils/urls.dart';
|
||||
|
||||
class ClassComponentsAdminPage extends StatefulWidget {
|
||||
const ClassComponentsAdminPage();
|
||||
|
@ -34,35 +37,43 @@ class _ClassComponentsAdminPage extends State<ClassComponentsAdminPage> {
|
|||
),
|
||||
onPressed: () async {
|
||||
try {
|
||||
final result =
|
||||
await ClassComponentAdminApiServices.instance.fetch();
|
||||
Response response = await get(Uri.parse(
|
||||
'http://${Url.instance.host()}/api/rptass_app/class_components/'));
|
||||
|
||||
print(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
final List result = jsonDecode(response.body)['data'];
|
||||
|
||||
result.map(((e) => ClassComponents.fromJson(e))).toList();
|
||||
|
||||
final classes = result
|
||||
.map((json) => ClassComponents.fromJson(json))
|
||||
.toList();
|
||||
|
||||
// Loop through the list of City objects and insert them into the local database.
|
||||
for (ClassComponents classs in classes) {
|
||||
await SQLServices.instance.createClassComponents(
|
||||
ClassComponentsOffline(
|
||||
componentName: classs.componentName,
|
||||
minBaseUnitvalPercent: classs.minBaseUnitvalPercent,
|
||||
maxBaseUnitvalPercent: classs.maxBaseUnitvalPercent,
|
||||
minUnitvalSqrmtr: classs.minUnitvalSqrmtr,
|
||||
maxUnitvalSqrmtr: classs.maxUnitvalSqrmtr,
|
||||
minAddBaseunitval: classs.minAddBaseunitval,
|
||||
maxAddBaseunitval: classs.maxAddBaseunitval,
|
||||
minDeductBaserate: classs.minAddBaseunitval,
|
||||
maxDeductBaserate: classs.maxDeductBaserate,
|
||||
minLinearMeter: classs.minLinearMeter,
|
||||
maxLinearMeter: classs.maxLinearMeter,
|
||||
minSpacing: classs.minSpacing,
|
||||
maxSpacing: classs.maxSpacing,
|
||||
roughFinish: classs.roughFinish,
|
||||
highFinish: classs.highFinish,
|
||||
withoutBucc: classs.withoutBucc == true ? 1 : 0));
|
||||
}
|
||||
}
|
||||
|
||||
// Assuming result is a List of JSON objects, convert them to City objects.
|
||||
final classes = result
|
||||
.map((json) => ClassComponents.fromJson(json))
|
||||
.toList();
|
||||
|
||||
// Loop through the list of City objects and insert them into the local database.
|
||||
for (ClassComponents classs in classes) {
|
||||
await SQLServices.instance.createClassComponents(
|
||||
ClassComponentsOffline(
|
||||
componentName: classs.componentName,
|
||||
minBaseUnitvalPercent: classs.minBaseUnitvalPercent,
|
||||
maxBaseUnitvalPercent: classs.maxBaseUnitvalPercent,
|
||||
minUnitvalSqrmtr: classs.minUnitvalSqrmtr,
|
||||
maxUnitvalSqrmtr: classs.maxUnitvalSqrmtr,
|
||||
minAddBaseunitval: classs.minAddBaseunitval,
|
||||
maxAddBaseunitval: classs.maxAddBaseunitval,
|
||||
minDeductBaserate: classs.minAddBaseunitval,
|
||||
maxDeductBaserate: classs.maxDeductBaserate,
|
||||
minLinearMeter: classs.minLinearMeter,
|
||||
maxLinearMeter: classs.maxLinearMeter,
|
||||
minSpacing: classs.minSpacing,
|
||||
maxSpacing: classs.maxSpacing,
|
||||
roughFinish: classs.roughFinish,
|
||||
highFinish: classs.highFinish,
|
||||
withoutBucc: classs.withoutBucc == true ? 1 : 0));
|
||||
}
|
||||
} catch (e) {
|
||||
// Handle any errors that might occur during the API call or database insertion.
|
||||
print("Error: $e");
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/admin/barangay_admin/barangay_admin_bloc.dart';
|
||||
|
@ -9,6 +11,8 @@ import 'package:unit2/sevices/offline/offline_passo/admin/api_services/memoranda
|
|||
|
||||
import '../../../../sevices/offline/offline_passo/admin/sql_services/sql_services.dart';
|
||||
import '../../../../theme-data.dart/colors.dart';
|
||||
import '../../../../utils/urls.dart';
|
||||
import 'package:http/http.dart';
|
||||
|
||||
class MemorandaAdminPage extends StatefulWidget {
|
||||
const MemorandaAdminPage();
|
||||
|
@ -33,15 +37,27 @@ class _MemorandaAdminPage extends State<MemorandaAdminPage> {
|
|||
),
|
||||
onPressed: () async {
|
||||
try {
|
||||
final result = await MemorandaAdminApiServices.instance.fetch();
|
||||
// final result = await MemorandaAdminApiServices.instance.fetch();
|
||||
|
||||
// Assuming result is a List of JSON objects, convert them to City objects.
|
||||
final memos =
|
||||
result.map((json) => Memoranda.fromJson(json)).toList();
|
||||
// // Assuming result is a List of JSON objects, convert them to City objects.
|
||||
// final memos =
|
||||
// result.map((json) => Memoranda.fromJson(json)).toList();
|
||||
|
||||
// Loop through the list of City objects and insert them into the local database.
|
||||
for (Memoranda memo in memos) {
|
||||
await SQLServices.instance.createMemoranda(memo);
|
||||
Response response = await get(Uri.parse(
|
||||
'http://${Url.instance.host()}${Url.instance.getMemoranda()}'));
|
||||
|
||||
print(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
final List result = jsonDecode(response.body)['data'];
|
||||
|
||||
result.map(((e) => Memoranda.fromJson(e))).toList();
|
||||
|
||||
final memos =
|
||||
result.map((json) => Memoranda.fromJson(json)).toList();
|
||||
for (Memoranda memo in memos) {
|
||||
await SQLServices.instance.createMemoranda(memo);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// Handle any errors that might occur during the API call or database insertion.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/admin/barangay_admin/barangay_admin_bloc.dart';
|
||||
|
@ -9,6 +11,9 @@ import 'package:unit2/sevices/offline/offline_passo/admin/api_services/signatori
|
|||
|
||||
import '../../../../sevices/offline/offline_passo/admin/sql_services/sql_services.dart';
|
||||
import '../../../../theme-data.dart/colors.dart';
|
||||
import 'package:http/http.dart';
|
||||
|
||||
import '../../../../utils/urls.dart';
|
||||
|
||||
class SignatoriesAdminPage extends StatefulWidget {
|
||||
const SignatoriesAdminPage();
|
||||
|
@ -33,16 +38,21 @@ class _SignatoriesAdminPage extends State<SignatoriesAdminPage> {
|
|||
),
|
||||
onPressed: () async {
|
||||
try {
|
||||
final result =
|
||||
await SignatoriesAdminApiServices.instance.fetch();
|
||||
Response response = await get(Uri.parse(
|
||||
'http://${Url.instance.host()}/api/rptass_app/signatories/'));
|
||||
|
||||
// Assuming result is a List of JSON objects, convert them to City objects.
|
||||
final signatories =
|
||||
result.map((json) => Signatories.fromJson(json)).toList();
|
||||
print(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
final List result = jsonDecode(response.body)['data'];
|
||||
|
||||
// Loop through the list of City objects and insert them into the local database.
|
||||
for (Signatories signatory in signatories) {
|
||||
await SQLServices.instance.createSignatories(signatory);
|
||||
result.map(((e) => Signatories.fromJson(e))).toList();
|
||||
|
||||
final signatories =
|
||||
result.map((json) => Signatories.fromJson(json)).toList();
|
||||
// Loop through the list of City objects and insert them into the local database.
|
||||
for (Signatories signatory in signatories) {
|
||||
await SQLServices.instance.createSignatories(signatory);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// Handle any errors that might occur during the API call or database insertion.
|
||||
|
@ -83,6 +93,12 @@ class _SignatoriesAdminPage extends State<SignatoriesAdminPage> {
|
|||
const DataColumn(
|
||||
label: Text('Last Name'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Designation'),
|
||||
),
|
||||
// const DataColumn(
|
||||
// label: Text('Status'),
|
||||
// ),
|
||||
],
|
||||
rows: state.signatories.map((dataRow) {
|
||||
return DataRow(
|
||||
|
@ -93,6 +109,8 @@ class _SignatoriesAdminPage extends State<SignatoriesAdminPage> {
|
|||
'N/A')), // Use a default value if cityDescription is null
|
||||
DataCell(Text(dataRow.middlename ?? 'N/A')),
|
||||
DataCell(Text(dataRow.lastname ?? 'N/A')),
|
||||
DataCell(Text(dataRow.designation ?? 'N/A')),
|
||||
// DataCell(Text(dataRow.status ?? 'N/A')),
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/admin/barangay_admin/barangay_admin_bloc.dart';
|
||||
|
@ -9,6 +11,7 @@ import 'package:unit2/sevices/offline/offline_passo/admin/api_services/unit_cons
|
|||
|
||||
import '../../../../sevices/offline/offline_passo/admin/sql_services/sql_services.dart';
|
||||
import '../../../../theme-data.dart/colors.dart';
|
||||
import 'package:http/http.dart';
|
||||
|
||||
class UnitConstructionAdminPage extends StatefulWidget {
|
||||
const UnitConstructionAdminPage();
|
||||
|
@ -33,16 +36,30 @@ class _UnitConstructionAdminPage extends State<UnitConstructionAdminPage> {
|
|||
),
|
||||
onPressed: () async {
|
||||
try {
|
||||
final result =
|
||||
await UnitConstructionAdminApiServices.instance.fetch();
|
||||
// final result =
|
||||
// await UnitConstructionAdminApiServices.instance.fetch();
|
||||
|
||||
// Assuming result is a List of JSON objects, convert them to City objects.
|
||||
final units =
|
||||
result.map((json) => UnitConstruct.fromJson(json)).toList();
|
||||
// // Assuming result is a List of JSON objects, convert them to City objects.
|
||||
// final units =
|
||||
// result.map((json) => UnitConstruct.fromJson(json)).toList();
|
||||
|
||||
// Loop through the list of City objects and insert them into the local database.
|
||||
for (UnitConstruct unit in units) {
|
||||
await SQLServices.instance.createUnitConstruction(unit);
|
||||
Response response = await get(Uri.parse(
|
||||
'http://192.168.80.20:8000/api/rptass_app/unitconstruct_values/'));
|
||||
|
||||
print(response.body);
|
||||
if (response.statusCode == 200) {
|
||||
final List result = jsonDecode(response.body)['data'];
|
||||
|
||||
result.map(((e) => UnitConstruct.fromJson(e))).toList();
|
||||
|
||||
final units = result
|
||||
.map((json) => UnitConstruct.fromJson(json))
|
||||
.toList();
|
||||
|
||||
for (UnitConstruct unit in units) {
|
||||
await SQLServices.instance.createUnitConstruction(unit);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// Handle any errors that might occur during the API call or database insertion.
|
||||
|
|
|
@ -84,275 +84,262 @@ class _AddBuildingAndStructureOffline
|
|||
formKey.currentState?.save();
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
child: Container(
|
||||
height: 800,
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(2.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 10, right: 0, bottom: 0),
|
||||
child: SizedBox(
|
||||
height: 45,
|
||||
child: SearchField(
|
||||
itemHeight: 70,
|
||||
suggestions: state.unit
|
||||
.map((UnitConstruct unit) =>
|
||||
SearchFieldListItem(
|
||||
'${unit.bldgType} - ${unit.building}',
|
||||
item: unit,
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
'${unit.bldgType} - ${unit.building!.toUpperCase()}',
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
),
|
||||
)))
|
||||
.toList(),
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(2.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 10, right: 0, bottom: 0),
|
||||
child: SizedBox(
|
||||
height: 45,
|
||||
child: SearchField(
|
||||
itemHeight: 70,
|
||||
suggestions: state.unit
|
||||
.map((UnitConstruct unit) =>
|
||||
SearchFieldListItem(
|
||||
'${unit.bldgType} - ${unit.building}',
|
||||
item: unit,
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
'${unit.bldgType} - ${unit.building!.toUpperCase()}',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
)))
|
||||
.toList(),
|
||||
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle("Structure Type", "")
|
||||
.copyWith(
|
||||
suffixIcon: const Icon(
|
||||
Icons.arrow_drop_down)),
|
||||
////agency suggestion tap
|
||||
focusNode: focus,
|
||||
suggestionState: Suggestion.expand,
|
||||
onSuggestionTap: (unit) {
|
||||
setState(() {
|
||||
_unitBase =
|
||||
double.parse(unit.item!.unitValue);
|
||||
_structureType =
|
||||
'${unit.item!.bldgType} - ${unit.item!.building}';
|
||||
searchInputDecoration: normalTextFieldStyle(
|
||||
"Structure Type", "")
|
||||
.copyWith(
|
||||
suffixIcon:
|
||||
const Icon(Icons.arrow_drop_down)),
|
||||
////agency suggestion tap
|
||||
focusNode: focus,
|
||||
suggestionState: Suggestion.expand,
|
||||
onSuggestionTap: (unit) {
|
||||
setState(() {
|
||||
_unitBase =
|
||||
double.parse(unit.item!.unitValue);
|
||||
_structureType =
|
||||
'${unit.item!.bldgType} - ${unit.item!.building}';
|
||||
|
||||
formKey.currentState!.patchValue(
|
||||
{'unit_value': unit.item?.unitValue});
|
||||
});
|
||||
focus.unfocus();
|
||||
},
|
||||
),
|
||||
),
|
||||
formKey.currentState!.patchValue(
|
||||
{'unit_value': unit.item?.unitValue});
|
||||
});
|
||||
focus.unfocus();
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
customDropDownField(
|
||||
"Actual Use", "", 'actual_use', actual_use),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
customDropDownField(
|
||||
"Actual Use", "", 'actual_use', actual_use),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
child: FormBuilderTextField(
|
||||
name: 'unit_value',
|
||||
decoration: normalTextFieldStyle("Unit Value", ""),
|
||||
validator: FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
// setState(() {
|
||||
// _areaValue = int.parse(value!);
|
||||
// });
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: FormBuilderTextField(
|
||||
name: 'unit_value',
|
||||
decoration:
|
||||
normalTextFieldStyle("Unit Value", ""),
|
||||
name: 'dep_rate',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Depreciation Rate", ""),
|
||||
validator: FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
// setState(() {
|
||||
// _areaValue = int.parse(value!);
|
||||
// });
|
||||
setState(() {
|
||||
_depRate = double.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: FormBuilderTextField(
|
||||
name: 'dep_rate',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Depreciation Rate", ""),
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_depRate = double.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Expanded(
|
||||
child: FormBuilderTextField(
|
||||
name: 'bldg_area',
|
||||
decoration:
|
||||
normalTextFieldStyle("Area", ""),
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_areaValue = double.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
Expanded(
|
||||
child: FormBuilderTextField(
|
||||
name: 'bldg_area',
|
||||
decoration: normalTextFieldStyle("Area", ""),
|
||||
validator: FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_areaValue = double.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(_totalMarketValue(
|
||||
_unitBase, _areaValue)))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Amount of Depreciation'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(_amountofDepreciation(
|
||||
_unitBase, _areaValue, _depRate)))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Adjusted Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(_adjustedMarketValue(
|
||||
_unitBase, _areaValue, _depRate)))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
try {
|
||||
final tempID = await SharedPreferences
|
||||
.getInstance();
|
||||
var bldgStructure = BldgAndStructure(
|
||||
id: 1,
|
||||
bldgapprDetailsId: tempID.getInt(
|
||||
'tempid')!,
|
||||
assessedById: widget
|
||||
.offlineProfile.id
|
||||
.toString(),
|
||||
assessedByName: widget
|
||||
.offlineProfile.firstName,
|
||||
dateCreated: formatter,
|
||||
dateModified: 'none',
|
||||
bldgType: _structureType,
|
||||
strucType: _structureType,
|
||||
description: 'None',
|
||||
actualUse: formKey.currentState
|
||||
?.value['actual_use'],
|
||||
floorCount: '1',
|
||||
bldgArea: _areaValue.toString(),
|
||||
unitValue: _unitBase.toString(),
|
||||
depRate: _depRate.toString(),
|
||||
marketValue: _totalMarketValue(
|
||||
_unitBase,
|
||||
_areaValue)
|
||||
.toString(),
|
||||
depAmount: _amountofDepreciation(
|
||||
_unitBase,
|
||||
_areaValue,
|
||||
_depRate)
|
||||
.toString(),
|
||||
adjustedMarketValue:
|
||||
_adjustedMarketValue(_unitBase,
|
||||
_areaValue, _depRate)
|
||||
.toString());
|
||||
context
|
||||
.read<BuildingAndStructureBloc>()
|
||||
.add(AddBuildingAndStructure(
|
||||
bldgAndStructure:
|
||||
bldgStructure));
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Submit"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width:
|
||||
5), // Use SizedBox for horizontal spacing in a Row
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
.read<BuildingAndStructureBloc>()
|
||||
.add(
|
||||
const LoadBuildingAndStructure());
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Cancel"),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(_totalMarketValue(
|
||||
_unitBase, _areaValue)))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Amount of Depreciation'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(_amountofDepreciation(
|
||||
_unitBase, _areaValue, _depRate)))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Adjusted Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(_adjustedMarketValue(
|
||||
_unitBase, _areaValue, _depRate)))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
try {
|
||||
final tempID =
|
||||
await SharedPreferences.getInstance();
|
||||
var bldgStructure = BldgAndStructure(
|
||||
id: 1,
|
||||
bldgapprDetailsId: tempID.getInt(
|
||||
'tempid')!,
|
||||
// assessedById: widget
|
||||
// .offlineProfile.id
|
||||
// .toString(),
|
||||
// assessedByName: widget
|
||||
// .offlineProfile.firstName,
|
||||
// dateCreated: formatter,
|
||||
// dateModified: 'none',
|
||||
bldgType: _structureType,
|
||||
structType: _structureType,
|
||||
description: 'None',
|
||||
buccPercentage: '1',
|
||||
actualUse: formKey.currentState?.value[
|
||||
'actual_use'] ??
|
||||
"",
|
||||
floorCount: '1',
|
||||
bldgArea: _areaValue.toString(),
|
||||
unitValue: _unitBase.toString(),
|
||||
depRate: _depRate.toString(),
|
||||
marketValue: _totalMarketValue(
|
||||
_unitBase, _areaValue)
|
||||
.toString(),
|
||||
depAmount: _amountofDepreciation(
|
||||
_unitBase, _areaValue, _depRate)
|
||||
.toString(),
|
||||
adjustedMarketValue:
|
||||
_adjustedMarketValue(_unitBase,
|
||||
_areaValue, _depRate)
|
||||
.toString(),
|
||||
genCode: "5TH");
|
||||
context
|
||||
.read<BuildingAndStructureBloc>()
|
||||
.add(AddBuildingAndStructure(
|
||||
bldgAndStructure: bldgStructure));
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Submit"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width:
|
||||
5), // Use SizedBox for horizontal spacing in a Row
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
.read<BuildingAndStructureBloc>()
|
||||
.add(const LoadBuildingAndStructure());
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Cancel"),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -150,6 +150,9 @@ class _AdditionalItemOfflinePage extends State<AdditionalItemOfflinePage> {
|
|||
const DataColumn(
|
||||
label: Text('Unit Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Area'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('% of BUCC'),
|
||||
),
|
||||
|
@ -168,6 +171,7 @@ class _AdditionalItemOfflinePage extends State<AdditionalItemOfflinePage> {
|
|||
locale: 'en-PH',
|
||||
symbol: "₱",
|
||||
).format(dataRow.baseUnitValue).toString())),
|
||||
DataCell(Text(dataRow.area.toString())),
|
||||
DataCell(Text(dataRow.unitValue.toString())),
|
||||
DataCell(Text(NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
|
@ -276,29 +280,31 @@ class _AdditionalItemOfflinePage extends State<AdditionalItemOfflinePage> {
|
|||
}
|
||||
}
|
||||
if (state is ShowAddItemsScreen) {
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxHeight: 1000.0),
|
||||
child: AlertDialog(
|
||||
insetPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 20.0,
|
||||
vertical: 10.0,
|
||||
),
|
||||
title: const Text(
|
||||
'ADD EXTRA ITEMS',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(child: AddExtraItemsOffline(widget.offlineProfile))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
return showDialog(context);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
Widget showDialog(BuildContext context) {
|
||||
return AlertDialog(
|
||||
insetPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 10.0,
|
||||
vertical: 20.0,
|
||||
),
|
||||
title: const Text(
|
||||
'ADD ADDITIONAL ITEMS',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
AddExtraItemsOffline(widget.offlineProfile),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -306,31 +306,32 @@ class _BuildingAndStructureOfflinePage
|
|||
}
|
||||
}
|
||||
if (state is ShowBldgAndStructuresScreen) {
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxHeight: 1000.0),
|
||||
child: AlertDialog(
|
||||
insetPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 10.0,
|
||||
vertical: 10.0,
|
||||
),
|
||||
title: const Text(
|
||||
'ADD NEW BLDG & STRUCTURE',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child:
|
||||
AddBuildingAndStructureOffline(widget.offlineProfile))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
return showDialog(
|
||||
context); // Placeholder return; replace with your desired widget
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
Widget showDialog(BuildContext context) {
|
||||
return AlertDialog(
|
||||
insetPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 10.0,
|
||||
vertical: 20.0,
|
||||
),
|
||||
title: const Text(
|
||||
'ADD NEW BLDG & STRUCTURE',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
AddBuildingAndStructureOffline(widget.offlineProfile),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,14 +3,16 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:searchfield/searchfield.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/admin/unit_construction/unit_construction_admin_bloc.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/building/general_description/general_description_bloc.dart';
|
||||
import 'package:unit2/model/offline/offline_profile.dart';
|
||||
import 'package:unit2/screens/offline/passo/building/add/add_building.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building_components/general_description.dart';
|
||||
|
||||
import '../../../../../model/passo/general_description.dart';
|
||||
import '../../../../../model/passo/unit_construct.dart';
|
||||
import '../../../../../theme-data.dart/form-style.dart';
|
||||
import '../../../../../widgets/passo/custom_button.dart';
|
||||
import '../../../../../widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
@ -31,6 +33,8 @@ class GeneralDescriptionOfflinePage extends StatefulWidget {
|
|||
|
||||
class _GeneralDescriptionOfflinePage
|
||||
extends State<GeneralDescriptionOfflinePage> {
|
||||
final focus = FocusNode();
|
||||
|
||||
final actual_use = [
|
||||
"Residential",
|
||||
"Agricultural",
|
||||
|
@ -47,6 +51,10 @@ class _GeneralDescriptionOfflinePage
|
|||
: now = DateTime.now(),
|
||||
formatter = DateFormat.yMMMMd('en_US').format(DateTime.now());
|
||||
|
||||
late String bldgType;
|
||||
late String bldgKind;
|
||||
late String unitValue;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocConsumer<UnitConstructionAdminBloc, UnitConstructionAdminState>(
|
||||
|
@ -71,16 +79,46 @@ class _GeneralDescriptionOfflinePage
|
|||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 10, right: 0, bottom: 0),
|
||||
child: FormBuilderDropdown(
|
||||
name: 'bldg_type',
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle("Kind of Building", ""),
|
||||
items: state.unit
|
||||
.map((e) => DropdownMenuItem(
|
||||
value: e,
|
||||
child: Text('${e.bldgType}-${e.building}'),
|
||||
))
|
||||
.toList(),
|
||||
child: SizedBox(
|
||||
height: 45,
|
||||
child: SearchField(
|
||||
itemHeight: 70,
|
||||
suggestions: state.unit
|
||||
.map((UnitConstruct unit) => SearchFieldListItem(
|
||||
'${unit.bldgType} - ${unit.building}',
|
||||
item: unit,
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
'${unit.bldgType} - ${unit.building!.toUpperCase()}',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
)))
|
||||
.toList(),
|
||||
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle("Structure Type", "").copyWith(
|
||||
suffixIcon: const Icon(Icons.arrow_drop_down)),
|
||||
////agency suggestion tap
|
||||
focusNode: focus,
|
||||
suggestionState: Suggestion.expand,
|
||||
onSuggestionTap: (unit) {
|
||||
setState(() {
|
||||
bldgKind =
|
||||
'${unit.item!.bldgType} - ${unit.item!.building}';
|
||||
bldgType =
|
||||
'${unit.item!.bldgType} - ${unit.item!.building}';
|
||||
|
||||
unitValue = unit.item!.unitValue;
|
||||
|
||||
offlineBldgKey.currentState!
|
||||
.patchValue({'bldg_type': unit.item});
|
||||
});
|
||||
focus.unfocus();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
customDropDownField(
|
||||
|
@ -221,37 +259,37 @@ class _GeneralDescriptionOfflinePage
|
|||
widget.offlineProfile.firstName!,
|
||||
dateCreated: formatter,
|
||||
dateModified: 'None',
|
||||
bldgKind: offlineBldgKey
|
||||
.currentState?.value['bldg_type'].building,
|
||||
strucType: offlineBldgKey
|
||||
.currentState?.value['bldg_type'].bldgType,
|
||||
bldgKind: bldgKind ?? "",
|
||||
strucType: bldgType ?? "",
|
||||
bldgPermit: offlineBldgKey
|
||||
.currentState?.value['bldg_permit'],
|
||||
dateIssued: offlineBldgKey.currentState!.value['coc_issued']
|
||||
.toString(),
|
||||
.currentState?.value['bldg_permit'] ??
|
||||
"",
|
||||
dateIssued: offlineBldgKey
|
||||
.currentState!.value['date_issued']
|
||||
.toString() ??
|
||||
"",
|
||||
cct: 'None',
|
||||
certCompletionIssued: offlineBldgKey
|
||||
.currentState!.value['coc_issued']
|
||||
.toString(),
|
||||
.currentState!.value['coc_issued']
|
||||
.toString() ??
|
||||
"",
|
||||
certOccupancyIssued: offlineBldgKey
|
||||
.currentState!.value['coo_issued']
|
||||
.toString(),
|
||||
dateCompleted: offlineBldgKey
|
||||
.currentState!.value['date_cnstructed']
|
||||
.toString(),
|
||||
dateOccupied: offlineBldgKey
|
||||
.currentState!.value['date_occupied']
|
||||
.toString(),
|
||||
bldgAge: offlineBldgKey.currentState!.value['bldg_age'],
|
||||
noStoreys: offlineBldgKey.currentState!.value['no_of_storeys'],
|
||||
area1Stfloor: '0',
|
||||
area2Ndfloor: '0',
|
||||
area3Rdfloor: '0',
|
||||
area4Thfloor: '0',
|
||||
totalFloorArea: offlineBldgKey.currentState?.value['total_area'],
|
||||
.currentState!.value['coo_issued']
|
||||
.toString() ??
|
||||
"",
|
||||
dateCompleted: offlineBldgKey.currentState!.value['date_cnstructed'].toString() ?? "",
|
||||
dateOccupied: offlineBldgKey.currentState!.value['date_occupied'].toString() ?? "",
|
||||
bldgAge: offlineBldgKey.currentState!.value['bldg_age'] ?? "",
|
||||
noStoreys: offlineBldgKey.currentState!.value['no_of_storeys'] ?? "",
|
||||
area1Stfloor: offlineBldgKey.currentState!.value['area_of_1stFl'] ?? "",
|
||||
area2Ndfloor: offlineBldgKey.currentState!.value['area_of_2ndFl'] ?? "",
|
||||
area3Rdfloor: offlineBldgKey.currentState!.value['area_of_3rdFl'] ?? "",
|
||||
area4Thfloor: offlineBldgKey.currentState!.value['area_of_4thFl'] ?? "",
|
||||
totalFloorArea: offlineBldgKey.currentState?.value['total_area'] ?? "",
|
||||
floorSketch: null,
|
||||
actualUse: offlineBldgKey.currentState?.value['actual_use'],
|
||||
unitValue: offlineBldgKey.currentState?.value['bldg_type'].unitValue));
|
||||
actualUse: offlineBldgKey.currentState?.value['actual_use'] ?? "",
|
||||
unitValue: unitValue ?? "",
|
||||
genCode: '5th'));
|
||||
widget.onPutGeneralDescription();
|
||||
}
|
||||
;
|
||||
|
|
|
@ -288,42 +288,46 @@ class _LandRefLocationOfflinePage extends State<LandRefLocationOfflinePage> {
|
|||
dateCreated: 'None',
|
||||
dateModified: 'NOne',
|
||||
street: offlineBldgKey
|
||||
.currentState?.value['street'],
|
||||
.currentState?.value['street'] ??
|
||||
"",
|
||||
barangay: offlineBldgKey
|
||||
.currentState?.value['brgy'],
|
||||
.currentState?.value['brgy'] ??
|
||||
"",
|
||||
municipality: offlineBldgKey
|
||||
.currentState
|
||||
?.value['municipality']
|
||||
.cityDescription,
|
||||
province: "Agusan Del Norte"));
|
||||
.currentState
|
||||
?.value['municipality']
|
||||
.cityDescription ??
|
||||
"",
|
||||
province: "Agusan Del Norte",
|
||||
genCode: "5th"));
|
||||
|
||||
context
|
||||
.read<LandrefLocationBloc>()
|
||||
.add(AddLandRef(
|
||||
id: 1,
|
||||
bldgapprDetailsId:
|
||||
tempID.getInt('tempid')!,
|
||||
assessedById:
|
||||
widget.offlineProfile.id.toString(),
|
||||
assessedByName:
|
||||
widget.offlineProfile.firstName!,
|
||||
dateCreated: 'None',
|
||||
dateModified: 'None',
|
||||
owner: offlineBldgKey
|
||||
.currentState?.value['l_owner'],
|
||||
cloaNo: offlineBldgKey.currentState
|
||||
?.value['oct_tct_cloa'],
|
||||
lotNo: offlineBldgKey
|
||||
.currentState?.value['lot_no'],
|
||||
tdn: offlineBldgKey
|
||||
.currentState?.value['l_td_arp'],
|
||||
area: offlineBldgKey
|
||||
.currentState?.value['area'],
|
||||
surveyNo: offlineBldgKey
|
||||
.currentState?.value['survey_no'],
|
||||
blkNo: offlineBldgKey
|
||||
.currentState?.value['blk_no'],
|
||||
));
|
||||
context.read<LandrefLocationBloc>().add(AddLandRef(
|
||||
id: 1,
|
||||
bldgapprDetailsId:
|
||||
tempID.getInt('tempid')!,
|
||||
assessedById:
|
||||
widget.offlineProfile.id.toString(),
|
||||
assessedByName:
|
||||
widget.offlineProfile.firstName!,
|
||||
dateCreated: 'None',
|
||||
dateModified: 'None',
|
||||
owner: offlineBldgKey
|
||||
.currentState?.value['l_owner'] ??
|
||||
"",
|
||||
cloaNo: offlineBldgKey.currentState
|
||||
?.value['oct_tct_cloa'] ??
|
||||
"",
|
||||
lotNo: offlineBldgKey
|
||||
.currentState?.value['lot_no'] ??
|
||||
"",
|
||||
tdn: offlineBldgKey.currentState
|
||||
?.value['l_td_arp'] ??
|
||||
"",
|
||||
area:
|
||||
offlineBldgKey.currentState?.value['area'] ?? "",
|
||||
surveyNo: offlineBldgKey.currentState?.value['survey_no'] ?? "",
|
||||
blkNo: offlineBldgKey.currentState?.value['blk_no'] ?? "",
|
||||
genCode: '5th'));
|
||||
|
||||
widget.NextBtn();
|
||||
},
|
||||
|
|
|
@ -549,12 +549,14 @@ class _PropertyAppraisalOfflinePage
|
|||
textAlign: TextAlign.left),
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
|
@ -569,6 +571,8 @@ class _PropertyAppraisalOfflinePage
|
|||
textAlign: TextAlign.left),
|
||||
),
|
||||
DataTable(
|
||||
columnSpacing:
|
||||
MediaQuery.of(context).size.width / 3,
|
||||
columns: [
|
||||
const DataColumn(
|
||||
label: Text('Building Core'),
|
||||
|
@ -643,60 +647,68 @@ class _PropertyAppraisalOfflinePage
|
|||
fontSize: 15),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
DataTable(columns: [
|
||||
const DataColumn(
|
||||
label: Text('Additional Item'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text(''),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Market Value'),
|
||||
),
|
||||
], rows: [
|
||||
...addItem.map((dataRow) {
|
||||
return DataRow(cells: [
|
||||
DataCell(Text(dataRow.className!)),
|
||||
DataCell(Text('')),
|
||||
DataCell(Text(
|
||||
NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱")
|
||||
.format(double.parse(dataRow
|
||||
.marketValue
|
||||
.toString()!))
|
||||
.toString(),
|
||||
))
|
||||
]);
|
||||
}).toList(),
|
||||
DataRow(
|
||||
// color: MaterialStateColor.resolveWith(
|
||||
// (states) {
|
||||
// // Use a color for the DataRow, for example, Colors.blue
|
||||
// return Colors.redAccent;
|
||||
// }),
|
||||
cells: [
|
||||
DataCell(Text('Total',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 15,
|
||||
color: Colors.red))),
|
||||
DataCell(Text('')),
|
||||
DataCell(
|
||||
Text(
|
||||
NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱",
|
||||
).format(_totalMarketValue(
|
||||
addItem)),
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 15,
|
||||
color: Colors.red)),
|
||||
)
|
||||
]),
|
||||
]),
|
||||
DataTable(
|
||||
columnSpacing:
|
||||
MediaQuery.of(context).size.width /
|
||||
3,
|
||||
columns: [
|
||||
const DataColumn(
|
||||
label: Text('Additional Item'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text(''),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Market Value'),
|
||||
),
|
||||
],
|
||||
rows: [
|
||||
...addItem.map((dataRow) {
|
||||
return DataRow(cells: [
|
||||
DataCell(
|
||||
Text(dataRow.className!)),
|
||||
DataCell(Text('')),
|
||||
DataCell(Text(
|
||||
NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱")
|
||||
.format(double.parse(dataRow
|
||||
.marketValue
|
||||
.toString()!))
|
||||
.toString(),
|
||||
))
|
||||
]);
|
||||
}).toList(),
|
||||
DataRow(
|
||||
// color: MaterialStateColor.resolveWith(
|
||||
// (states) {
|
||||
// // Use a color for the DataRow, for example, Colors.blue
|
||||
// return Colors.redAccent;
|
||||
// }),
|
||||
cells: [
|
||||
DataCell(Text('Total',
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 15,
|
||||
color: Colors.red))),
|
||||
DataCell(Text('')),
|
||||
DataCell(
|
||||
Text(
|
||||
NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱",
|
||||
).format(
|
||||
_totalMarketValue(
|
||||
addItem)),
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 15,
|
||||
color: Colors.red)),
|
||||
)
|
||||
]),
|
||||
]),
|
||||
],
|
||||
)),
|
||||
),
|
||||
|
@ -722,65 +734,78 @@ class _PropertyAppraisalOfflinePage
|
|||
fontSize: 15),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
DataTable(columns: const [
|
||||
DataColumn(
|
||||
label: Text('Actual Use'),
|
||||
),
|
||||
DataColumn(
|
||||
label: Text('Market Value'),
|
||||
),
|
||||
DataColumn(
|
||||
label: Text('Ass. Level'),
|
||||
),
|
||||
DataColumn(
|
||||
label: Text('Ass. Value'),
|
||||
),
|
||||
], rows: <DataRow>[
|
||||
DataRow(
|
||||
cells: <DataCell>[
|
||||
DataCell(Text(offlineBldgKey
|
||||
.currentState
|
||||
?.value['actual_use'])),
|
||||
DataCell(Text(NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(_calculateMarketValue(
|
||||
addItem,
|
||||
state.bldgAndStructure)))),
|
||||
DataCell(
|
||||
Text(
|
||||
assessmentLevel(
|
||||
_calculateMarketValue(addItem,
|
||||
state.bldgAndStructure),
|
||||
offlineBldgKey.currentState
|
||||
?.value['actual_use']),
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
DataTable(
|
||||
columnSpacing:
|
||||
MediaQuery.of(context).size.width /
|
||||
6,
|
||||
columns: const [
|
||||
DataColumn(
|
||||
label: Text('Actual Use'),
|
||||
),
|
||||
DataColumn(
|
||||
label: Text('Market Value'),
|
||||
),
|
||||
DataColumn(
|
||||
label: Text('Ass. Level'),
|
||||
),
|
||||
DataColumn(
|
||||
label: Text('Ass. Value'),
|
||||
),
|
||||
DataCell(Text(
|
||||
NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱")
|
||||
.format(double.parse(
|
||||
assessmentValue(
|
||||
_calculateMarketValue(
|
||||
addItem,
|
||||
state
|
||||
.bldgAndStructure),
|
||||
offlineBldgKey
|
||||
.currentState
|
||||
?.value[
|
||||
'actual_use'])
|
||||
.toString(),
|
||||
))
|
||||
.toString(),
|
||||
)),
|
||||
],
|
||||
),
|
||||
])
|
||||
rows: <DataRow>[
|
||||
DataRow(
|
||||
cells: <DataCell>[
|
||||
DataCell(Text(offlineBldgKey
|
||||
.currentState
|
||||
?.value['actual_use'] ??
|
||||
"")),
|
||||
DataCell(Text(NumberFormat
|
||||
.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱")
|
||||
.format(_calculateMarketValue(
|
||||
addItem,
|
||||
state
|
||||
.bldgAndStructure)))),
|
||||
DataCell(
|
||||
Text(
|
||||
assessmentLevel(
|
||||
_calculateMarketValue(
|
||||
addItem,
|
||||
state
|
||||
.bldgAndStructure),
|
||||
offlineBldgKey
|
||||
.currentState
|
||||
?.value[
|
||||
'actual_use']),
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
DataCell(Text(
|
||||
NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱")
|
||||
.format(double.parse(
|
||||
assessmentValue(
|
||||
_calculateMarketValue(
|
||||
addItem,
|
||||
state
|
||||
.bldgAndStructure),
|
||||
offlineBldgKey
|
||||
.currentState
|
||||
?.value[
|
||||
'actual_use'])
|
||||
.toString(),
|
||||
))
|
||||
.toString(),
|
||||
)),
|
||||
],
|
||||
),
|
||||
])
|
||||
],
|
||||
)),
|
||||
),
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -60,7 +60,27 @@ class _PropertyInfoPage extends State<PropertyInfoOfflinePage> {
|
|||
child: customTextField("Pin", "", 'pin')),
|
||||
],
|
||||
),
|
||||
customTextField("Owner", "", 'owner'),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField("First Name", "", 'fname'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("Middle Name", "", 'mname'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("Last Name", "", 'lname'),
|
||||
)
|
||||
]),
|
||||
customDatTimePicker("Birthday", "", "bday"),
|
||||
customTextField("Address", "", 'address'),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
|
@ -121,7 +141,14 @@ class _PropertyInfoPage extends State<PropertyInfoOfflinePage> {
|
|||
'',
|
||||
pin:
|
||||
offlineBldgKey.currentState!.value['pin'] ?? '',
|
||||
owner: offlineBldgKey.currentState!.value['owner'] ??
|
||||
fname: offlineBldgKey.currentState!.value['fname'] ??
|
||||
'',
|
||||
mname: offlineBldgKey.currentState!.value['mname'] ??
|
||||
'',
|
||||
lname: offlineBldgKey.currentState!.value['lname'] ??
|
||||
'',
|
||||
bday: offlineBldgKey.currentState!.value['bday']
|
||||
.toString() ??
|
||||
'',
|
||||
address:
|
||||
offlineBldgKey.currentState!.value['address'] ??
|
||||
|
@ -130,19 +157,17 @@ class _PropertyInfoPage extends State<PropertyInfoOfflinePage> {
|
|||
'',
|
||||
tin:
|
||||
offlineBldgKey.currentState!.value['tin'] ?? '',
|
||||
adminUser: offlineBldgKey
|
||||
.currentState!.value['benificiary'] ??
|
||||
'',
|
||||
adminAddress: offlineBldgKey.currentState!
|
||||
.value['benificiary_address'] ??
|
||||
'',
|
||||
adminUser:
|
||||
offlineBldgKey.currentState!.value['benificiary'] ?? '',
|
||||
adminAddress: offlineBldgKey.currentState!.value['benificiary_address'] ?? '',
|
||||
adminTin: offlineBldgKey.currentState!.value['benificiary_tin'] ?? '',
|
||||
adminTelno: offlineBldgKey.currentState!.value['benificiary_telno'] ?? '',
|
||||
faasType: "BUILDING",
|
||||
assessedById: widget.offlineProfile.id.toString(),
|
||||
assessedByName: widget.offlineProfile.firstName!,
|
||||
dateCreated: formatter,
|
||||
dateModified: ''),
|
||||
dateModified: '',
|
||||
genCode: '5th'),
|
||||
);
|
||||
widget.handleButtonPress();
|
||||
},
|
||||
|
|
|
@ -7,7 +7,6 @@ import 'package:unit2/bloc/offline/offline_passo/building/structural_materials_o
|
|||
import 'package:unit2/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||
import 'package:unit2/model/passo/structural_materials_ii.dart';
|
||||
import 'package:unit2/screens/offline/passo/building/add/add_building.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
|
@ -408,57 +407,58 @@ class _StructuralMaterialsOfflinePage
|
|||
|
||||
context
|
||||
.read<StructuralMaterialOfflineBloc>()
|
||||
.add(AddStructuralMaterial(
|
||||
id: 1,
|
||||
bldgapprDetailsId: tempID.getInt('tempid')!,
|
||||
assessedById: '',
|
||||
assessedByName: '',
|
||||
dateCreated: '',
|
||||
dateModified: '',
|
||||
foundation: foundationOthers
|
||||
? [
|
||||
offlineBldgKey
|
||||
.currentState!.value['other_foundation']
|
||||
]
|
||||
: widget.foundation,
|
||||
columns: columOthers
|
||||
? [
|
||||
offlineBldgKey
|
||||
.currentState!.value['other_column']
|
||||
]
|
||||
: widget.column,
|
||||
beams: beamsOthers
|
||||
? [
|
||||
offlineBldgKey
|
||||
.currentState!.value['other_beam']
|
||||
]
|
||||
: widget.beam,
|
||||
trussFraming: tfOthers
|
||||
? [
|
||||
offlineBldgKey
|
||||
.currentState!.value['other_tf']
|
||||
]
|
||||
: widget.trussFraming,
|
||||
roof: roofOthers
|
||||
? [
|
||||
offlineBldgKey
|
||||
.currentState!.value['other_roof']
|
||||
]
|
||||
: widget.roof,
|
||||
flooring: flooringOthers
|
||||
? [
|
||||
offlineBldgKey
|
||||
.currentState!.value['other_flooring']
|
||||
]
|
||||
: widget.flooring,
|
||||
walls: wpOthers
|
||||
? [
|
||||
offlineBldgKey
|
||||
.currentState!.value['other_wp']
|
||||
]
|
||||
: widget.walls,
|
||||
others: const ["Others"],
|
||||
));
|
||||
.add(
|
||||
AddStructuralMaterial(
|
||||
id: 1,
|
||||
bldgapprDetailsId: tempID.getInt('tempid')!,
|
||||
assessedById: '',
|
||||
assessedByName: '',
|
||||
dateCreated: '',
|
||||
dateModified: '',
|
||||
foundation: foundationOthers
|
||||
? [
|
||||
offlineBldgKey.currentState!
|
||||
.value['other_foundation']
|
||||
]
|
||||
: widget.foundation,
|
||||
columns: columOthers
|
||||
? [
|
||||
offlineBldgKey.currentState!
|
||||
.value['other_column']
|
||||
]
|
||||
: widget.column,
|
||||
beams: beamsOthers
|
||||
? [
|
||||
offlineBldgKey
|
||||
.currentState!.value['other_beam']
|
||||
]
|
||||
: widget.beam,
|
||||
trussFraming: tfOthers
|
||||
? [
|
||||
offlineBldgKey
|
||||
.currentState!.value['other_tf']
|
||||
]
|
||||
: widget.trussFraming,
|
||||
roof: roofOthers
|
||||
? [
|
||||
offlineBldgKey
|
||||
.currentState!.value['other_roof']
|
||||
]
|
||||
: widget.roof,
|
||||
flooring: flooringOthers
|
||||
? [
|
||||
offlineBldgKey.currentState!
|
||||
.value['other_flooring']
|
||||
]
|
||||
: widget.flooring,
|
||||
walls: wpOthers
|
||||
? [
|
||||
offlineBldgKey
|
||||
.currentState!.value['other_wp']
|
||||
]
|
||||
: widget.walls,
|
||||
others: const ["Others"],
|
||||
genCode: '5th'));
|
||||
widget.NextBtn();
|
||||
}
|
||||
;
|
||||
|
|
|
@ -570,7 +570,8 @@ class _AddExtraItemsEditOffline extends State<AddExtraItemsEditOffline> {
|
|||
painted: true,
|
||||
secondhand: true,
|
||||
paintedUnitval: '1',
|
||||
secondhandUnitval: '1'));
|
||||
secondhandUnitval: '1',
|
||||
genCode: "5th"));
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
|
|
|
@ -0,0 +1,743 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:searchfield/searchfield.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/admin/class_components_admin.dart/class_components_admin_bloc.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/admin/unit_construction/unit_construction_admin_bloc.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/building/additional_items_offline/additional_items_offline_bloc.dart';
|
||||
import 'package:unit2/model/offline/offline_profile.dart';
|
||||
import 'package:unit2/model/passo/additional_items.dart';
|
||||
import 'package:unit2/model/passo/class_components.dart';
|
||||
import 'package:unit2/model/passo/unit_construct.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
|
||||
class AddExtraItemsOffline extends StatefulWidget {
|
||||
final OfflineProfile offlineProfile;
|
||||
AddExtraItemsOffline(this.offlineProfile);
|
||||
|
||||
@override
|
||||
_AddExtraItemsOffline createState() => _AddExtraItemsOffline();
|
||||
}
|
||||
|
||||
class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||
GlobalKey<FormBuilderState> formKey = GlobalKey<FormBuilderState>();
|
||||
final focus = FocusNode();
|
||||
bool isPainted = false;
|
||||
bool isSecondHand = false;
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
double _unitBase = 0;
|
||||
double _areaValue = 0;
|
||||
final double _depValue = 0;
|
||||
double _unitValue = 0;
|
||||
String _className = "";
|
||||
int _classId = 0;
|
||||
String _structureType = "";
|
||||
bool _withoutBUCC = false;
|
||||
int _notPaintedUnitVal = 0;
|
||||
int _secondHandUnitVal = 0;
|
||||
|
||||
final DateTime now;
|
||||
final String formatter;
|
||||
|
||||
_AddExtraItemsOffline()
|
||||
: now = DateTime.now(),
|
||||
formatter = DateFormat.yMMMMd('en_US').format(DateTime.now());
|
||||
|
||||
BoxDecoration box1() {
|
||||
return const BoxDecoration(boxShadow: [
|
||||
BoxShadow(color: Colors.black12, spreadRadius: 5, blurRadius: 5)
|
||||
], color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(3)));
|
||||
}
|
||||
|
||||
double _amountofDepreciation(unitVal, unitBase, area, depreciation) {
|
||||
return ((unitVal * unitBase) * area) * depreciation;
|
||||
}
|
||||
|
||||
double _totalMarketValue(unitVal, unitBase, area, depreciation, withBUCC,
|
||||
className, painted, secondHand, paintedUnitVal, secondhandUntVal) {
|
||||
if (withBUCC == false) {
|
||||
if (painted == true || secondHand == true) {
|
||||
final deductions = (paintedUnitVal + secondhandUntVal) / 100;
|
||||
|
||||
print(deductions);
|
||||
return (((unitVal - deductions) * unitBase) * area);
|
||||
} else {
|
||||
return ((unitVal * unitBase) * area);
|
||||
}
|
||||
} else {
|
||||
return (unitVal * area);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<AdditionalItemsOfflineBloc, AdditionalItemsOfflineState>(
|
||||
buildWhen: (previous, current) {
|
||||
return false;
|
||||
}, builder: (context, state) {
|
||||
if (state is ShowAddItemsScreen) {
|
||||
return BlocConsumer<ClassComponentsAdminBloc,
|
||||
ClassComponentsAdminState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is ClassComponentsAdminLoaded) {
|
||||
final classes = state.classes;
|
||||
return BlocConsumer<UnitConstructionAdminBloc,
|
||||
UnitConstructionAdminState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is UnitConstructLoaded) {
|
||||
return FormBuilder(
|
||||
key: formKey,
|
||||
onChanged: () {
|
||||
formKey.currentState?.save();
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
height: 800,
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 10,
|
||||
right: 0,
|
||||
bottom: 0),
|
||||
child: FormBuilderDropdown(
|
||||
name: 'extra_item',
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Additional Item", ""),
|
||||
items: classes
|
||||
.map((e) => DropdownMenuItem(
|
||||
value: e,
|
||||
child: Text(e.componentName!),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (value) {
|
||||
if (value!.minBaseUnitvalPercent !=
|
||||
'0.00') {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
value.minBaseUnitvalPercent!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == 1
|
||||
? true
|
||||
: false;
|
||||
});
|
||||
formKey.currentState!.patchValue({
|
||||
'unitValue':
|
||||
value.minBaseUnitvalPercent
|
||||
});
|
||||
}
|
||||
if (value.maxBaseUnitvalPercent !=
|
||||
'0.00') {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
value.maxBaseUnitvalPercent!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == 1
|
||||
? true
|
||||
: false;
|
||||
});
|
||||
formKey.currentState!.patchValue({
|
||||
'unitValue':
|
||||
value.maxBaseUnitvalPercent
|
||||
});
|
||||
}
|
||||
if (value.minUnitvalSqrmtr !=
|
||||
'0.00') {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
value.minUnitvalSqrmtr!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == 1
|
||||
? true
|
||||
: false;
|
||||
});
|
||||
formKey.currentState!.patchValue({
|
||||
'unitValue':
|
||||
value.minUnitvalSqrmtr
|
||||
});
|
||||
}
|
||||
if (value.maxUnitvalSqrmtr !=
|
||||
'0.00') {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
value.maxUnitvalSqrmtr!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == 1
|
||||
? true
|
||||
: false;
|
||||
});
|
||||
formKey.currentState!.patchValue({
|
||||
'unitValue':
|
||||
value.maxUnitvalSqrmtr
|
||||
});
|
||||
}
|
||||
if (value.minAddBaseunitval !=
|
||||
'0.00') {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
value.minAddBaseunitval!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == 1
|
||||
? true
|
||||
: false;
|
||||
});
|
||||
formKey.currentState!.patchValue({
|
||||
'unitValue':
|
||||
value.minAddBaseunitval
|
||||
});
|
||||
}
|
||||
if (value.maxAddBaseunitval !=
|
||||
'0.00') {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
value.maxAddBaseunitval!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == 1
|
||||
? true
|
||||
: false;
|
||||
});
|
||||
formKey.currentState!.patchValue({
|
||||
'unitValue':
|
||||
value.maxAddBaseunitval
|
||||
});
|
||||
}
|
||||
if (value.minDeductBaserate !=
|
||||
'0.00') {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
value.minDeductBaserate!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == 1
|
||||
? true
|
||||
: false;
|
||||
});
|
||||
formKey.currentState!.patchValue({
|
||||
'unitValue':
|
||||
value.minDeductBaserate
|
||||
});
|
||||
}
|
||||
if (value.maxDeductBaserate !=
|
||||
'0.00') {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
value.maxDeductBaserate!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == 1
|
||||
? true
|
||||
: false;
|
||||
});
|
||||
formKey.currentState!.patchValue({
|
||||
'unitValue':
|
||||
value.maxDeductBaserate
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 10,
|
||||
right: 0,
|
||||
bottom: 0),
|
||||
child: SizedBox(
|
||||
height: 45,
|
||||
child: SearchField(
|
||||
itemHeight: 70,
|
||||
suggestions: state.unit
|
||||
.map((UnitConstruct unit) =>
|
||||
SearchFieldListItem(
|
||||
'${unit.bldgType} - ${unit.building}',
|
||||
item: unit,
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
'${unit.bldgType} - ${unit.building!.toUpperCase()}',
|
||||
overflow: TextOverflow
|
||||
.ellipsis,
|
||||
),
|
||||
)))
|
||||
.toList(),
|
||||
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle(
|
||||
"Structure Type", "")
|
||||
.copyWith(
|
||||
suffixIcon: const Icon(
|
||||
Icons
|
||||
.arrow_drop_down)),
|
||||
////agency suggestion tap
|
||||
focusNode: focus,
|
||||
suggestionState: Suggestion.expand,
|
||||
onSuggestionTap: (unit) {
|
||||
setState(() {
|
||||
if (_withoutBUCC) {
|
||||
_unitBase = double.parse(
|
||||
unit.item!.unitValue);
|
||||
_structureType =
|
||||
'${unit.item!.bldgType} - ${unit.item!.building}';
|
||||
} else {
|
||||
_unitBase = double.parse(
|
||||
unit.item!.unitValue);
|
||||
_structureType =
|
||||
'${unit.item!.bldgType} - ${unit.item!.building}';
|
||||
formKey.currentState!
|
||||
.patchValue({
|
||||
'unitValue':
|
||||
unit.item!.unitValue
|
||||
});
|
||||
}
|
||||
});
|
||||
focus.unfocus();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
// const SizedBox(height: 10),
|
||||
// Container(
|
||||
// margin: const EdgeInsets.only(
|
||||
// left: 0, top: 10, right: 0, bottom: 0),
|
||||
// child: FormBuilderDropdown(
|
||||
// name: 'struc_type',
|
||||
// autofocus: false,
|
||||
// decoration:
|
||||
// normalTextFieldStyle("Structure Type", ""),
|
||||
// items: widget.unit
|
||||
// .map((e) => DropdownMenuItem(
|
||||
// value: e,
|
||||
// child:
|
||||
// Text(e.bldgType + " - " + e.building),
|
||||
// ))
|
||||
// .toList(),
|
||||
// onChanged: (val) {
|
||||
// setState(() {
|
||||
// _unitBase = double.parse(val!.unitValue);
|
||||
// _structureType = val.bldgType;
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
name: 'unitValue',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Unit Value", ""),
|
||||
validator:
|
||||
FormBuilderValidators.compose(
|
||||
[]),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
name: 'areaValue',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Area", ""),
|
||||
validator:
|
||||
FormBuilderValidators.compose(
|
||||
[]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_areaValue =
|
||||
double.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// const SizedBox(height: 10),
|
||||
// FormBuilderTextField(
|
||||
// name: 'depRate',
|
||||
// decoration:
|
||||
// normalTextFieldStyle("Depreciation Rate", ""),
|
||||
// validator: FormBuilderValidators.compose([]),
|
||||
// onChanged: (value) {
|
||||
// setState(() {
|
||||
// _depValue = double.parse(value!);
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// const SizedBox(height: 10),
|
||||
// FormBuilderTextField(
|
||||
// name: 'marketValue',
|
||||
// decoration: normalTextFieldStyle(
|
||||
// NumberFormat.currency(
|
||||
// locale: 'en-PH', symbol: "₱")
|
||||
// .format(_totalMarketValue(_unitValue,
|
||||
// _unitBase, _areaValue, _depValue)),
|
||||
// ""),
|
||||
// validator: FormBuilderValidators.compose([]),
|
||||
// onChanged: (value) {
|
||||
// setState(() {
|
||||
// _marketValue = double.parse(value!);
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// const SizedBox(height: 10),
|
||||
// Text('Amount of Depreciation'),
|
||||
// const SizedBox(height: 5),
|
||||
// Container(
|
||||
// height: 45.0,
|
||||
// width: double.infinity,
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.white,
|
||||
// border: Border.all(
|
||||
// color: Colors.grey,
|
||||
// width: 1.0,
|
||||
// ),
|
||||
// borderRadius: BorderRadius.circular(5.0),
|
||||
// ),
|
||||
// child: Align(
|
||||
// alignment: Alignment.center,
|
||||
// child: Text(NumberFormat.currency(
|
||||
// locale: 'en-PH', symbol: "₱")
|
||||
// .format(_amountofDepreciation(_unitValue,
|
||||
// _unitBase, _areaValue, _depValue)))),
|
||||
// ),
|
||||
|
||||
Visibility(
|
||||
visible: !_withoutBUCC,
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
const Text(
|
||||
'Building is not painted?'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: isPainted,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
isPainted = value!;
|
||||
if (value == false) {
|
||||
_notPaintedUnitVal = 0;
|
||||
} else {
|
||||
_notPaintedUnitVal = 10;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Container(
|
||||
height: 40.0,
|
||||
width: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment:
|
||||
Alignment.center,
|
||||
child: Text(' - ' +
|
||||
_notPaintedUnitVal
|
||||
.toString() +
|
||||
'%')),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text(
|
||||
'Uses second hand materials?'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: isSecondHand,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
isSecondHand = value!;
|
||||
if (isSecondHand ==
|
||||
false) {
|
||||
_secondHandUnitVal = 0;
|
||||
formKey.currentState!
|
||||
.patchValue({
|
||||
'secondHandMat': '0'
|
||||
});
|
||||
} else {
|
||||
_secondHandUnitVal = 5;
|
||||
formKey.currentState!
|
||||
.patchValue({
|
||||
'secondHandMat': '5'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 40,
|
||||
width: 100,
|
||||
child:
|
||||
FormBuilderTextField(
|
||||
enabled: isSecondHand,
|
||||
name: 'secondHandMat',
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Unit Value",
|
||||
""),
|
||||
validator:
|
||||
FormBuilderValidators
|
||||
.compose([]),
|
||||
onChanged: (value) {
|
||||
// Check if the value is not null before parsing to double
|
||||
if (value != null &&
|
||||
value
|
||||
.isNotEmpty) {
|
||||
setState(() {
|
||||
_secondHandUnitVal =
|
||||
int.parse(
|
||||
value);
|
||||
});
|
||||
} else {
|
||||
// Handle the case when the value is empty or null
|
||||
// For example, set _secondHandUnitVal to a default value or show an error message.
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 40,
|
||||
width: 40,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'%',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.bold),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 10),
|
||||
const Text('Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(_totalMarketValue(
|
||||
_unitValue,
|
||||
_unitBase,
|
||||
_areaValue,
|
||||
_depValue,
|
||||
_withoutBUCC,
|
||||
_className,
|
||||
isPainted,
|
||||
isSecondHand,
|
||||
_notPaintedUnitVal,
|
||||
_secondHandUnitVal)))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
try {
|
||||
final tempID =
|
||||
await SharedPreferences
|
||||
.getInstance();
|
||||
|
||||
context.read<AdditionalItemsOfflineBloc>().add(
|
||||
AddAdditionalItems(
|
||||
id: 1,
|
||||
bldgapprDetailsId: tempID
|
||||
.getInt('tempid')!,
|
||||
classId: _classId,
|
||||
assessedById: widget
|
||||
.offlineProfile.id
|
||||
.toString(),
|
||||
assessedByName: widget
|
||||
.offlineProfile
|
||||
.firstName!,
|
||||
dateCreated: formatter,
|
||||
dateModified: 'None',
|
||||
className: _className,
|
||||
structType:
|
||||
_structureType,
|
||||
unitValue:
|
||||
_withoutBUCC == true
|
||||
? 0
|
||||
: _unitValue,
|
||||
baseUnitValue:
|
||||
_unitBase,
|
||||
area: _areaValue,
|
||||
marketValue:
|
||||
(_unitValue *
|
||||
_unitBase) *
|
||||
_areaValue,
|
||||
depreciationRate:
|
||||
_depValue,
|
||||
adjustedMarketVal:
|
||||
_totalMarketValue(
|
||||
_unitValue,
|
||||
_unitBase,
|
||||
_areaValue,
|
||||
_depValue,
|
||||
_withoutBUCC,
|
||||
_className,
|
||||
isPainted,
|
||||
isSecondHand,
|
||||
_notPaintedUnitVal,
|
||||
_secondHandUnitVal),
|
||||
actualUse: 'Test',
|
||||
amtDepreciation:
|
||||
_amountofDepreciation(
|
||||
_unitValue,
|
||||
_unitBase,
|
||||
_areaValue,
|
||||
_depValue,
|
||||
),
|
||||
painted: true,
|
||||
secondhand: true,
|
||||
paintedUnitval: '1',
|
||||
secondhandUnitval: '1',
|
||||
genCode: "5th"));
|
||||
} catch (e) {
|
||||
Fluttertoast.showToast(
|
||||
msg:
|
||||
"Slow internet connection, please try again!",
|
||||
);
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Submit"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width:
|
||||
5), // Use SizedBox for horizontal spacing in a Row
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
.read<
|
||||
AdditionalItemsOfflineBloc>()
|
||||
.add(
|
||||
const LoadAdditionalItems());
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Cancel"),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
// if (state is Add) {
|
||||
// return SomethingWentWrong(
|
||||
// message: onError,
|
||||
// onpressed: () {
|
||||
// context.read<AdditionalItemBloc>().add(LoadAdditionalItems());
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -12,7 +12,6 @@ import '../../../../../model/passo/class_components.dart';
|
|||
import '../../../../../model/passo/unit_construct.dart';
|
||||
import '../../../../../utils/alerts.dart';
|
||||
import '../../../../../widgets/passo/custom_button.dart';
|
||||
import '../../../../passo/Building/edit_building/AddExtraItems.dart';
|
||||
|
||||
class AdditionalItemEditPageOffline extends StatefulWidget {
|
||||
final List<UnitConstruct> unit;
|
||||
|
@ -45,6 +44,14 @@ class _AdditionalItemEditPageOffline
|
|||
// return total;
|
||||
// }
|
||||
|
||||
double _totalMarketValue(items) {
|
||||
double total = 0;
|
||||
items.forEach((row) {
|
||||
total += double.parse(row.adjustedMarketVal);
|
||||
});
|
||||
return total;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
|
@ -88,14 +95,14 @@ class _AdditionalItemEditPageOffline
|
|||
.read<AdditionalItemsOfflineBloc>()
|
||||
.add(ShowAdditionalItems());
|
||||
},
|
||||
child: Row(
|
||||
child: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text('ADD ITEM'), // <-- Text
|
||||
const SizedBox(
|
||||
Text('ADD ITEM'), // <-- Text
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
const Icon(
|
||||
Icon(
|
||||
// <-- Icon
|
||||
Icons.add,
|
||||
size: 24.0,
|
||||
|
@ -147,11 +154,11 @@ class _AdditionalItemEditPageOffline
|
|||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.delete,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
|
@ -167,18 +174,18 @@ class _AdditionalItemEditPageOffline
|
|||
"Are you sure you want to delete this item?");
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.edit,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
|
@ -199,25 +206,25 @@ class _AdditionalItemEditPageOffline
|
|||
),
|
||||
),
|
||||
),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 20.0, right: 20.0),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Total',
|
||||
// style:
|
||||
// TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
// ),
|
||||
// Text(
|
||||
// NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
||||
// .format(_totalMarketValue(state.items)),
|
||||
// style:
|
||||
// TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0, right: 20.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
'Total Market Value',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 17),
|
||||
),
|
||||
Text(
|
||||
NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
||||
.format(_totalMarketValue(state.addItem)),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 17),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Row(
|
||||
|
@ -230,7 +237,6 @@ class _AdditionalItemEditPageOffline
|
|||
{
|
||||
widget.PrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
|
@ -240,7 +246,6 @@ class _AdditionalItemEditPageOffline
|
|||
{
|
||||
widget.NextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
|
@ -265,13 +270,13 @@ class _AdditionalItemEditPageOffline
|
|||
}
|
||||
if (state is ShowAddItemsScreen) {
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxHeight: 1000.0),
|
||||
constraints: const BoxConstraints(maxHeight: 1000.0),
|
||||
child: AlertDialog(
|
||||
insetPadding: EdgeInsets.symmetric(
|
||||
insetPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 20.0,
|
||||
vertical: 10.0,
|
||||
),
|
||||
title: Text(
|
||||
title: const Text(
|
||||
'ADD EXTRA ITEMS',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
|
@ -306,14 +311,14 @@ class _AdditionalItemEditPageOffline
|
|||
.read<AdditionalItemsOfflineBloc>()
|
||||
.add(ShowAdditionalItems());
|
||||
},
|
||||
child: Row(
|
||||
child: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text('ADD ITEM'), // <-- Text
|
||||
const SizedBox(
|
||||
Text('ADD ITEM'), // <-- Text
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
const Icon(
|
||||
Icon(
|
||||
// <-- Icon
|
||||
Icons.add,
|
||||
size: 24.0,
|
||||
|
|
|
@ -0,0 +1,336 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/building/building_and_structure/building_and_structure_bloc.dart';
|
||||
import 'package:unit2/model/offline/offline_profile.dart';
|
||||
import 'package:unit2/screens/offline/passo/building/add/AddBuildingAndStructure..dart';
|
||||
|
||||
import '../../../../../utils/alerts.dart';
|
||||
import '../../../../../widgets/passo/custom_button.dart';
|
||||
|
||||
class BuildingAndStructureOfflinePage extends StatefulWidget {
|
||||
final VoidCallback additionalItemsPrevBtn;
|
||||
final VoidCallback additionalItemsNextBtn;
|
||||
final OfflineProfile offlineProfile;
|
||||
|
||||
const BuildingAndStructureOfflinePage(this.additionalItemsPrevBtn,
|
||||
this.additionalItemsNextBtn, this.offlineProfile);
|
||||
|
||||
@override
|
||||
_BuildingAndStructureOfflinePage createState() =>
|
||||
_BuildingAndStructureOfflinePage();
|
||||
}
|
||||
|
||||
class _BuildingAndStructureOfflinePage
|
||||
extends State<BuildingAndStructureOfflinePage> {
|
||||
// void deleteItem(int itemId) {
|
||||
// context.read<AdditionalItemBloc>().add(DeleteAdditionalItems(id: itemId));
|
||||
// }
|
||||
|
||||
void deleteItem(int itemId) {
|
||||
context
|
||||
.read<BuildingAndStructureBloc>()
|
||||
.add(DeleteBuildingAndStructure(id: itemId));
|
||||
}
|
||||
|
||||
final items = [];
|
||||
|
||||
double _totalMarketValue(items) {
|
||||
double total = 0;
|
||||
items.forEach((row) {
|
||||
total += double.parse(row.adjustedMarketValue);
|
||||
});
|
||||
return total;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: BlocConsumer<BuildingAndStructureBloc, BuildingAndStructureState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is BuildingAndStructureOfflineInitial) {
|
||||
return Column(children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('BUILDING AND STRUCTURE',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
onPressed: () {
|
||||
context
|
||||
.read<BuildingAndStructureBloc>()
|
||||
.add(ShowBuildingAndStructure());
|
||||
},
|
||||
child: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text('ADD NEW'), // <-- Text
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Icon(
|
||||
// <-- Icon
|
||||
Icons.add,
|
||||
size: 24.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
]))))
|
||||
]);
|
||||
}
|
||||
if (state is BuildingAndStructureLoaded) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('BUILDING AND STRUCTURES',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
onPressed: () {
|
||||
context
|
||||
.read<BuildingAndStructureBloc>()
|
||||
.add(ShowBuildingAndStructure());
|
||||
},
|
||||
child: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text('ADD ITEM'), // <-- Text
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Icon(
|
||||
// <-- Icon
|
||||
Icons.add,
|
||||
size: 24.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: DataTable(
|
||||
// ignore: prefer_const_literals_to_create_immutables
|
||||
columns: [
|
||||
const DataColumn(
|
||||
label: Text('Building Core'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Type'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Area'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Unit Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('% of BUCC'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Base Market Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('% of Depreciation'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Depreciation Cost'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Market Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Action'),
|
||||
)
|
||||
],
|
||||
rows: state.bldgAndStructure.map((dataRow) {
|
||||
return DataRow(
|
||||
cells: [
|
||||
DataCell(Text(dataRow.actualUse!)),
|
||||
DataCell(Text(dataRow.bldgType!)),
|
||||
DataCell(Text(dataRow.bldgArea!)),
|
||||
DataCell(Text(
|
||||
NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(double.parse(dataRow.unitValue!)),
|
||||
)),
|
||||
const DataCell(Text("100%")),
|
||||
DataCell(Text(
|
||||
NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(
|
||||
double.parse(dataRow.marketValue!)),
|
||||
)),
|
||||
DataCell(Text(dataRow.depRate!)),
|
||||
DataCell(Text(
|
||||
NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(double.parse(dataRow.depAmount!)),
|
||||
)),
|
||||
DataCell(Text(
|
||||
NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(double.parse(
|
||||
dataRow.adjustedMarketValue!)),
|
||||
)),
|
||||
DataCell(Row(
|
||||
children: [
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.delete,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
confirmAlertWithCancel(
|
||||
context,
|
||||
() => deleteItem(dataRow.id!),
|
||||
() => null,
|
||||
'Delete Item?',
|
||||
"Are you sure you want to delete this item?");
|
||||
},
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0, right: 20.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
'Total Market Value',
|
||||
style:
|
||||
TextStyle(fontWeight: FontWeight.bold, fontSize: 17),
|
||||
),
|
||||
Text(
|
||||
NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
||||
.format(_totalMarketValue(state.bldgAndStructure)),
|
||||
style:
|
||||
TextStyle(fontWeight: FontWeight.bold, fontSize: 17),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.additionalItemsPrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.additionalItemsNextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
if (state is BuildingAndStructureDeletedState) {
|
||||
if (state.success) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
successAlert(context, "Deletion Successful",
|
||||
"Extra item has been deleted successfully", () {
|
||||
Navigator.of(context).pop();
|
||||
context
|
||||
.read<BuildingAndStructureBloc>()
|
||||
.add(LoadBuildingAndStructure());
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
if (state is ShowBldgAndStructuresScreen) {
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxHeight: 1000.0),
|
||||
child: AlertDialog(
|
||||
insetPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 10.0,
|
||||
vertical: 10.0,
|
||||
),
|
||||
title: const Text(
|
||||
'ADD NEW BLDG & STRUCTURE',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child:
|
||||
AddBuildingAndStructureOffline(widget.offlineProfile))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
|
@ -6,7 +6,9 @@ import 'package:flutter_spinkit/flutter_spinkit.dart';
|
|||
import 'package:im_stepper/stepper.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/admin/class_components_admin.dart/class_components_admin_bloc.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/admin/unit_construction/unit_construction_admin_bloc.dart';
|
||||
import 'package:unit2/model/offline/offline_profile.dart';
|
||||
import 'package:unit2/screens/offline/passo/building/edit/additional_items_edit.dart';
|
||||
import 'package:unit2/screens/offline/passo/building/edit/building_and_structure.dart';
|
||||
import 'package:unit2/screens/offline/passo/building/edit/general_description_edit.dart';
|
||||
import 'package:unit2/screens/offline/passo/building/edit/landref_location_edit.dart';
|
||||
import 'package:unit2/screens/offline/passo/building/edit/property_appraisal_edit.dart';
|
||||
|
@ -23,12 +25,14 @@ class EditBuildingOffline extends StatefulWidget {
|
|||
final int index;
|
||||
final PropertyInfo faas;
|
||||
final String title;
|
||||
final OfflineProfile offlineProfile;
|
||||
|
||||
const EditBuildingOffline(
|
||||
{super.key,
|
||||
required this.title,
|
||||
required this.index,
|
||||
required this.faas});
|
||||
required this.faas,
|
||||
required this.offlineProfile});
|
||||
@override
|
||||
_EditBuildingOffline createState() => _EditBuildingOffline();
|
||||
}
|
||||
|
@ -37,7 +41,7 @@ class _EditBuildingOffline extends State<EditBuildingOffline> {
|
|||
// THE FOLLOWING TWO VARIABLES ARE REQUIRED TO CONTROL THE STEPPER.
|
||||
int activeStep = 0; // Initial step set to 5.
|
||||
|
||||
int upperBound = 6; // upperBound MUST BE total number of icons minus 1.
|
||||
int upperBound = 7; // upperBound MUST BE total number of icons minus 1.
|
||||
|
||||
void PrevBtn() {
|
||||
setState(() {
|
||||
|
@ -61,7 +65,7 @@ class _EditBuildingOffline extends State<EditBuildingOffline> {
|
|||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
backgroundColor: primary,
|
||||
title: Text('Building FAAS Edit'),
|
||||
title: const Text('Building FAAS Edit'),
|
||||
),
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
|
@ -85,9 +89,9 @@ class _EditBuildingOffline extends State<EditBuildingOffline> {
|
|||
return Column(
|
||||
children: [
|
||||
NumberStepper(
|
||||
numbers: [1, 2, 3, 4, 5, 6, 7],
|
||||
numbers: const [1, 2, 3, 4, 5, 6, 7, 8],
|
||||
activeStepColor: primary,
|
||||
numberStyle: TextStyle(color: Colors.white),
|
||||
numberStyle: const TextStyle(color: Colors.white),
|
||||
lineColor: primary,
|
||||
// activeStep property set to activeStep variable defined above.
|
||||
activeStep: activeStep,
|
||||
|
@ -140,18 +144,22 @@ class _EditBuildingOffline extends State<EditBuildingOffline> {
|
|||
return GeneralDescriptionEditOffline(widget.faas.id!, NextBtn, PrevBtn);
|
||||
|
||||
case 3:
|
||||
return BuildingAndStructureOfflinePage(
|
||||
PrevBtn, NextBtn, widget.offlineProfile);
|
||||
|
||||
case 4:
|
||||
return StructuralMaterialsPageEditOffline(
|
||||
widget.faas.id!, NextBtn, PrevBtn);
|
||||
|
||||
case 4:
|
||||
case 5:
|
||||
return AdditionalItemEditPageOffline(
|
||||
unit, classes, widget.faas.id!, NextBtn, PrevBtn);
|
||||
|
||||
case 5:
|
||||
case 6:
|
||||
return PropertyAppraisalEditPageOffline(
|
||||
widget.faas.id!, NextBtn, PrevBtn);
|
||||
|
||||
case 6:
|
||||
case 7:
|
||||
return PropertyAssessmentEditOfflinePage(widget.faas.id!, onSAveAll);
|
||||
|
||||
default:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -60,7 +60,10 @@ class _PropertyOwnerInfoEditOffline
|
|||
'transaction_code': widget.faas.transCode,
|
||||
'arp_td': widget.faas.tdn,
|
||||
'pin': widget.faas.pin,
|
||||
'owner': widget.faas.owner,
|
||||
'fname': widget.faas.fname,
|
||||
'mname': widget.faas.mname,
|
||||
'lname': widget.faas.lname,
|
||||
'bday': widget.faas.bday,
|
||||
'address': widget.faas.address,
|
||||
'tel_no': widget.faas.telno,
|
||||
'tin': widget.faas.tin,
|
||||
|
@ -110,7 +113,31 @@ class _PropertyOwnerInfoEditOffline
|
|||
child: customTextField("Pin", "", 'pin')),
|
||||
],
|
||||
),
|
||||
customTextField("Owner", "", 'owner'),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"First Name", "", 'fname'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Middle Name", "", 'mname'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Last Name", "", 'lname'),
|
||||
)
|
||||
]),
|
||||
customDatTimePicker("Birthday", "", "bday"),
|
||||
customTextField("Address", "", 'address'),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
|
@ -181,12 +208,13 @@ class _PropertyOwnerInfoEditOffline
|
|||
widget.faas.tdn,
|
||||
pin: offlineBldgEditKey.currentState!.value['pin'] ??
|
||||
widget.faas.pin,
|
||||
owner: offlineBldgEditKey
|
||||
.currentState!.value['owner'] ??
|
||||
widget.faas.owner,
|
||||
address: offlineBldgEditKey
|
||||
.currentState!.value['address'] ??
|
||||
widget.faas.address,
|
||||
fname: offlineBldgEditKey
|
||||
.currentState!.value['fname'] ??
|
||||
widget.faas.fname,
|
||||
mname: offlineBldgEditKey
|
||||
.currentState!.value['mname'] ??
|
||||
widget.faas.mname,
|
||||
address: offlineBldgEditKey.currentState!.value['address'] ?? widget.faas.address,
|
||||
telno: offlineBldgEditKey.currentState!.value['tel_no'] ?? widget.faas.telno,
|
||||
tin: offlineBldgEditKey.currentState!.value['tin'] ?? widget.faas.tin,
|
||||
adminUser: offlineBldgEditKey.currentState!.value['benificiary'] ?? widget.faas.adminUser,
|
||||
|
|
|
@ -47,13 +47,13 @@ class _StructuralMaterialsPageEditOffline
|
|||
StructuralMaterialOfflineState>(listener: (context, state) {
|
||||
if (state is SpecificStructuralMaterialLoaded) {
|
||||
setState(() {
|
||||
foundation = state.materials.foundation?.split(', ') ?? [];
|
||||
column = state.materials.columns?.split(', ') ?? [];
|
||||
beam = state.materials.beams?.split(', ') ?? [];
|
||||
truss_framing = state.materials.trussFraming?.split(', ') ?? [];
|
||||
roof = state.materials.roof?.split(', ') ?? [];
|
||||
flooring = state.materials.flooring?.split(', ') ?? [];
|
||||
walls = state.materials.walls?.split(', ') ?? [];
|
||||
// foundation = state.materials.foundation?.split(', ') ?? [];
|
||||
// column = state.materials.columns?.split(', ') ?? [];
|
||||
// beam = state.materials.beams?.split(', ') ?? [];
|
||||
// truss_framing = state.materials.trussFraming?.split(', ') ?? [];
|
||||
// roof = state.materials.roof?.split(', ') ?? [];
|
||||
// flooring = state.materials.flooring?.split(', ') ?? [];
|
||||
// walls = state.materials.walls?.split(', ') ?? [];
|
||||
// Update other local state variables here if needed
|
||||
});
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class _StructuralMaterialsPageEditOffline
|
|||
child: const Text(
|
||||
'STRUCTURAL MATERIALS',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
|
@ -114,7 +114,8 @@ class _StructuralMaterialsPageEditOffline
|
|||
},
|
||||
options: const ['Reinforced Concrete', 'Plain Concrete'],
|
||||
selectedValues: foundation,
|
||||
whenEmpty: 'Select Foundations',
|
||||
whenEmpty:
|
||||
state.materials.foundation ?? 'Select Foundations',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -155,7 +156,7 @@ class _StructuralMaterialsPageEditOffline
|
|||
},
|
||||
options: const ['Steel', 'Reinforced Concrete', 'Wood'],
|
||||
selectedValues: column,
|
||||
whenEmpty: 'Select Column/s',
|
||||
whenEmpty: state.materials.columns ?? 'Select Column/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -196,7 +197,7 @@ class _StructuralMaterialsPageEditOffline
|
|||
},
|
||||
options: const ['Steel', 'Reinforced Concrete', 'Wood'],
|
||||
selectedValues: beam,
|
||||
whenEmpty: 'Select Beam/s',
|
||||
whenEmpty: state.materials.beams ?? 'Select Beam/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -237,7 +238,8 @@ class _StructuralMaterialsPageEditOffline
|
|||
},
|
||||
options: const ['Steel', 'Wood'],
|
||||
selectedValues: truss_framing,
|
||||
whenEmpty: 'Select Truss Framing/s',
|
||||
whenEmpty: state.materials.trussFraming ??
|
||||
'Select Truss Framing/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -287,7 +289,7 @@ class _StructuralMaterialsPageEditOffline
|
|||
'Nipa/Anahaw/Cogon'
|
||||
],
|
||||
selectedValues: roof,
|
||||
whenEmpty: 'Select Roof/s',
|
||||
whenEmpty: state.materials.roof ?? 'Select Roof/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -334,7 +336,8 @@ class _StructuralMaterialsPageEditOffline
|
|||
'Tiles'
|
||||
],
|
||||
selectedValues: flooring,
|
||||
whenEmpty: 'Select Flooring/s',
|
||||
whenEmpty:
|
||||
state.materials.flooring ?? 'Select Flooring/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -384,7 +387,8 @@ class _StructuralMaterialsPageEditOffline
|
|||
'Bamboo'
|
||||
],
|
||||
selectedValues: walls,
|
||||
whenEmpty: 'Select Walls & Partition/s',
|
||||
whenEmpty:
|
||||
state.materials.walls ?? 'Select Walls & Partition/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/admin/barangay_admin/barangay_admin_bloc.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/admin/class_components_admin.dart/class_components_admin_bloc.dart';
|
||||
import 'package:unit2/bloc/offline/offline_passo/admin/memoranda/memoranda_admin_bloc.dart';
|
||||
|
@ -19,7 +23,12 @@ import 'package:unit2/bloc/offline/offline_passo/building/location/location_bloc
|
|||
import 'package:unit2/bloc/offline/offline_passo/building/structural_materials_offline.dart/structural_material_offline_bloc.dart';
|
||||
import 'package:unit2/model/offline/offline_profile.dart';
|
||||
import 'package:unit2/model/passo/additional_items.dart';
|
||||
import 'package:unit2/model/passo/bldg_loc.dart';
|
||||
import 'package:unit2/model/passo/building_and_structure.dart';
|
||||
import 'package:unit2/model/passo/building_details.dart';
|
||||
import 'package:unit2/model/passo/land_ref.dart';
|
||||
import 'package:unit2/model/passo/property_appraisal.dart';
|
||||
import 'package:unit2/model/passo/property_assessment.dart';
|
||||
import 'package:unit2/model/passo/property_info.dart';
|
||||
import 'package:unit2/screens/offline/passo/building/add/add_building.dart';
|
||||
import 'package:unit2/screens/offline/passo/building/edit/edit_building.dart';
|
||||
|
@ -41,7 +50,14 @@ import '../../../bloc/offline/offline_passo/land/land_property_owner_bloc/land_p
|
|||
import '../../../bloc/offline/offline_passo/land/land_property_signture/land_property_signature_bloc.dart';
|
||||
import '../../../bloc/offline/offline_passo/land/other_improvements/other_improvements_bloc.dart';
|
||||
import '../../../bloc/offline/offline_passo/land/value_adjustment/value_adjustment_bloc.dart';
|
||||
import '../../../model/passo/general_description.dart';
|
||||
import '../../../model/passo/structureMaterial.dart';
|
||||
import '../../../sevices/offline/offline_passo/admin/sql_services/sql_services.dart';
|
||||
import '../../../utils/alerts.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:date_format/date_format.dart';
|
||||
|
||||
import '../../../utils/urls.dart';
|
||||
|
||||
class BuildingHomeOffline extends StatelessWidget {
|
||||
final OfflineProfile offlineProfile;
|
||||
|
@ -63,6 +79,267 @@ class BuildingHomeOffline extends StatelessWidget {
|
|||
myBloc.add(LoadLandPropertyOwner());
|
||||
}
|
||||
|
||||
void uploadBldg() async {
|
||||
List<PropertyInfo> propertyOwner =
|
||||
await SQLServices.instance.readAllBldgOwner();
|
||||
for (PropertyInfo infos in propertyOwner) {
|
||||
//General Description
|
||||
List<Map<String, dynamic>> genDesc =
|
||||
await SQLServices.instance.getGeneralDescription(infos.id);
|
||||
List<GeneralDesc> genDescList =
|
||||
genDesc.map((map) => GeneralDesc.fromJson2(map)).toList();
|
||||
|
||||
GeneralDesc firstGenDesc = genDescList.first;
|
||||
|
||||
//Location
|
||||
List<Map<String, dynamic>> loc =
|
||||
await SQLServices.instance.getLandRef(infos.id);
|
||||
|
||||
List<BldgLoc> locList =
|
||||
loc.map((map) => BldgLoc.fromJson2(map)).toList();
|
||||
|
||||
BldgLoc firstLoc = locList.first;
|
||||
|
||||
//Land Refeernce
|
||||
List<Map<String, dynamic>> landRef =
|
||||
await SQLServices.instance.getLocation(infos.id);
|
||||
|
||||
List<LandRef> landRefList =
|
||||
landRef.map((map) => LandRef.fromJson2(map)).toList();
|
||||
|
||||
LandRef firstLandRef = landRefList.first;
|
||||
|
||||
//Assessment
|
||||
List<Map<String, dynamic>> assessment =
|
||||
await SQLServices.instance.getBldgAssessment(infos.id);
|
||||
|
||||
List<PropertyAssessment> assessList =
|
||||
assessment.map((map) => PropertyAssessment.fromJson2(map)).toList();
|
||||
|
||||
PropertyAssessment firstAssess = assessList.first;
|
||||
|
||||
//Structural Materials
|
||||
List<Map<String, dynamic>> strucMat =
|
||||
await SQLServices.instance.getStructuralMaterials(infos.id);
|
||||
List<StructureMaterials> strcuMatList =
|
||||
strucMat.map((map) => StructureMaterials.fromJson2(map)).toList();
|
||||
|
||||
StructureMaterials firstStructMat = strcuMatList.first;
|
||||
|
||||
//Additional Items
|
||||
List<Map<String, dynamic>> addItems =
|
||||
await SQLServices.instance.getAdditionalItems(infos.id);
|
||||
List<AdditionalItems> addItemsList =
|
||||
addItems.map((map) => AdditionalItems.fromJson(map)).toList();
|
||||
|
||||
//BLDG Structure
|
||||
List<Map<String, dynamic>> bldgStructure =
|
||||
await SQLServices.instance.getBuildingAndStructure(infos.id);
|
||||
List<BldgAndStructure> bldgStructureList =
|
||||
bldgStructure.map((map) => BldgAndStructure.fromJson(map)).toList();
|
||||
|
||||
DateTime dateIssued = DateTime.parse(firstGenDesc.dateIssued!);
|
||||
|
||||
final details = {
|
||||
"assessed_by_id": offlineProfile.id.toString(),
|
||||
"assessed_by_name": offlineProfile.firstName,
|
||||
"date_created": "{{currentTimestamp}}",
|
||||
"date_modified": "{{currentTimestamp}}",
|
||||
"trans_code": infos.transCode,
|
||||
"tdn": infos.tdn,
|
||||
"pin": infos.pin,
|
||||
"fname": infos.fname,
|
||||
"mname": infos.mname,
|
||||
"lname": infos.lname,
|
||||
"bday": infos.bday,
|
||||
"address": infos.address,
|
||||
"telno": infos.telno,
|
||||
"tin": infos.tin,
|
||||
"admin_user": infos.adminUser,
|
||||
"admin_address": infos.adminAddress,
|
||||
"admin_telno": infos.adminTelno,
|
||||
"admin_tin": infos.adminTin,
|
||||
"faas_type": infos.faasType,
|
||||
"gen_code": "5TH",
|
||||
"bldgappr_location.date_created": "{{currentTimestamp}}",
|
||||
"bldgappr_location.date_modified": "{{currentTimestamp}}",
|
||||
"bldgappr_location.street": firstLoc.street,
|
||||
"bldgappr_location.barangay": firstLoc.barangay,
|
||||
"bldgappr_location.municipality": firstLoc.municipality,
|
||||
"bldgappr_location.province": firstLoc.province,
|
||||
"bldgappr_location.gen_code": "5TH",
|
||||
"bldgappr_landref.date_created": "{{currentTimestamp}}",
|
||||
"bldgappr_landref.date_modified": "{{currentTimestamp}}",
|
||||
"bldgappr_landref.owner": firstLandRef.owner,
|
||||
"bldgappr_landref.cloa_no": firstLandRef.cloaNo,
|
||||
"bldgappr_landref.lot_no": firstLandRef.lotNo,
|
||||
"bldgappr_landref.tdn": firstLandRef.tdn,
|
||||
"bldgappr_landref.area": firstLandRef.area,
|
||||
"bldgappr_landref.survey_no": firstLandRef.surveyNo,
|
||||
"bldgappr_landref.blk_no": firstLandRef.blkNo,
|
||||
"bldgappr_landref.gen_code": "5TH",
|
||||
"bldgappr_generaldesc.date_created": "{{currentTimestamp}}",
|
||||
"bldgappr_generaldesc.date_modified": "{{currentTimestamp}}",
|
||||
"bldgappr_generaldesc.bldg_kind": firstGenDesc.bldgKind,
|
||||
"bldgappr_generaldesc.struc_type": firstGenDesc.strucType,
|
||||
"bldgappr_generaldesc.bldg_permit": firstGenDesc.bldgPermit,
|
||||
"bldgappr_generaldesc.date_issued": DateFormat("yyyy-MM-dd")
|
||||
.format(DateTime.parse(firstGenDesc.dateIssued!)),
|
||||
"bldgappr_generaldesc.cct": null,
|
||||
"bldgappr_generaldesc.cert_completion_issued":
|
||||
DateFormat("yyyy-MM-dd")
|
||||
.format(DateTime.parse(firstGenDesc.certCompletionIssued!)),
|
||||
"bldgappr_generaldesc.cert_ocscupancy_issued":
|
||||
DateFormat("yyyy-MM-dd")
|
||||
.format(DateTime.parse(firstGenDesc.certOccupancyIssued!)),
|
||||
"bldgappr_generaldesc.date_completed": DateFormat("yyyy-MM-dd")
|
||||
.format(DateTime.parse(firstGenDesc.dateCompleted!)),
|
||||
"bldgappr_generaldesc.date_occupied": DateFormat("yyyy-MM-dd")
|
||||
.format(DateTime.parse(firstGenDesc.dateOccupied!)),
|
||||
"bldgappr_generaldesc.bldg_age": firstGenDesc.bldgAge,
|
||||
"bldgappr_generaldesc.no_storeys": firstGenDesc.noStoreys,
|
||||
"bldgappr_generaldesc.area_1stfloor": firstGenDesc.area1Stfloor,
|
||||
"bldgappr_generaldesc.area_2ndfloor": firstGenDesc.area2Ndfloor,
|
||||
"bldgappr_generaldesc.area_3rdfloor": firstGenDesc.area3Rdfloor,
|
||||
"bldgappr_generaldesc.area_4thfloor": firstGenDesc.area4Thfloor,
|
||||
"bldgappr_generaldesc.total_floor_area": firstGenDesc.totalFloorArea,
|
||||
"bldgappr_generaldesc.floor_sketch": null,
|
||||
"bldgappr_generaldesc.actual_use": firstGenDesc.actualUse,
|
||||
"bldgappr_generaldesc.unit_value": firstGenDesc.unitValue,
|
||||
"bldgappr_generaldesc.gen_code": "5TH",
|
||||
"bldgappr_struct_materials.date_created": "{{currentTimestamp}}",
|
||||
"bldgappr_struct_materials.date_modified": "{{currentTimestamp}}",
|
||||
"bldgappr_struct_materials.foundation": firstStructMat.foundation,
|
||||
"bldgappr_struct_materials.columns": firstStructMat.columns,
|
||||
"bldgappr_struct_materials.beams": firstStructMat.beams,
|
||||
"bldgappr_struct_materials.truss_framing":
|
||||
firstStructMat.trussFraming,
|
||||
"bldgappr_struct_materials.roof": firstStructMat.roof,
|
||||
"bldgappr_struct_materials.flooring": firstStructMat.flooring,
|
||||
"bldgappr_struct_materials.walls": firstStructMat.walls,
|
||||
"bldgappr_struct_materials.others": firstStructMat.others,
|
||||
"bldgappr_struct_materials.gen_code": "5TH",
|
||||
"bldgappr_property_assessment.date_created": "{{currentTimestamp}}",
|
||||
"bldgappr_property_assessment.date_modified": "{{currentTimestamp}}",
|
||||
"bldgappr_property_assessment.actual_use": firstAssess.actualUse,
|
||||
"bldgappr_property_assessment.market_value": firstAssess.marketValue,
|
||||
"bldgappr_property_assessment.assessment_level":
|
||||
firstAssess.assessmentLevel,
|
||||
"bldgappr_property_assessment.assessed_value":
|
||||
firstAssess.assessedValue,
|
||||
"bldgappr_property_assessment.taxable": firstAssess.taxable,
|
||||
"bldgappr_property_assessment.exempt": firstAssess.exempt,
|
||||
"bldgappr_property_assessment.qtr": firstAssess.qtr,
|
||||
"bldgappr_property_assessment.yr": firstAssess.yr,
|
||||
"bldgappr_property_assessment.appraisedby_name":
|
||||
firstAssess.appraisedbyName,
|
||||
"bldgappr_property_assessment.appraisedby_date":
|
||||
DateFormat("yyyy-MM-dd")
|
||||
.format(DateTime.parse(firstAssess.appraisedbyDate!)),
|
||||
"bldgappr_property_assessment.recommendappr_name":
|
||||
firstAssess.recommendapprName,
|
||||
"bldgappr_property_assessment.recommendappr_date":
|
||||
DateFormat("yyyy-MM-dd")
|
||||
.format(DateTime.parse(firstAssess.recommendapprDate!)),
|
||||
"bldgappr_property_assessment.approvedby_name":
|
||||
firstAssess.approvedbyName,
|
||||
"bldgappr_property_assessment.approvedby_date": null,
|
||||
"bldgappr_property_assessment.memoranda": firstAssess.memoranda,
|
||||
"bldgappr_property_assessment.swornstatement_no":
|
||||
firstAssess.swornstatementNo,
|
||||
"bldgappr_property_assessment.date_received": DateFormat("yyyy-MM-dd")
|
||||
.format(DateTime.parse(firstAssess.dateReceived!)),
|
||||
"bldgappr_property_assessment.entry_date_assessment": null,
|
||||
"bldgappr_property_assessment.entry_date_by": DateFormat("yyyy-MM-dd")
|
||||
.format(DateTime.parse(firstAssess.entryDateAssessment!)),
|
||||
"bldgappr_property_assessment.gen_code": "5TH",
|
||||
"bldgappr_rec_supersededass.date_created": "{{currentTimestamp}}",
|
||||
"bldgappr_rec_supersededass.date_modified": "{{currentTimestamp}}",
|
||||
"bldgappr_rec_supersededass.pin": null,
|
||||
"bldgappr_rec_supersededass.tdn": null,
|
||||
"bldgappr_rec_supersededass.total_assval": null,
|
||||
"bldgappr_rec_supersededass.owner": null,
|
||||
"bldgappr_rec_supersededass.effectivity_ass": null,
|
||||
"bldgappr_rec_supersededass.page_no": null,
|
||||
"bldgappr_rec_supersededass.total_marketval": null,
|
||||
"bldgappr_rec_supersededass.total_area": null,
|
||||
"bldgappr_rec_supersededass.rec_assessment": null,
|
||||
"bldgappr_rec_supersededass.rec_taxmapping": null,
|
||||
"bldgappr_rec_supersededass.rec_records": null,
|
||||
"bldgappr_rec_supersededass.date": null,
|
||||
"bldgappr_rec_supersededass.gen_code": "5TH"
|
||||
};
|
||||
|
||||
// print(details);
|
||||
|
||||
String xClientKey = "unitK3CQaXiWlPReDsBzmmwBZPd9Re1z";
|
||||
String xClientKeySecret = "unitcYqAN7GGalyz";
|
||||
Map<String, String> headers = {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'X-Client-Key': xClientKey,
|
||||
'X-Client-Secret': xClientKeySecret
|
||||
};
|
||||
|
||||
Response details_response = await post(
|
||||
Uri.parse(
|
||||
'http://${Url.instance.host()}/api/rptass_app/bldgappr_details/'),
|
||||
headers: headers,
|
||||
body: jsonEncode(details));
|
||||
|
||||
final datas = json.decode(details_response.body);
|
||||
for (AdditionalItems items in addItemsList) {
|
||||
final addItems = AdditionalItems(
|
||||
id: 1,
|
||||
bldgapprDetailsId: datas['data']['id'],
|
||||
classId: items.classId,
|
||||
className: items.className,
|
||||
structType: items.structType,
|
||||
unitValue: items.unitValue,
|
||||
baseUnitValue: items.baseUnitValue,
|
||||
area: items.area,
|
||||
marketValue: items.marketValue,
|
||||
depreciationRate: items.depreciationRate,
|
||||
adjustedMarketVal: items.adjustedMarketVal,
|
||||
amtDepreciation: items.amtDepreciation,
|
||||
painted: items.painted,
|
||||
secondhand: items.secondhand,
|
||||
paintedUnitval: items.paintedUnitval,
|
||||
secondhandUnitval: items.secondhandUnitval,
|
||||
actualUse: items.actualUse,
|
||||
genCode: "5TH");
|
||||
Response add_response = await post(
|
||||
Uri.parse(
|
||||
'http://${Url.instance.host()}/api/rptass_app/additional_items/'),
|
||||
headers: headers,
|
||||
body: jsonEncode(addItems));
|
||||
}
|
||||
for (BldgAndStructure structure in bldgStructureList) {
|
||||
final bldgStruc = BldgAndStructure(
|
||||
id: 1,
|
||||
bldgapprDetailsId: datas['data']['id'],
|
||||
bldgArea: structure.bldgArea,
|
||||
bldgType: structure.bldgType,
|
||||
structType: structure.structType,
|
||||
description: structure.description,
|
||||
actualUse: structure.actualUse,
|
||||
floorCount: structure.floorCount,
|
||||
unitValue: structure.unitValue,
|
||||
depRate: structure.depRate,
|
||||
marketValue: structure.marketValue,
|
||||
depAmount: structure.depAmount,
|
||||
adjustedMarketValue: structure.adjustedMarketValue,
|
||||
genCode: '5TH',
|
||||
buccPercentage: structure.buccPercentage);
|
||||
print(bldgStruc.toJson());
|
||||
Response response = await post(
|
||||
Uri.parse(
|
||||
'http://${Url.instance.host()}/api/rptass_app/bldgappr_structure/'),
|
||||
headers: headers,
|
||||
body: jsonEncode(bldgStruc));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
backgroundColor: Colors.black87,
|
||||
|
@ -85,7 +362,8 @@ class BuildingHomeOffline extends StatelessWidget {
|
|||
context,
|
||||
index,
|
||||
deleteItem,
|
||||
state.propertyInfos.length);
|
||||
state.propertyInfos.length,
|
||||
offlineProfile);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
@ -260,15 +538,17 @@ class BuildingHomeOffline extends StatelessWidget {
|
|||
color: primary,
|
||||
),
|
||||
label: 'Upload/Sync',
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
uploadBldg();
|
||||
},
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Card _listCard(
|
||||
PropertyInfo property_info, context, index, deleteItem, bldgLength) {
|
||||
Card _listCard(PropertyInfo property_info, context, index, deleteItem,
|
||||
bldgLength, offlineProfile) {
|
||||
return Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
|
@ -338,12 +618,17 @@ Card _listCard(
|
|||
..add(LoadAdditionalItemsEdit(
|
||||
items: const <AdditionalItems>[],
|
||||
id: property_info.id!))),
|
||||
BlocProvider(
|
||||
create: (context) => BuildingAndStructureBloc()
|
||||
..add(LoadBuildingAndStructureEdit(
|
||||
bldgAndStructure: const <BldgAndStructure>[],
|
||||
id: property_info.id!))),
|
||||
],
|
||||
child: EditBuildingOffline(
|
||||
index: index,
|
||||
faas: property_info,
|
||||
title: 'Bldg & Structure Edit',
|
||||
),
|
||||
index: index,
|
||||
faas: property_info,
|
||||
title: 'Bldg & Structure Edit',
|
||||
offlineProfile: offlineProfile),
|
||||
);
|
||||
}));
|
||||
},
|
||||
|
@ -373,7 +658,7 @@ Card _listCard(
|
|||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${property_info.owner}',
|
||||
'${property_info.fname} ${property_info.mname} ${property_info.lname}',
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
|
|
@ -6,7 +6,6 @@ import 'package:intl/intl.dart';
|
|||
import 'package:unit2/bloc/passo/land/land_appraisal/land_appraisal_bloc.dart';
|
||||
import 'package:unit2/model/passo/land_appr.dart';
|
||||
import 'package:unit2/screens/offline/passo/land/add/AddLandAppraisal.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land/AddLandAppraisal.dart';
|
||||
import 'package:unit2/utils/alerts.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
|
|
|
@ -4,7 +4,6 @@ import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
|||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:unit2/screens/offline/passo/land/add/AddOtherImprovementModal.dart';
|
||||
|
||||
import 'package:unit2/screens/passo/Land/add_land/AddOtherImprovementModal.dart';
|
||||
import 'package:unit2/utils/alerts.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
|
||||
|
|
|
@ -1,301 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/class_components/class_components_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_appraisal/property_appraisal_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/unit_construct/unit_construct_bloc.dart';
|
||||
import 'package:unit2/model/passo/bldg_loc.dart';
|
||||
import 'package:unit2/model/passo/class_components.dart';
|
||||
import 'package:unit2/model/passo/general_description.dart';
|
||||
import 'package:unit2/model/passo/land_ref.dart';
|
||||
import 'package:unit2/model/passo/property_appraisal.dart';
|
||||
import 'package:unit2/model/passo/property_info.dart';
|
||||
import 'package:unit2/model/passo/structural_materials_ii.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building_components/additional_items.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building_components/bldg_location_landref.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building_components/general_description.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building_components/property_appraisal.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building_components/property_assessment.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building_components/property_info.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building_components/structural_materials.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:im_stepper/stepper.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
|
||||
GlobalKey<FormBuilderState> formKey = GlobalKey<FormBuilderState>();
|
||||
|
||||
class AddBuilding extends StatefulWidget {
|
||||
Function triggerBlocEvent;
|
||||
AddBuilding(this.triggerBlocEvent);
|
||||
@override
|
||||
_AddBuilding createState() => _AddBuilding();
|
||||
}
|
||||
|
||||
class _AddBuilding extends State<AddBuilding> {
|
||||
int activeStep = 0; // Initial step set to 5.
|
||||
int upperBound = 6;
|
||||
|
||||
bool saveStep1 = false;
|
||||
bool saveStep2 = false;
|
||||
bool saveStep3 = false;
|
||||
bool saveStep4 = false;
|
||||
bool saveStep5 = false;
|
||||
bool saveStep6 = false;
|
||||
bool saveStep7 = false;
|
||||
int tempId = 0;
|
||||
|
||||
Future<void> _loadTempId() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
setState(() {
|
||||
tempId = (prefs.getInt('tempid') ?? 0);
|
||||
});
|
||||
}
|
||||
|
||||
void PrevBtn() {
|
||||
setState(() {
|
||||
activeStep--;
|
||||
});
|
||||
}
|
||||
|
||||
void NextBtn() {
|
||||
setState(() {
|
||||
activeStep++;
|
||||
});
|
||||
}
|
||||
|
||||
void onPutStructuralMaterials() {
|
||||
if (activeStep < upperBound) {
|
||||
setState(() {
|
||||
activeStep++;
|
||||
});
|
||||
}
|
||||
// var strucMaterials = StructureMaterialsII(
|
||||
// foundation: _foundations.getSelectedAsString().split(","),
|
||||
// columns: _coumns.getSelectedAsString().split(","),
|
||||
// beams: _beams.getSelectedAsString().split(","),
|
||||
// trussFraming:
|
||||
// _trussframing.getSelectedAsString().split(","),
|
||||
// roof: _roof.getSelectedAsString().split(","),
|
||||
// flooring: _flooring.getSelectedAsString().split(","),
|
||||
// walls: _walls.getSelectedAsString().split(","));
|
||||
}
|
||||
|
||||
void onPutPropertyAppraisal() {}
|
||||
void bldgPrevBtn() {
|
||||
if (activeStep > 0) {
|
||||
setState(() {
|
||||
activeStep--;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: primary,
|
||||
centerTitle: true,
|
||||
title: const Text("Building FAAS"),
|
||||
),
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<PropertyInfoBloc, PropertyInfoState>(listener: (
|
||||
context,
|
||||
state,
|
||||
) {
|
||||
if (state is PropertyInfoLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is PropertyInfoLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is PropertyInfoErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is ShowGenDescErrorAlertState ||
|
||||
state is ShowLandRefErrorAlertState ||
|
||||
state is ShowStrucMatErrorAlertState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
Fluttertoast.showToast(
|
||||
msg: "Slow internet connection, please try again!");
|
||||
}
|
||||
if (state is ShowLandRefSuccessAlertState ||
|
||||
state is ShowGenDescSuccessAlertState ||
|
||||
state is ShowStrucMatSuccessAlertState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
NextBtn();
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
if (state is PropertyInfoLoading ||
|
||||
state is PropertyInfoLoaded ||
|
||||
state is PropertyInfoErrorState ||
|
||||
state is ShowBldgLocErrorAlertState ||
|
||||
state is ShowGenDescErrorAlertState ||
|
||||
state is ShowLandRefErrorAlertState ||
|
||||
state is ShowStrucMatErrorAlertState ||
|
||||
state is ShowBldgLocSuccessAlertState ||
|
||||
state is ShowLandRefSuccessAlertState ||
|
||||
state is ShowGenDescSuccessAlertState ||
|
||||
state is ShowStrucMatSuccessAlertState) {
|
||||
return BlocConsumer<UnitConstructBloc, UnitConstructState>(
|
||||
listener: (
|
||||
context,
|
||||
state,
|
||||
) {
|
||||
if (state is UnitConstructLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is UnitConstructLoaded ||
|
||||
state is UnitConstructErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is UnitConstructLoaded) {
|
||||
final unit = state.unit;
|
||||
return BlocConsumer<ClassComponentsBloc,
|
||||
ClassComponentsState>(
|
||||
listener: (
|
||||
context,
|
||||
state,
|
||||
) {
|
||||
if (state is ClassComponentLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is ClassComponentLoaded ||
|
||||
state is ClassComponentErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is ClassComponentLoaded) {
|
||||
final classes = state.classes;
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
NumberStepper(
|
||||
numbers: [1, 2, 3, 4, 5, 6, 7],
|
||||
stepPadding: 5,
|
||||
activeStepColor: primary,
|
||||
numberStyle: TextStyle(color: Colors.white),
|
||||
lineColor: primary,
|
||||
// activeStep property set to activeStep variable defined above.
|
||||
activeStep: activeStep,
|
||||
activeStepBorderColor: Colors.white,
|
||||
activeStepBorderWidth: 1,
|
||||
// This ensures step-tapping updates the activeStep.
|
||||
onStepReached: (index) {
|
||||
setState(() {
|
||||
activeStep = index;
|
||||
});
|
||||
},
|
||||
enableStepTapping: false,
|
||||
),
|
||||
Expanded(
|
||||
child: StatefulBuilder(builder:
|
||||
(BuildContext context,
|
||||
StateSetter setState) {
|
||||
return FormBuilder(
|
||||
key: formKey,
|
||||
onChanged: () {
|
||||
formKey.currentState?.save();
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: Container(
|
||||
child: content(
|
||||
unit,
|
||||
classes,
|
||||
PrevBtn,
|
||||
NextBtn,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
if (state is ClassComponentErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<ClassComponentsBloc>()
|
||||
.add(LoadClassComponents());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is UnitConstructErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<UnitConstructBloc>()
|
||||
.add(LoadUnitConstruct());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
return Container();
|
||||
})),
|
||||
);
|
||||
}
|
||||
|
||||
Widget content(unit, List<ClassComponents> classes, PrevBtn, NextBtn) {
|
||||
switch (activeStep) {
|
||||
case 0:
|
||||
return PropertyInfoPage(NextBtn);
|
||||
|
||||
case 1:
|
||||
return BldgLocationLandrefPage(PrevBtn, NextBtn);
|
||||
|
||||
case 2:
|
||||
return GeneralDescriptionPage(unit, NextBtn, PrevBtn);
|
||||
|
||||
case 3:
|
||||
return StructuralMaterialsPage(PrevBtn, NextBtn);
|
||||
|
||||
case 4:
|
||||
return AdditionalItemPage(unit, classes, PrevBtn, NextBtn);
|
||||
|
||||
case 5:
|
||||
return PropertyAppraisalPage(NextBtn, PrevBtn);
|
||||
|
||||
case 6:
|
||||
return PropertyAssessmentPage(onSAveAll);
|
||||
|
||||
default:
|
||||
return Text("Property Info");
|
||||
}
|
||||
}
|
||||
|
||||
void onSAveAll() {
|
||||
Navigator.of(context).pop();
|
||||
widget.triggerBlocEvent();
|
||||
}
|
||||
}
|
|
@ -1,599 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:searchfield/searchfield.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/additional_item/additional_item_bloc.dart';
|
||||
import 'package:unit2/model/passo/additional_items.dart';
|
||||
import 'package:unit2/model/passo/class_components.dart';
|
||||
import 'package:unit2/model/passo/unit_construct.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
|
||||
class AddExtraItems extends StatefulWidget {
|
||||
final List<UnitConstruct> unit;
|
||||
final List<ClassComponents> options;
|
||||
|
||||
AddExtraItems(this.unit, this.options);
|
||||
|
||||
@override
|
||||
_AddExtraItems createState() => _AddExtraItems();
|
||||
}
|
||||
|
||||
class _AddExtraItems extends State<AddExtraItems> {
|
||||
GlobalKey<FormBuilderState> formKey = GlobalKey<FormBuilderState>();
|
||||
final focus = FocusNode();
|
||||
bool isPainted = false;
|
||||
bool isSecondHand = false;
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
double _unitBase = 0;
|
||||
int _areaValue = 0;
|
||||
final double _depValue = 0;
|
||||
double _unitValue = 0;
|
||||
String _className = "";
|
||||
int _classId = 0;
|
||||
String _structureType = "";
|
||||
bool _withoutBUCC = false;
|
||||
int _notPaintedUnitVal = 0;
|
||||
int _secondHandUnitVal = 0;
|
||||
|
||||
BoxDecoration box1() {
|
||||
return const BoxDecoration(boxShadow: [
|
||||
BoxShadow(color: Colors.black12, spreadRadius: 5, blurRadius: 5)
|
||||
], color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(3)));
|
||||
}
|
||||
|
||||
double _amountofDepreciation(unitVal, unitBase, area, depreciation) {
|
||||
return ((unitVal * unitBase) * area) * depreciation;
|
||||
}
|
||||
|
||||
double _totalMarketValue(unitVal, unitBase, area, depreciation, withBUCC,
|
||||
className, painted, secondHand, paintedUnitVal, secondhandUntVal) {
|
||||
if (withBUCC == false) {
|
||||
if (painted == true || secondHand == true) {
|
||||
final deductions = (paintedUnitVal + secondhandUntVal) / 100;
|
||||
|
||||
print(deductions);
|
||||
return (((unitVal - deductions) * unitBase) * area);
|
||||
} else {
|
||||
return ((unitVal * unitBase) * area);
|
||||
}
|
||||
} else {
|
||||
return (unitVal * area);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<AdditionalItemBloc, AdditionalItemState>(
|
||||
buildWhen: (previous, current) {
|
||||
return false;
|
||||
}, builder: (context, state) {
|
||||
if (state is ShowAddItemsScreen) {
|
||||
return FormBuilder(
|
||||
key: formKey,
|
||||
onChanged: () {
|
||||
formKey.currentState?.save();
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
height: 800,
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 10, right: 0, bottom: 0),
|
||||
child: FormBuilderDropdown(
|
||||
name: 'extra_item',
|
||||
autofocus: false,
|
||||
decoration:
|
||||
normalTextFieldStyle("Additional Item", ""),
|
||||
items: widget.options
|
||||
.map((e) => DropdownMenuItem(
|
||||
value: e,
|
||||
child: Text(e.componentName),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (value) {
|
||||
if (value!.minBaseUnitvalPercent != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.minBaseUnitvalPercent);
|
||||
_className = value.componentName;
|
||||
_classId = value.id;
|
||||
_withoutBUCC = value.withoutBucc;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.minBaseUnitvalPercent});
|
||||
}
|
||||
if (value.maxBaseUnitvalPercent != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.maxBaseUnitvalPercent);
|
||||
_className = value.componentName;
|
||||
_classId = value.id;
|
||||
_withoutBUCC = value.withoutBucc;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.maxBaseUnitvalPercent});
|
||||
}
|
||||
if (value.minUnitvalSqrmtr != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.minUnitvalSqrmtr);
|
||||
_className = value.componentName;
|
||||
_classId = value.id;
|
||||
_withoutBUCC = value.withoutBucc;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.minUnitvalSqrmtr});
|
||||
}
|
||||
if (value.maxUnitvalSqrmtr != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.maxUnitvalSqrmtr);
|
||||
_className = value.componentName;
|
||||
_classId = value.id;
|
||||
_withoutBUCC = value.withoutBucc;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.maxUnitvalSqrmtr});
|
||||
}
|
||||
if (value.minAddBaseunitval != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.minAddBaseunitval);
|
||||
_className = value.componentName;
|
||||
_classId = value.id;
|
||||
_withoutBUCC = value.withoutBucc;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.minAddBaseunitval});
|
||||
}
|
||||
if (value.maxAddBaseunitval != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.maxAddBaseunitval);
|
||||
_className = value.componentName;
|
||||
_classId = value.id;
|
||||
_withoutBUCC = value.withoutBucc;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.maxAddBaseunitval});
|
||||
}
|
||||
if (value.minDeductBaserate != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.minDeductBaserate);
|
||||
_className = value.componentName;
|
||||
_classId = value.id;
|
||||
_withoutBUCC = value.withoutBucc;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.minDeductBaserate});
|
||||
}
|
||||
if (value.maxDeductBaserate != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.maxDeductBaserate);
|
||||
_className = value.componentName;
|
||||
_classId = value.id;
|
||||
_withoutBUCC = value.withoutBucc;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.maxDeductBaserate});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 10, right: 0, bottom: 0),
|
||||
child: SizedBox(
|
||||
height: 45,
|
||||
child: SearchField(
|
||||
itemHeight: 70,
|
||||
suggestions: widget.unit
|
||||
.map((UnitConstruct unit) =>
|
||||
SearchFieldListItem(
|
||||
'${unit.bldgType} - ${unit.building}',
|
||||
item: unit,
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
'${unit.bldgType} - ${unit.building!.toUpperCase()}',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
)))
|
||||
.toList(),
|
||||
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
|
||||
searchInputDecoration: normalTextFieldStyle(
|
||||
"Structure Type", "")
|
||||
.copyWith(
|
||||
suffixIcon:
|
||||
const Icon(Icons.arrow_drop_down)),
|
||||
////agency suggestion tap
|
||||
focusNode: focus,
|
||||
suggestionState: Suggestion.expand,
|
||||
onSuggestionTap: (unit) {
|
||||
setState(() {
|
||||
_unitBase =
|
||||
double.parse(unit.item!.unitValue);
|
||||
_structureType =
|
||||
'${unit.item!.bldgType} - ${unit.item!.building}';
|
||||
});
|
||||
focus.unfocus();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
// const SizedBox(height: 10),
|
||||
// Container(
|
||||
// margin: const EdgeInsets.only(
|
||||
// left: 0, top: 10, right: 0, bottom: 0),
|
||||
// child: FormBuilderDropdown(
|
||||
// name: 'struc_type',
|
||||
// autofocus: false,
|
||||
// decoration:
|
||||
// normalTextFieldStyle("Structure Type", ""),
|
||||
// items: widget.unit
|
||||
// .map((e) => DropdownMenuItem(
|
||||
// value: e,
|
||||
// child:
|
||||
// Text(e.bldgType + " - " + e.building),
|
||||
// ))
|
||||
// .toList(),
|
||||
// onChanged: (val) {
|
||||
// setState(() {
|
||||
// _unitBase = double.parse(val!.unitValue);
|
||||
// _structureType = val.bldgType;
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
name: 'unitValue',
|
||||
decoration:
|
||||
normalTextFieldStyle("Unit Value", ""),
|
||||
validator: FormBuilderValidators.compose([]),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
name: 'areaValue',
|
||||
decoration: normalTextFieldStyle("Area", ""),
|
||||
validator: FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_areaValue = int.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// const SizedBox(height: 10),
|
||||
// FormBuilderTextField(
|
||||
// name: 'depRate',
|
||||
// decoration:
|
||||
// normalTextFieldStyle("Depreciation Rate", ""),
|
||||
// validator: FormBuilderValidators.compose([]),
|
||||
// onChanged: (value) {
|
||||
// setState(() {
|
||||
// _depValue = double.parse(value!);
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// const SizedBox(height: 10),
|
||||
// FormBuilderTextField(
|
||||
// name: 'marketValue',
|
||||
// decoration: normalTextFieldStyle(
|
||||
// NumberFormat.currency(
|
||||
// locale: 'en-PH', symbol: "₱")
|
||||
// .format(_totalMarketValue(_unitValue,
|
||||
// _unitBase, _areaValue, _depValue)),
|
||||
// ""),
|
||||
// validator: FormBuilderValidators.compose([]),
|
||||
// onChanged: (value) {
|
||||
// setState(() {
|
||||
// _marketValue = double.parse(value!);
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// const SizedBox(height: 10),
|
||||
// Text('Amount of Depreciation'),
|
||||
// const SizedBox(height: 5),
|
||||
// Container(
|
||||
// height: 45.0,
|
||||
// width: double.infinity,
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.white,
|
||||
// border: Border.all(
|
||||
// color: Colors.grey,
|
||||
// width: 1.0,
|
||||
// ),
|
||||
// borderRadius: BorderRadius.circular(5.0),
|
||||
// ),
|
||||
// child: Align(
|
||||
// alignment: Alignment.center,
|
||||
// child: Text(NumberFormat.currency(
|
||||
// locale: 'en-PH', symbol: "₱")
|
||||
// .format(_amountofDepreciation(_unitValue,
|
||||
// _unitBase, _areaValue, _depValue)))),
|
||||
// ),
|
||||
|
||||
Visibility(
|
||||
visible: !_withoutBUCC,
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
const Text('Building is not painted?'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: isPainted,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
isPainted = value!;
|
||||
if (value == false) {
|
||||
_notPaintedUnitVal = 0;
|
||||
} else {
|
||||
_notPaintedUnitVal = 10;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Container(
|
||||
height: 40.0,
|
||||
width: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(' - ' +
|
||||
_notPaintedUnitVal.toString() +
|
||||
'%')),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Uses second hand materials?'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: isSecondHand,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
isSecondHand = value!;
|
||||
if (isSecondHand == false) {
|
||||
_secondHandUnitVal = 0;
|
||||
formKey.currentState!.patchValue(
|
||||
{'secondHandMat': '0'});
|
||||
} else {
|
||||
_secondHandUnitVal = 5;
|
||||
formKey.currentState!.patchValue(
|
||||
{'secondHandMat': '5'});
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 40,
|
||||
width: 100,
|
||||
child: FormBuilderTextField(
|
||||
enabled: isSecondHand,
|
||||
name: 'secondHandMat',
|
||||
textAlign: TextAlign.center,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Unit Value", ""),
|
||||
validator:
|
||||
FormBuilderValidators.compose(
|
||||
[]),
|
||||
onChanged: (value) {
|
||||
// Check if the value is not null before parsing to double
|
||||
if (value != null &&
|
||||
value.isNotEmpty) {
|
||||
setState(() {
|
||||
_secondHandUnitVal =
|
||||
int.parse(value);
|
||||
});
|
||||
} else {
|
||||
// Handle the case when the value is empty or null
|
||||
// For example, set _secondHandUnitVal to a default value or show an error message.
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 40,
|
||||
width: 40,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'%',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 10),
|
||||
const Text('Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(_totalMarketValue(
|
||||
_unitValue,
|
||||
_unitBase,
|
||||
_areaValue,
|
||||
_depValue,
|
||||
_withoutBUCC,
|
||||
_className,
|
||||
isPainted,
|
||||
isSecondHand,
|
||||
_notPaintedUnitVal,
|
||||
_secondHandUnitVal)))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
try {
|
||||
final tempID =
|
||||
await SharedPreferences.getInstance();
|
||||
var itemss = AdditionalItems(
|
||||
id: 1,
|
||||
bldgapprDetailsId:
|
||||
tempID.getInt('tempid')! - 1,
|
||||
classId: _classId,
|
||||
className: _className,
|
||||
structType: _structureType,
|
||||
unitValue: _withoutBUCC == true
|
||||
? 0
|
||||
: _unitValue,
|
||||
baseUnitValue: _unitBase,
|
||||
area: _areaValue,
|
||||
marketValue: (_unitValue * _unitBase) *
|
||||
_areaValue,
|
||||
depreciationRate: _depValue,
|
||||
adjustedMarketVal: _totalMarketValue(
|
||||
_unitValue,
|
||||
_unitBase,
|
||||
_areaValue,
|
||||
_depValue,
|
||||
_withoutBUCC,
|
||||
_className,
|
||||
isPainted,
|
||||
isSecondHand,
|
||||
_notPaintedUnitVal,
|
||||
_secondHandUnitVal),
|
||||
actualUse: 'Test',
|
||||
amtDepreciation: _amountofDepreciation(
|
||||
_unitValue,
|
||||
_unitBase,
|
||||
_areaValue,
|
||||
_depValue,
|
||||
),
|
||||
painted: isPainted == true ? '1' : '0',
|
||||
secondhand:
|
||||
isSecondHand == true ? '1' : '0',
|
||||
paintedUnitval: '1',
|
||||
secondhandUnitval: '1');
|
||||
|
||||
context
|
||||
.read<AdditionalItemBloc>()
|
||||
.add(AddAdditionalItems(items: itemss));
|
||||
} catch (e) {
|
||||
Fluttertoast.showToast(
|
||||
msg:
|
||||
"Slow internet connection, please try again!",
|
||||
);
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Submit"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width:
|
||||
5), // Use SizedBox for horizontal spacing in a Row
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
.read<AdditionalItemBloc>()
|
||||
.add(const LoadAdditionalItems());
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Cancel"),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
if (state is AdditionalItemsErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<AdditionalItemBloc>().add(LoadAdditionalItems());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,292 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/additional_item/additional_item_bloc.dart';
|
||||
import 'package:unit2/model/passo/class_components.dart';
|
||||
import 'package:unit2/model/passo/unit_construct.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building_components/AddExtraItems.dart';
|
||||
import 'package:unit2/utils/alerts.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
|
||||
class AdditionalItemPage extends StatefulWidget {
|
||||
final List<UnitConstruct> unit;
|
||||
final List<ClassComponents> options;
|
||||
|
||||
final VoidCallback additionalItemsPrevBtn;
|
||||
final VoidCallback additionalItemsNextBtn;
|
||||
|
||||
const AdditionalItemPage(this.unit, this.options, this.additionalItemsPrevBtn,
|
||||
this.additionalItemsNextBtn);
|
||||
|
||||
@override
|
||||
_AdditionalItemPage createState() => _AdditionalItemPage();
|
||||
}
|
||||
|
||||
class _AdditionalItemPage extends State<AdditionalItemPage> {
|
||||
void deleteItem(int itemId) {
|
||||
context.read<AdditionalItemBloc>().add(DeleteAdditionalItems(id: itemId));
|
||||
}
|
||||
|
||||
double _totalMarketValue(items) {
|
||||
double total = 0;
|
||||
items.forEach((row) {
|
||||
total += double.parse(row.adjustedMarketVal);
|
||||
});
|
||||
return total;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<AdditionalItemBloc, AdditionalItemState>(
|
||||
listener: (context, state) {
|
||||
if (state is AdditionalItemsLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is AdditionalItemsLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is AdditionalItemsErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
final state = context.watch<AdditionalItemBloc>().state;
|
||||
if (state is AdditionalItemsLoaded) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('ADDITIONAL ITEMS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
onPressed: () {
|
||||
context
|
||||
.read<AdditionalItemBloc>()
|
||||
.add(ShowAdditionalItems());
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: const [
|
||||
Text('ADD ITEM'), // <-- Text
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Icon(
|
||||
// <-- Icon
|
||||
Icons.add,
|
||||
size: 24.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: DataTable(
|
||||
// ignore: prefer_const_literals_to_create_immutables
|
||||
columns: [
|
||||
const DataColumn(
|
||||
label: Text('Items'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Unit Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('% of BUCC'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Market Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Action'),
|
||||
)
|
||||
],
|
||||
rows: state.items.map((dataRow) {
|
||||
return DataRow(
|
||||
cells: [
|
||||
DataCell(Text(dataRow.className)),
|
||||
DataCell(Text(dataRow.baseUnitValue)),
|
||||
DataCell(Text(dataRow.unitValue)),
|
||||
DataCell(Text(((double.parse(
|
||||
dataRow.adjustedMarketVal)))
|
||||
.toString())),
|
||||
DataCell(Row(
|
||||
children: [
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.delete,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
deleteItem(dataRow.id);
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.edit,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0, right: 20.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
'Total',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 15),
|
||||
),
|
||||
Text(
|
||||
NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
||||
.format(_totalMarketValue(state.items)),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 15),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.additionalItemsPrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.additionalItemsNextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
if (state is AdditionalItemsDeletedState) {
|
||||
if (state.success) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
successAlert(context, "Deletion Successful",
|
||||
"Extra item has been deleted successfully", () {
|
||||
Navigator.of(context).pop();
|
||||
context
|
||||
.read<AdditionalItemBloc>()
|
||||
.add(const LoadAdditionalItems());
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
if (state is ShowAddItemsScreen) {
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxHeight: 1000.0),
|
||||
child: AlertDialog(
|
||||
insetPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 20.0,
|
||||
vertical: 10.0,
|
||||
),
|
||||
title: const Text(
|
||||
'ADD EXTRA ITEMS',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: AddExtraItems(widget.unit, widget.options))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (state is AdditionalItemsErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<AdditionalItemBloc>().add(LoadAdditionalItems());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,434 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/barangay/barangay_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||
|
||||
import 'package:unit2/bloc/passo/municipality/municipality_bloc.dart';
|
||||
import 'package:unit2/model/location/barangay.dart';
|
||||
import 'package:unit2/model/passo/bldg_loc.dart';
|
||||
|
||||
import 'package:unit2/model/passo/city.dart';
|
||||
import 'package:unit2/model/passo/land_ref.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/alerts.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
import '../../../../model/passo/barangay.dart';
|
||||
|
||||
class BldgLocationLandrefPage extends StatefulWidget {
|
||||
final VoidCallback PrevBtn;
|
||||
final VoidCallback NextBtn;
|
||||
BldgLocationLandrefPage(this.PrevBtn, this.NextBtn);
|
||||
|
||||
@override
|
||||
_BldgLocationLandrefPage createState() => _BldgLocationLandrefPage();
|
||||
}
|
||||
|
||||
class _BldgLocationLandrefPage extends State<BldgLocationLandrefPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<MunicipalityBloc, MunicipalityState>(
|
||||
listener: (context, state) {
|
||||
if (state is MunicipalityLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
|
||||
if (state is MunicipalityErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is MunicipalityLoaded) {
|
||||
List<City> cityList = state.municipality;
|
||||
|
||||
return BlocConsumer<BarangayBloc, BarangayState>(
|
||||
listener: (context, state) {
|
||||
if (state is BarangayLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
|
||||
if (state is BarangayLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is BarangayErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is BarangayLoaded) {
|
||||
List<Brgy> brgyList = state.brgy;
|
||||
List<String> brgyNAmes = brgyList
|
||||
.map((brgy) => brgy.barangayDescription)
|
||||
.toList()
|
||||
.cast<String>();
|
||||
return StatefulBuilder(builder: (context, locationState) {
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('BUILDING LOCATION',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(5.0),
|
||||
),
|
||||
child: const Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
"AGUSAN DEL NORTE",
|
||||
style: TextStyle(fontSize: 15),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderDropdown<City>(
|
||||
name: 'municipality',
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Municipality", ""),
|
||||
items: cityList
|
||||
.map((city) =>
|
||||
DropdownMenuItem<City>(
|
||||
value: city,
|
||||
child: Text(city
|
||||
.cityDescription!), // Use cityDescription instead of cityName
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (selectedCity) {
|
||||
if (selectedCity != null) {
|
||||
final selectedCityCode =
|
||||
selectedCity.cityCode;
|
||||
final barangayBloc =
|
||||
context.read<BarangayBloc>();
|
||||
barangayBloc.add(LoadBarangay(
|
||||
id: selectedCityCode!)); // Use selectedCityCode directly
|
||||
}
|
||||
},
|
||||
)),
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"No. / Street", "", 'street'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customDropDownField(
|
||||
"Brgy. / District",
|
||||
"",
|
||||
'brgy',
|
||||
brgyNAmes))
|
||||
]),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('LAND REFERENCE',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
customTextField("Land Owner", "", 'l_owner'),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField("OCT/TCT/CLOA No.",
|
||||
"", 'oct_tct_cloa'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Survey No.", "", 'survey_no'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Lot No.", "", 'lot_no'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Blk No.", "", 'blk_no'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"TD / ARP No.", "", 'l_td_arp'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child:
|
||||
customTextField("Area", "", 'area'))
|
||||
]),
|
||||
const SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.PrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
// Builder(builder: (context) {
|
||||
// return CustomButton(
|
||||
// icon: const Icon(
|
||||
// Icons.chevron_right_rounded,
|
||||
// color: Colors.white),
|
||||
// onPressed: () async {
|
||||
// {
|
||||
// try {
|
||||
// final progress =
|
||||
// ProgressHUD.of(context);
|
||||
// Future.delayed(Duration(seconds: 3),
|
||||
// () {
|
||||
// progress?.dismiss();
|
||||
// });
|
||||
// final tempID = await SharedPreferences
|
||||
// .getInstance();
|
||||
// var bldgLocData = BldgLoc(
|
||||
// id: tempID.getInt('tempid')! - 1,
|
||||
// street: formKey.currentState
|
||||
// ?.value['street'],
|
||||
// barangay: formKey
|
||||
// .currentState?.value['brgy'],
|
||||
// municipality: formKey
|
||||
// .currentState
|
||||
// ?.value['municipality']
|
||||
// .cityDescription,
|
||||
// province: "Agusan Del Norte");
|
||||
// var landRefData = LandRef(
|
||||
// id: tempID.getInt('tempid')! - 1,
|
||||
// owner: formKey
|
||||
// .currentState?.value['l_owner'],
|
||||
// cloaNo: formKey.currentState
|
||||
// ?.value['oct_tct_cloa'],
|
||||
// lotNo: formKey
|
||||
// .currentState?.value['lot_no'],
|
||||
// tdn: formKey.currentState
|
||||
// ?.value['l_td_arp'],
|
||||
// area: formKey
|
||||
// .currentState?.value['area'],
|
||||
// surveyNo: formKey.currentState
|
||||
// ?.value['survey_no'],
|
||||
// blkNo: formKey
|
||||
// .currentState?.value['blk_no'],
|
||||
// );
|
||||
// context.read<PropertyInfoBloc>()
|
||||
// ..add(UpdateBldgLoc(
|
||||
// bldg_loc: bldgLocData))
|
||||
// ..add(UpdateLandRef(
|
||||
// land_ref: landRefData));
|
||||
// } catch (e) {
|
||||
// Fluttertoast.showToast(
|
||||
// msg:
|
||||
// "Slow internet connection, please try again!");
|
||||
// }
|
||||
// }
|
||||
// ;
|
||||
// },
|
||||
// );
|
||||
// })
|
||||
Builder(builder: (context) {
|
||||
return CustomButton(
|
||||
icon: const Icon(
|
||||
Icons.chevron_right_rounded,
|
||||
color: Colors.white,
|
||||
),
|
||||
onPressed: () async {
|
||||
try {
|
||||
// Get the ProgressHUD instance
|
||||
final progress =
|
||||
ProgressHUD.of(context);
|
||||
|
||||
// Show the progress indicator
|
||||
progress?.show();
|
||||
|
||||
// Dismiss the progress indicator
|
||||
progress?.dismiss();
|
||||
|
||||
// Rest of your code...
|
||||
final tempID = await SharedPreferences
|
||||
.getInstance();
|
||||
var bldgLocData = BldgLoc(
|
||||
id: tempID.getInt('tempid')! - 1,
|
||||
street: formKey.currentState
|
||||
?.value['street'],
|
||||
barangay: formKey
|
||||
.currentState?.value['brgy'],
|
||||
municipality: formKey
|
||||
.currentState
|
||||
?.value['municipality']
|
||||
.cityDescription,
|
||||
province: "Agusan Del Norte");
|
||||
var landRefData = LandRef(
|
||||
id: tempID.getInt('tempid')! - 1,
|
||||
owner: formKey
|
||||
.currentState?.value['l_owner'],
|
||||
cloaNo: formKey.currentState
|
||||
?.value['oct_tct_cloa'],
|
||||
lotNo: formKey
|
||||
.currentState?.value['lot_no'],
|
||||
tdn: formKey.currentState
|
||||
?.value['l_td_arp'],
|
||||
area: formKey
|
||||
.currentState?.value['area'],
|
||||
surveyNo: formKey.currentState
|
||||
?.value['survey_no'],
|
||||
blkNo: formKey
|
||||
.currentState?.value['blk_no'],
|
||||
);
|
||||
context.read<PropertyInfoBloc>()
|
||||
..add(UpdateBldgLoc(
|
||||
bldg_loc: bldgLocData))
|
||||
..add(UpdateLandRef(
|
||||
land_ref: landRefData));
|
||||
} catch (e) {
|
||||
Fluttertoast.showToast(
|
||||
msg:
|
||||
"Slow internet connection, please try again!",
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
})
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
if (state is BarangayErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<BarangayBloc>().add(LoadBarangay(id: '1'));
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is MunicipalityErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<MunicipalityBloc>().add(LoadMunicipality());
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is ShowBldgLocErrorAlertState) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
errorAlert(
|
||||
context, "Something went wrong", "Please try again...", () {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
});
|
||||
}
|
||||
if (state is ShowLandRefErrorAlertState) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
errorAlert(
|
||||
context, "Something went wrong", "Please try again...", () {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
});
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<bool> _waitForAddPropertyInfoToComplete() async {
|
||||
// Wait for the state change indicating completion
|
||||
final propertyInfoState = context.read<PropertyInfoBloc>().state;
|
||||
|
||||
if (propertyInfoState is ShowBldgLocErrorAlertState ||
|
||||
propertyInfoState is ShowLandRefErrorAlertState) {
|
||||
// Check if the add operation was successful
|
||||
return false; // You'll need to define this in your state class
|
||||
}
|
||||
|
||||
// Return false if the state didn't change as expected
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,235 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||
import 'package:unit2/model/passo/general_description.dart';
|
||||
import 'package:unit2/model/passo/unit_construct.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
class GeneralDescriptionPage extends StatefulWidget {
|
||||
final List<UnitConstruct> unit;
|
||||
final VoidCallback onPutGeneralDescription;
|
||||
final VoidCallback gendescPrevBtn;
|
||||
|
||||
GeneralDescriptionPage(
|
||||
this.unit, this.onPutGeneralDescription, this.gendescPrevBtn);
|
||||
|
||||
@override
|
||||
_GeneralDescriptionPage createState() => _GeneralDescriptionPage();
|
||||
}
|
||||
|
||||
class _GeneralDescriptionPage extends State<GeneralDescriptionPage> {
|
||||
final actual_use = [
|
||||
"Residential",
|
||||
"Agricultural",
|
||||
"Commercial",
|
||||
"Industrial",
|
||||
"Mineral",
|
||||
"Timberland",
|
||||
];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin:
|
||||
const EdgeInsets.only(left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('GENERAL DESCRIPTION',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Container(
|
||||
margin:
|
||||
const EdgeInsets.only(left: 0, top: 10, right: 0, bottom: 0),
|
||||
child: FormBuilderDropdown(
|
||||
name: 'bldg_type',
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle("Kind of Building", ""),
|
||||
items: widget.unit
|
||||
.map((e) => DropdownMenuItem(
|
||||
value: e,
|
||||
child: Text('${e.bldgType}-${e.building}'),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
customDropDownField("Actual Use", "", 'actual_use', actual_use),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child:
|
||||
customTextField("Bldg. Permit No.", "", 'bldg_permit'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customDatTimePicker(
|
||||
"Certificate of Occupancy Issued ON",
|
||||
"",
|
||||
'date_issued'))
|
||||
]),
|
||||
customTextField(
|
||||
"Condominium Certificate of Title (CCT)", "", 'cct'),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customDatTimePicker(
|
||||
"Certificate of Completion Issued ON",
|
||||
"",
|
||||
'coc_issued'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customDatTimePicker(
|
||||
"Certificate of Occupancy Issued ON",
|
||||
"",
|
||||
'coo_issued'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customDatTimePicker(
|
||||
"Date Constructed /Completed", "", 'date_cnstructed'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customDatTimePicker(
|
||||
"Date Occupied", "", 'date_occupied'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField("Bldg. Age", "", 'bldg_age'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"No. of storeys", "", 'no_of_storeys'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Area of 1st Floor", "", 'area_of_1stFl'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Area of 2nd Floor", "", 'area_of_2ndFl'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Area of 3rd Floor", "", 'area_of_3rdFl')),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Area of 4th Floor", "", 'area_of_4thFl'))
|
||||
]),
|
||||
customTextField("Total Area", "", 'total_area'),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.gendescPrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () async {
|
||||
{
|
||||
try {
|
||||
final tempID = await SharedPreferences.getInstance();
|
||||
|
||||
var genDescData = GeneralDesc(
|
||||
id: tempID.getInt('tempid')! - 1,
|
||||
bldgKind: formKey
|
||||
.currentState?.value['bldg_type'].building,
|
||||
strucType: formKey
|
||||
.currentState?.value['bldg_type'].bldgType,
|
||||
bldgPermit:
|
||||
formKey.currentState?.value['bldg_permit'],
|
||||
dateIssued:
|
||||
formKey.currentState?.value['coc_issued'],
|
||||
cct: formKey.currentState?.value['cct'],
|
||||
certCompletionIssued:
|
||||
formKey.currentState?.value['coc_issued'],
|
||||
certOccupancyIssued:
|
||||
formKey.currentState?.value['coo_issued'],
|
||||
dateCompleted:
|
||||
formKey.currentState?.value['date_cnstructed'],
|
||||
dateOccupied:
|
||||
formKey.currentState?.value['date_occupied'],
|
||||
bldgAge: formKey.currentState?.value['bldg_age'],
|
||||
noStoreys:
|
||||
formKey.currentState?.value['no_of_storeys'],
|
||||
area1Stfloor: '0',
|
||||
area2Ndfloor: '0',
|
||||
area3Rdfloor: '0',
|
||||
area4Thfloor: '0',
|
||||
totalFloorArea:
|
||||
formKey.currentState?.value['total_area'],
|
||||
floorSketch: null,
|
||||
actualUse:
|
||||
formKey.currentState?.value['actual_use']);
|
||||
|
||||
context.read<PropertyInfoBloc>()
|
||||
..add(UpdateGeneralDesc(gen_desc: genDescData));
|
||||
} catch (e) {
|
||||
Fluttertoast.showToast(
|
||||
msg: "Slow internet connection, please try again!");
|
||||
}
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,631 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:searchfield/searchfield.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_appraisal/property_appraisal_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_assessment/property_assessment_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/memoranda/memoranda_bloc.dart';
|
||||
|
||||
import 'package:unit2/bloc/passo/signatories/signatories_bloc.dart';
|
||||
import 'package:unit2/model/passo/memoranda.dart';
|
||||
import 'package:unit2/model/passo/property_appraisal.dart';
|
||||
import 'package:unit2/model/passo/property_assessment.dart';
|
||||
import 'package:unit2/model/passo/signatories.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
class PropertyAssessmentPage extends StatefulWidget {
|
||||
Function function;
|
||||
|
||||
PropertyAssessmentPage(this.function);
|
||||
|
||||
@override
|
||||
_PropertyAssessmentPage createState() => _PropertyAssessmentPage();
|
||||
}
|
||||
|
||||
class _PropertyAssessmentPage extends State<PropertyAssessmentPage> {
|
||||
double assessment_level = 0;
|
||||
bool isTaxable = false;
|
||||
bool isExempt = false;
|
||||
String _memoranda = '';
|
||||
final focus = FocusNode();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: true,
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<SignatoriesBloc, SignatoriesState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is SignatoriesLoaded) {
|
||||
final signatories = state.signatories;
|
||||
return BlocConsumer<MemorandaBloc, MemorandaState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is MemorandaLoaded) {
|
||||
final memoranda = state.memorada;
|
||||
return ListView(
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: Container(
|
||||
margin: const EdgeInsets.fromLTRB(0, 20, 0, 20),
|
||||
child: const Text(
|
||||
'PROPERTY ASSESSMENT cont..',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: SingleChildScrollView(
|
||||
padding:
|
||||
EdgeInsets.only(left: 20.0, right: 20.0),
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Text('Taxable'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: isTaxable,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
isTaxable = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Exempt'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: isExempt,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
isExempt = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
const Text(
|
||||
'EFFECTIVITY OF ASSESSMENT / REASSESSMENT :',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
const Text('Qtr.'),
|
||||
SizedBox(
|
||||
width: 70,
|
||||
height: 25,
|
||||
child: FormBuilderTextField(
|
||||
name: 'qtr',
|
||||
validator:
|
||||
FormBuilderValidators.compose(
|
||||
[]),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
const Text('Yr.'),
|
||||
SizedBox(
|
||||
width: 70,
|
||||
height: 25,
|
||||
child: FormBuilderTextField(
|
||||
name: 'yr',
|
||||
validator:
|
||||
FormBuilderValidators.compose(
|
||||
[]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'APPRAISED/ASSESSED BY:',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold),
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: FormBuilderDropdown<
|
||||
Signatories>(
|
||||
name: 'appraised_by',
|
||||
autofocus: false,
|
||||
items: signatories
|
||||
.map((signatories) =>
|
||||
DropdownMenuItem(
|
||||
value: signatories,
|
||||
child: Text(
|
||||
'${signatories.firstname} ${signatories.middlename} ${signatories.lastname}'),
|
||||
))
|
||||
.toList()),
|
||||
),
|
||||
Text('Name'),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 15,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: FormBuilderDateTimePicker(
|
||||
name: 'app_date',
|
||||
initialEntryMode:
|
||||
DatePickerEntryMode
|
||||
.calendarOnly,
|
||||
initialValue: DateTime.now(),
|
||||
inputType: InputType.date,
|
||||
|
||||
initialTime: const TimeOfDay(
|
||||
hour: 8, minute: 0),
|
||||
// locale: const Locale.fromSubtags(languageCode: 'fr'),
|
||||
),
|
||||
),
|
||||
Text('Date'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
const Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'RECOMMENDING APPROVAL:',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold),
|
||||
)),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: FormBuilderDropdown<
|
||||
Signatories>(
|
||||
name: 'rec_approval',
|
||||
autofocus: false,
|
||||
items: signatories
|
||||
.map((signatories) =>
|
||||
DropdownMenuItem(
|
||||
value: signatories,
|
||||
child: Text(
|
||||
'${signatories.firstname} ${signatories.middlename} ${signatories.lastname}'),
|
||||
))
|
||||
.toList()),
|
||||
),
|
||||
Text('Name'),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 15,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: FormBuilderDateTimePicker(
|
||||
name: 'rec_date',
|
||||
initialEntryMode:
|
||||
DatePickerEntryMode
|
||||
.calendarOnly,
|
||||
initialValue: DateTime.now(),
|
||||
inputType: InputType.date,
|
||||
|
||||
initialTime: const TimeOfDay(
|
||||
hour: 8, minute: 0),
|
||||
// locale: const Locale.fromSubtags(languageCode: 'fr'),
|
||||
),
|
||||
),
|
||||
Text('Date'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
const Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'APPROVED BY:',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: FormBuilderDropdown<
|
||||
Signatories>(
|
||||
name: 'apprvd_by',
|
||||
autofocus: false,
|
||||
items: signatories
|
||||
.map((signatories) =>
|
||||
DropdownMenuItem(
|
||||
value: signatories,
|
||||
child: Text(
|
||||
'${signatories.firstname} ${signatories.middlename} ${signatories.lastname}'),
|
||||
))
|
||||
.toList()),
|
||||
),
|
||||
Text('Name'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
const Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'MEMORANDA: ',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 100,
|
||||
child: SearchField(
|
||||
itemHeight: 70,
|
||||
suggestions: memoranda
|
||||
.map((Memoranda memoranda) =>
|
||||
SearchFieldListItem(
|
||||
'${memoranda.memoranda}',
|
||||
item:
|
||||
memoranda, // Change: Use individual Memoranda object
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
'${memoranda.memoranda}',
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
// searchInputDecoration:
|
||||
// normalTextFieldStyle(
|
||||
// "Memoranda", "")
|
||||
// .copyWith(
|
||||
// suffixIcon: const Icon(
|
||||
// Icons.arrow_drop_down),
|
||||
// ),
|
||||
// focusNode: focus,
|
||||
suggestionState: Suggestion.expand,
|
||||
onSuggestionTap: (memoranda) {
|
||||
setState(() {
|
||||
_memoranda =
|
||||
memoranda.item!.memoranda!;
|
||||
});
|
||||
focus.unfocus();
|
||||
},
|
||||
)),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Sworn Statement No. :'),
|
||||
SizedBox(
|
||||
width: 150,
|
||||
height: 20,
|
||||
child: FormBuilderTextField(
|
||||
name: 'sworn_statement',
|
||||
decoration: InputDecoration(),
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Date Received:'),
|
||||
SizedBox(
|
||||
width: 150,
|
||||
height: 20,
|
||||
child: FormBuilderDateTimePicker(
|
||||
name: 'date_received',
|
||||
initialEntryMode:
|
||||
DatePickerEntryMode.calendarOnly,
|
||||
initialValue: DateTime.now(),
|
||||
inputType: InputType.date,
|
||||
|
||||
initialTime: const TimeOfDay(
|
||||
hour: 8, minute: 0),
|
||||
// locale: const Locale.fromSubtags(languageCode: 'fr'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
'Date of Entry in the Rec. of Ass. :'),
|
||||
SizedBox(
|
||||
width: 100,
|
||||
height: 20,
|
||||
child: FormBuilderDateTimePicker(
|
||||
name: 'date_of_entry',
|
||||
initialEntryMode:
|
||||
DatePickerEntryMode.calendarOnly,
|
||||
initialValue: DateTime.now(),
|
||||
inputType: InputType.date,
|
||||
|
||||
initialTime: const TimeOfDay(
|
||||
hour: 8, minute: 0),
|
||||
// locale: const Locale.fromSubtags(languageCode: 'fr'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('By:'),
|
||||
SizedBox(
|
||||
width: 150,
|
||||
height: 20,
|
||||
child: FormBuilderTextField(
|
||||
name: 'by',
|
||||
decoration: InputDecoration(),
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
final tempID =
|
||||
await SharedPreferences.getInstance();
|
||||
print(tempID.getInt('tempid')! - 1);
|
||||
final List<PropertyAssessment>
|
||||
propertyAssessments = [];
|
||||
|
||||
PropertyAssessment ass =
|
||||
PropertyAssessment(
|
||||
id: 1,
|
||||
bldgapprDetailsId:
|
||||
tempID.getInt('tempid')! - 1,
|
||||
actualUse: formKey.currentState!
|
||||
.value['actual_use'] ??
|
||||
'', // Replace null with an empty string
|
||||
marketValue: '0.00',
|
||||
assessmentLevel: '0.00',
|
||||
assessedValue: '0.00',
|
||||
taxable: isTaxable == true ? '1' : '0',
|
||||
exempt: isExempt == true ? '1' : '0',
|
||||
qtr: formKey.currentState!.value[
|
||||
'qtr'], // Replace null with '0'
|
||||
yr: formKey.currentState!.value[
|
||||
'yr'], // Replace null with '0'
|
||||
appraisedbyName: (formKey
|
||||
.currentState!
|
||||
.value['appraised_by']
|
||||
?.firstname ??
|
||||
'') +
|
||||
' ' +
|
||||
(formKey
|
||||
.currentState!
|
||||
.value['appraised_by']
|
||||
?.middlename ??
|
||||
'') +
|
||||
' ' +
|
||||
(formKey
|
||||
.currentState!
|
||||
.value['appraised_by']
|
||||
?.lastname ??
|
||||
''),
|
||||
appraisedbyDate: formKey
|
||||
.currentState!.value['app_date'],
|
||||
// Replace null with current date
|
||||
recommendapprName: (formKey
|
||||
.currentState!
|
||||
.value['rec_approval']
|
||||
?.firstname ??
|
||||
'') +
|
||||
' ' +
|
||||
(formKey
|
||||
.currentState!
|
||||
.value['rec_approval']
|
||||
?.middlename ??
|
||||
'') +
|
||||
' ' +
|
||||
(formKey
|
||||
.currentState!
|
||||
.value['rec_approval']
|
||||
?.lastname ??
|
||||
''),
|
||||
recommendapprDate: formKey
|
||||
.currentState!.value['rec_date'],
|
||||
// Replace null with current date
|
||||
approvedbyName: (formKey
|
||||
.currentState!
|
||||
.value['apprvd_by']
|
||||
?.firstname ??
|
||||
'') +
|
||||
' ' +
|
||||
(formKey
|
||||
.currentState!
|
||||
.value['apprvd_by']
|
||||
?.middlename ??
|
||||
'') +
|
||||
' ' +
|
||||
(formKey
|
||||
.currentState!
|
||||
.value['apprvd_by']
|
||||
?.lastname ??
|
||||
''),
|
||||
memoranda: _memoranda,
|
||||
swornstatementNo: formKey.currentState!
|
||||
.value['sworn_statement'] ??
|
||||
'', // Replace null with an empty string
|
||||
dateReceived: formKey.currentState!
|
||||
.value['date_received'],
|
||||
// Replace null with current date
|
||||
entryDateAssessment: formKey
|
||||
.currentState!
|
||||
.value['date_of_entry'],
|
||||
// Replace null with current date
|
||||
entryDateBy: formKey
|
||||
.currentState!.value['by'] ??
|
||||
'', // Replace null with an empty string
|
||||
);
|
||||
|
||||
propertyAssessments.add(ass);
|
||||
|
||||
context
|
||||
.read<PropertyAssessmentBloc>()
|
||||
.add(UpdatePropertyAssessment(
|
||||
assessment:
|
||||
propertyAssessments[0]));
|
||||
widget.function();
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: primary,
|
||||
foregroundColor: Colors.red),
|
||||
child: const SizedBox(
|
||||
width: 200,
|
||||
height: 50,
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'Save',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
]),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
if (state is MemorandaErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<MemorandaBloc>().add(LoadMemoranda());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is SignatoriesErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<SignatoriesBloc>().add(LoadSignatories());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
)));
|
||||
}
|
||||
}
|
|
@ -1,165 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||
import 'package:unit2/model/passo/property_info.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
GlobalKey<FormBuilderState> ownerKey = GlobalKey<FormBuilderState>();
|
||||
|
||||
class PropertyInfoPage extends StatefulWidget {
|
||||
final VoidCallback handleButtonPress;
|
||||
const PropertyInfoPage(this.handleButtonPress, {super.key});
|
||||
|
||||
@override
|
||||
_PropertyInfoPage createState() => _PropertyInfoPage();
|
||||
}
|
||||
|
||||
class _PropertyInfoPage extends State<PropertyInfoPage> {
|
||||
int tempId = 0;
|
||||
final transaction_codes = ['New', 'Revision'];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('PROPERTY OWNER INFO',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
customDropDownField("Transaction Code", "", "transaction_code",
|
||||
transaction_codes),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("ARP No. / TD No.", "", 'arp_td')),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("Pin", "", 'pin')),
|
||||
],
|
||||
),
|
||||
customTextField("Owner", "", 'owner'),
|
||||
customTextField("Address", "", 'address'),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField("Tel No.", "", 'tel_no'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("TIN", "", 'tin'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Administrator / Benificial User", "", 'benificiary'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("TIN", "", 'benificiary_tin'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child:
|
||||
customTextField("Address", "", 'benificiary_address'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child:
|
||||
customTextField("Tel No.", "", 'benificiary_telno'))
|
||||
]),
|
||||
const SizedBox(height: 25),
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right, color: Colors.white),
|
||||
onPressed: () async {
|
||||
try {
|
||||
var property_info = PropertyInfo(
|
||||
id: 1,
|
||||
transCode: formKey.currentState!.value['transaction_code']
|
||||
.toString(),
|
||||
tdn: formKey.currentState!.value['arp_td'],
|
||||
pin: formKey.currentState!.value['pin'],
|
||||
owner: formKey.currentState!.value['owner'],
|
||||
address: formKey.currentState!.value['address'],
|
||||
telno: formKey.currentState!.value['tel_no'],
|
||||
tin: formKey.currentState!.value['tin'],
|
||||
adminUser: formKey.currentState!.value['benificiary'],
|
||||
adminAddress:
|
||||
formKey.currentState!.value['benificiary_address'],
|
||||
adminTin: formKey.currentState!.value['benificiary_tin'],
|
||||
adminTelno:
|
||||
formKey.currentState!.value['benificiary_telno'],
|
||||
faasType: "BUILDING",
|
||||
);
|
||||
|
||||
// Dispatch the event to add the property_info
|
||||
context.read<PropertyInfoBloc>().add(
|
||||
AddPropertyInfo(property_info: property_info),
|
||||
);
|
||||
widget.handleButtonPress();
|
||||
} catch (e) {
|
||||
Fluttertoast.showToast(
|
||||
msg: "Slow internet connection, please try again!");
|
||||
}
|
||||
|
||||
// Wait for the event to complete and get the result
|
||||
// bool failed = await _waitForAddPropertyInfoToComplete();
|
||||
|
||||
// if (failed) {
|
||||
// // Proceed to the next step or perform an action
|
||||
// Fluttertoast.showToast(
|
||||
// msg: "Slow internet connection, please try again!");
|
||||
// } else {
|
||||
// // Stay or show an error message
|
||||
// widget.handleButtonPress();
|
||||
// }
|
||||
},
|
||||
)
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<bool> _waitForAddPropertyInfoToComplete() async {
|
||||
// Wait for the state change indicating completion
|
||||
final propertyInfoState = context.read<PropertyInfoBloc>().state;
|
||||
|
||||
if (propertyInfoState is PropertyInfoErrorState) {
|
||||
// Check if the add operation was unsuccessful
|
||||
return true; // You'll need to define this in your state class
|
||||
}
|
||||
|
||||
// Return false if the state didn't change as expected
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,431 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:multiselect/multiselect.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||
import 'package:unit2/model/passo/structural_materials_ii.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
class MaterialOption {
|
||||
final String id;
|
||||
final String label;
|
||||
|
||||
MaterialOption(this.id, this.label);
|
||||
}
|
||||
|
||||
class StructuralMaterialsPage extends StatefulWidget {
|
||||
final VoidCallback NextBtn;
|
||||
final VoidCallback PrevBtn;
|
||||
|
||||
StructuralMaterialsPage(this.NextBtn, this.PrevBtn);
|
||||
|
||||
@override
|
||||
_StructuralMaterialsPage createState() => _StructuralMaterialsPage();
|
||||
}
|
||||
|
||||
class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||
List<String> foundation = [];
|
||||
List<String> column = [];
|
||||
List<String> beam = [];
|
||||
List<String> truss_framing = [];
|
||||
List<String> roof = [];
|
||||
List<String> flooring = [];
|
||||
List<String> walls = [];
|
||||
bool foundationOthers = false;
|
||||
bool columOthers = false;
|
||||
bool beamsOthers = false;
|
||||
bool tfOthers = false;
|
||||
bool roofOthers = false;
|
||||
bool flooringOthers = false;
|
||||
bool wpOthers = false;
|
||||
|
||||
List<MaterialOption> columnOptions = [
|
||||
MaterialOption('steel', 'Steel'),
|
||||
MaterialOption('concrete', 'Reinforced Concrete'),
|
||||
MaterialOption('wood', 'Wood'),
|
||||
];
|
||||
|
||||
List<String> selectedColumnValues = [];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return StatefulBuilder(builder: (context, structuralState) {
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(30.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin:
|
||||
const EdgeInsets.only(left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('STRUCTURAL MATERIALS',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||
Text(
|
||||
'FOUNDATION',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: foundationOthers,
|
||||
onChanged: (bool? value) {
|
||||
structuralState(() {
|
||||
foundationOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: foundationOthers,
|
||||
child: customTextField(
|
||||
"Enter other foundation", "", "other_foundation"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
structuralState(() {
|
||||
foundation = x;
|
||||
});
|
||||
},
|
||||
options: const ['Reinforced Concrete', 'Plain Concrete'],
|
||||
selectedValues: foundation,
|
||||
whenEmpty: 'Select Foundations',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||
Text(
|
||||
'COLUMNS',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: columOthers,
|
||||
onChanged: (bool? value) {
|
||||
structuralState(() {
|
||||
columOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: columOthers,
|
||||
child:
|
||||
customTextField("Enter other columns", "", "other_column"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
structuralState(() {
|
||||
column = x;
|
||||
});
|
||||
},
|
||||
options: const ['Steel', 'Reinforced Concrete', 'Wood'],
|
||||
selectedValues: column,
|
||||
whenEmpty: 'Select Column/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||
Text(
|
||||
'BEAMS',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: beamsOthers,
|
||||
onChanged: (bool? value) {
|
||||
structuralState(() {
|
||||
beamsOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: beamsOthers,
|
||||
child: customTextField("Enter other beam/s", "", "other_beam"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
structuralState(() {
|
||||
beam = x;
|
||||
});
|
||||
},
|
||||
options: const ['Steel', 'Reinforced Concrete', 'Wood'],
|
||||
selectedValues: beam,
|
||||
whenEmpty: 'Select Beam/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||
Text(
|
||||
'TRUSS FRAMING',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: tfOthers,
|
||||
onChanged: (bool? value) {
|
||||
structuralState(() {
|
||||
tfOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: tfOthers,
|
||||
child: customTextField(
|
||||
"Enter other truss framing/s", "", "other_tf"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
structuralState(() {
|
||||
truss_framing = x;
|
||||
});
|
||||
},
|
||||
options: const ['Steel', 'Wood'],
|
||||
selectedValues: truss_framing,
|
||||
whenEmpty: 'Select Truss Framing/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||
Text(
|
||||
'ROOF',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: roofOthers,
|
||||
onChanged: (bool? value) {
|
||||
structuralState(() {
|
||||
roofOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: roofOthers,
|
||||
child: customTextField("Enter other roof/s", "", "other_roof"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
structuralState(() {
|
||||
roof = x;
|
||||
});
|
||||
},
|
||||
options: const [
|
||||
'Reinforced Concrete',
|
||||
'Tiles',
|
||||
'G.I Sheet',
|
||||
'Aluminum',
|
||||
'Asbestos',
|
||||
'Long Span',
|
||||
'Concrete Desk',
|
||||
'Nipa/Anahaw/Cogon'
|
||||
],
|
||||
selectedValues: roof,
|
||||
whenEmpty: 'Select Roof/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||
Text(
|
||||
'FLOORING',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: flooringOthers,
|
||||
onChanged: (bool? value) {
|
||||
structuralState(() {
|
||||
flooringOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: flooringOthers,
|
||||
child: customTextField(
|
||||
"Enter other flooring/s", "", "other_flooring"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
structuralState(() {
|
||||
flooring = x;
|
||||
});
|
||||
},
|
||||
options: const [
|
||||
'Reinforced Concrete',
|
||||
'Plain Cement',
|
||||
'Marble',
|
||||
'Wood',
|
||||
'Tiles'
|
||||
],
|
||||
selectedValues: flooring,
|
||||
whenEmpty: 'Select Flooring/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||
Text(
|
||||
'WALLS & PARTITIONS',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: wpOthers,
|
||||
onChanged: (bool? value) {
|
||||
structuralState(() {
|
||||
wpOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: wpOthers,
|
||||
child: customTextField(
|
||||
"Enter other walls & partition/s", "", "other_wp"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
walls = x;
|
||||
});
|
||||
},
|
||||
options: const [
|
||||
'Reinforced Concrete',
|
||||
'Plain Concrete',
|
||||
'Wood',
|
||||
'CHIB',
|
||||
'G.I Sheet',
|
||||
'Build-a-wall',
|
||||
'Sawali',
|
||||
'Bamboo'
|
||||
],
|
||||
selectedValues: walls,
|
||||
whenEmpty: 'Select Walls & Partition/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.PrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () async {
|
||||
{
|
||||
try {
|
||||
final tempID = await SharedPreferences.getInstance();
|
||||
var strucMaterials = StructureMaterialsII(
|
||||
id: tempID.getInt('tempid')! - 1,
|
||||
foundation: foundationOthers
|
||||
? formKey
|
||||
.currentState!.value['other_foundation']
|
||||
.split(',')
|
||||
: foundation,
|
||||
columns: columOthers
|
||||
? formKey.currentState!.value['other_column']
|
||||
.split(',')
|
||||
: column,
|
||||
beams: beamsOthers
|
||||
? formKey.currentState!.value['other_beam']
|
||||
.split(',')
|
||||
: beam,
|
||||
trussFraming: tfOthers
|
||||
? formKey.currentState!.value['other_tf']
|
||||
.split(',')
|
||||
: truss_framing,
|
||||
roof: roofOthers
|
||||
? formKey.currentState!.value['other_roof']
|
||||
.split(',')
|
||||
: roof,
|
||||
flooring: flooringOthers
|
||||
? formKey.currentState!.value['other_flooring']
|
||||
.split(',')
|
||||
: flooring,
|
||||
walls: wpOthers
|
||||
? formKey.currentState!.value['other_wp']
|
||||
.split(',')
|
||||
: walls,
|
||||
others: ["Others"]);
|
||||
context.read<PropertyInfoBloc>()
|
||||
..add(UpdateStrucMaterials(data: strucMaterials));
|
||||
} catch (e) {
|
||||
Fluttertoast.showToast(
|
||||
msg: "Slow internet connection, please try again!");
|
||||
}
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,211 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
|
||||
import 'package:im_stepper/stepper.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/class_components/class_components_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/unit_construct/unit_construct_bloc.dart';
|
||||
import 'package:unit2/model/passo/class_components.dart';
|
||||
import 'package:unit2/model/passo/property_info.dart';
|
||||
import 'package:unit2/model/passo/unit_construct.dart';
|
||||
import 'package:unit2/screens/passo/Building/edit_building/additional_items.dart';
|
||||
import 'package:unit2/screens/passo/Building/edit_building/bldgloc_landref.dart';
|
||||
import 'package:unit2/screens/passo/Building/edit_building/general_description.dart';
|
||||
import 'package:unit2/screens/passo/Building/edit_building/property_appraisal.dart';
|
||||
import 'package:unit2/screens/passo/Building/edit_building/property_assessement_edit.dart';
|
||||
import 'package:unit2/screens/passo/Building/edit_building/property_owner_info.dart';
|
||||
import 'package:unit2/screens/passo/Building/edit_building/structural_materials.dart';
|
||||
import 'package:unit2/screens/passo/Building/edit_building/structural_materials_edit.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
|
||||
class EditBuilding extends StatefulWidget {
|
||||
final int index;
|
||||
final PropertyInfo faas;
|
||||
final String title;
|
||||
|
||||
const EditBuilding(
|
||||
{super.key,
|
||||
required this.title,
|
||||
required this.index,
|
||||
required this.faas});
|
||||
@override
|
||||
_EditBuilding createState() => _EditBuilding();
|
||||
}
|
||||
|
||||
class _EditBuilding extends State<EditBuilding> {
|
||||
// THE FOLLOWING TWO VARIABLES ARE REQUIRED TO CONTROL THE STEPPER.
|
||||
int activeStep = 0; // Initial step set to 5.
|
||||
|
||||
int upperBound = 6; // upperBound MUST BE total number of icons minus 1.
|
||||
|
||||
void PrevBtn() {
|
||||
setState(() {
|
||||
activeStep--;
|
||||
});
|
||||
}
|
||||
|
||||
void NextBtn() {
|
||||
setState(() {
|
||||
activeStep++;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
backgroundColor: primary,
|
||||
title: Text('Building FAAS Edit'),
|
||||
),
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<UnitConstructBloc, UnitConstructState>(
|
||||
listener: (context, state) {
|
||||
if (state is UnitConstructLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is UnitConstructLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is UnitConstructErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
// Fluttertoast.showToast(
|
||||
// msg: onError,
|
||||
// fontSize: 24,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.CENTER,
|
||||
// backgroundColor: Colors.black,
|
||||
// textColor: Colors.white);
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is UnitConstructLoaded) {
|
||||
final unit = state.unit;
|
||||
return BlocConsumer<ClassComponentsBloc, ClassComponentsState>(
|
||||
listener: (context, state) {
|
||||
if (state is ClassComponentLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is ClassComponentLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is ClassComponentErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
// Fluttertoast.showToast(
|
||||
// msg: onError,
|
||||
// fontSize: 24,
|
||||
// toastLength: Toast.LENGTH_LONG,
|
||||
// gravity: ToastGravity.CENTER,
|
||||
// backgroundColor: Colors.black,
|
||||
// textColor: Colors.white);
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is ClassComponentLoaded) {
|
||||
return Column(
|
||||
children: [
|
||||
NumberStepper(
|
||||
numbers: [1, 2, 3, 4, 5, 6, 7],
|
||||
activeStepColor: primary,
|
||||
numberStyle: TextStyle(color: Colors.white),
|
||||
lineColor: primary,
|
||||
// activeStep property set to activeStep variable defined above.
|
||||
activeStep: activeStep,
|
||||
activeStepBorderColor: Colors.white,
|
||||
activeStepBorderWidth: 1,
|
||||
// This ensures step-tapping updates the activeStep.
|
||||
onStepReached: (index) {
|
||||
setState(() {
|
||||
activeStep = index;
|
||||
});
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: StatefulBuilder(builder:
|
||||
(BuildContext context, StateSetter setState) {
|
||||
return Container(
|
||||
child: content(
|
||||
unit,
|
||||
state.classes,
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
if (state is ClassComponentErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<ClassComponentsBloc>()
|
||||
.add(LoadClassComponents());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is UnitConstructErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<UnitConstructBloc>().add(LoadUnitConstruct());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Returns the header text based on the activeStep.
|
||||
Widget content(List<UnitConstruct> unit, classes) {
|
||||
switch (activeStep) {
|
||||
case 0:
|
||||
return PropertyOwnerInfoEdit(
|
||||
widget.index, widget.faas, widget.title, NextBtn, PrevBtn);
|
||||
|
||||
case 1:
|
||||
return BldgLocLandRefEdit(widget.faas.id!, NextBtn, PrevBtn);
|
||||
|
||||
case 2:
|
||||
return GeneralDescriptionEdit(unit, widget.faas.id!, NextBtn, PrevBtn);
|
||||
|
||||
case 3:
|
||||
return StructuralMaterialsEditPage(widget.faas.id!, NextBtn, PrevBtn);
|
||||
|
||||
case 4:
|
||||
return AdditionalItemEditPage(
|
||||
unit, classes, widget.faas.id!, NextBtn, PrevBtn);
|
||||
|
||||
case 5:
|
||||
return PropertyAppraisalEditPage(widget.faas.id!, NextBtn, PrevBtn);
|
||||
|
||||
case 6:
|
||||
return PropertyAssessmentEditPage(widget.faas.id!);
|
||||
|
||||
default:
|
||||
return PropertyOwnerInfoEdit(
|
||||
widget.index, widget.faas, widget.title, NextBtn, PrevBtn);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,609 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:searchfield/searchfield.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/additional_item/additional_item_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/additional_items_edit/additional_items_edit_bloc.dart';
|
||||
import 'package:unit2/model/passo/additional_items.dart';
|
||||
import 'package:unit2/model/passo/class_components%20_offline.dart';
|
||||
import 'package:unit2/model/passo/class_components.dart';
|
||||
import 'package:unit2/model/passo/unit_construct.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
|
||||
class AddExtraItemsEdit extends StatefulWidget {
|
||||
final List<UnitConstruct> unit;
|
||||
final List<ClassComponentsOffline> options;
|
||||
final int tempId;
|
||||
|
||||
AddExtraItemsEdit(this.unit, this.options, this.tempId);
|
||||
|
||||
@override
|
||||
_AddExtraItemsEdit createState() => _AddExtraItemsEdit();
|
||||
}
|
||||
|
||||
class _AddExtraItemsEdit extends State<AddExtraItemsEdit> {
|
||||
GlobalKey<FormBuilderState> formKey = GlobalKey<FormBuilderState>();
|
||||
final focus = FocusNode();
|
||||
double _computedValue = 0;
|
||||
bool isPainted = false;
|
||||
bool isSecondHand = false;
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
double _unitBase = 0;
|
||||
int _areaValue = 0;
|
||||
double _depValue = 0;
|
||||
double _unitValue = 0;
|
||||
double _marketValue = 0;
|
||||
String _className = "";
|
||||
int _classId = 0;
|
||||
String _structureType = "";
|
||||
bool _withoutBUCC = false;
|
||||
int _notPaintedUnitVal = 0;
|
||||
int _secondHandUnitVal = 0;
|
||||
|
||||
BoxDecoration box1() {
|
||||
return const BoxDecoration(boxShadow: [
|
||||
BoxShadow(color: Colors.black12, spreadRadius: 5, blurRadius: 5)
|
||||
], color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(3)));
|
||||
}
|
||||
|
||||
double _computeValue(double unitbase, double unitvalue, double area) {
|
||||
// Compute some value based on the text here
|
||||
return (unitbase * unitvalue) * area;
|
||||
}
|
||||
|
||||
double _amountofDepreciation(unitVal, unitBase, area, depreciation) {
|
||||
return ((unitVal * unitBase) * area) * depreciation;
|
||||
}
|
||||
|
||||
double _adjustedMarketValue(unitVal, unitBase, area, depreciation) {
|
||||
double depAmount = ((unitVal * unitBase) * area) * depreciation;
|
||||
|
||||
return ((unitVal * unitBase) * area) - depAmount;
|
||||
}
|
||||
|
||||
double _totalMarketValue(unitVal, unitBase, area, depreciation, withBUCC,
|
||||
className, painted, secondHand, paintedUnitVal, secondhandUntVal) {
|
||||
if (withBUCC == false) {
|
||||
if (painted == true || secondHand == true) {
|
||||
final deductions = (paintedUnitVal + secondhandUntVal) / 100;
|
||||
|
||||
print(deductions);
|
||||
return (((unitVal - deductions) * unitBase) * area);
|
||||
} else {
|
||||
return ((unitVal * unitBase) * area);
|
||||
}
|
||||
} else {
|
||||
return (unitVal * area);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<AdditionalItemsEditBloc, AdditionalItemsEditState>(
|
||||
buildWhen: (previous, current) {
|
||||
return false;
|
||||
}, builder: (context, state) {
|
||||
if (state is ShowAddItemsScreenEdit) {
|
||||
return FormBuilder(
|
||||
key: formKey,
|
||||
onChanged: () {
|
||||
formKey.currentState?.save();
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
height: 800,
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 10, right: 0, bottom: 0),
|
||||
child: FormBuilderDropdown(
|
||||
name: 'extra_item',
|
||||
autofocus: false,
|
||||
decoration:
|
||||
normalTextFieldStyle("Additional Item", ""),
|
||||
items: widget.options
|
||||
.map((e) => DropdownMenuItem(
|
||||
value: e,
|
||||
child: Text(e.componentName!),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (value) {
|
||||
if (value!.minBaseUnitvalPercent != '0.00') {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
value.minBaseUnitvalPercent!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == '1' ? true : false;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.minBaseUnitvalPercent});
|
||||
}
|
||||
if (value.maxBaseUnitvalPercent != '0.00') {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
value.maxBaseUnitvalPercent!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == '1' ? true : false;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.maxBaseUnitvalPercent});
|
||||
}
|
||||
if (value.minUnitvalSqrmtr != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.minUnitvalSqrmtr!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == '1' ? true : false;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.minUnitvalSqrmtr});
|
||||
}
|
||||
if (value.maxUnitvalSqrmtr != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.maxUnitvalSqrmtr!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == '1' ? true : false;
|
||||
;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.maxUnitvalSqrmtr});
|
||||
}
|
||||
if (value.minAddBaseunitval != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.minAddBaseunitval!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == '1' ? true : false;
|
||||
;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.minAddBaseunitval});
|
||||
}
|
||||
if (value.maxAddBaseunitval != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.maxAddBaseunitval!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == '1' ? true : false;
|
||||
;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.maxAddBaseunitval});
|
||||
}
|
||||
if (value.minDeductBaserate != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.minDeductBaserate!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == '1' ? true : false;
|
||||
;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.minDeductBaserate});
|
||||
}
|
||||
if (value.maxDeductBaserate != '0.00') {
|
||||
setState(() {
|
||||
_unitValue =
|
||||
double.parse(value.maxDeductBaserate!);
|
||||
_className = value.componentName!;
|
||||
_classId = value.id!;
|
||||
_withoutBUCC =
|
||||
value.withoutBucc == '1' ? true : false;
|
||||
;
|
||||
});
|
||||
formKey.currentState!.patchValue(
|
||||
{'unitValue': value.maxDeductBaserate});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 10, right: 0, bottom: 0),
|
||||
child: SizedBox(
|
||||
height: 45,
|
||||
child: SearchField(
|
||||
itemHeight: 70,
|
||||
suggestions: widget.unit
|
||||
.map((UnitConstruct unit) =>
|
||||
SearchFieldListItem(
|
||||
unit.bldgType! +
|
||||
' - ' +
|
||||
unit.building,
|
||||
item: unit,
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
unit.bldgType +
|
||||
' - ' +
|
||||
unit.building!.toUpperCase(),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
)))
|
||||
.toList(),
|
||||
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
|
||||
searchInputDecoration: normalTextFieldStyle(
|
||||
"Structure Type", "")
|
||||
.copyWith(
|
||||
suffixIcon:
|
||||
const Icon(Icons.arrow_drop_down)),
|
||||
////agency suggestion tap
|
||||
focusNode: focus,
|
||||
suggestionState: Suggestion.expand,
|
||||
onSuggestionTap: (unit) {
|
||||
setState(() {
|
||||
_unitBase =
|
||||
double.parse(unit.item!.unitValue);
|
||||
_structureType = unit.item!.bldgType +
|
||||
' - ' +
|
||||
unit.item!.building;
|
||||
});
|
||||
focus.unfocus();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
// const SizedBox(height: 10),
|
||||
// Container(
|
||||
// margin: const EdgeInsets.only(
|
||||
// left: 0, top: 10, right: 0, bottom: 0),
|
||||
// child: FormBuilderDropdown(
|
||||
// name: 'struc_type',
|
||||
// autofocus: false,
|
||||
// decoration:
|
||||
// normalTextFieldStyle("Structure Type", ""),
|
||||
// items: widget.unit
|
||||
// .map((e) => DropdownMenuItem(
|
||||
// value: e,
|
||||
// child:
|
||||
// Text(e.bldgType + " - " + e.building),
|
||||
// ))
|
||||
// .toList(),
|
||||
// onChanged: (val) {
|
||||
// setState(() {
|
||||
// _unitBase = double.parse(val!.unitValue);
|
||||
// _structureType = val.bldgType;
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
name: 'unitValue',
|
||||
decoration:
|
||||
normalTextFieldStyle("Unit Value", ""),
|
||||
validator: FormBuilderValidators.compose([]),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
name: 'areaValue',
|
||||
decoration: normalTextFieldStyle("Area", ""),
|
||||
validator: FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_areaValue = int.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// const SizedBox(height: 10),
|
||||
// FormBuilderTextField(
|
||||
// name: 'depRate',
|
||||
// decoration:
|
||||
// normalTextFieldStyle("Depreciation Rate", ""),
|
||||
// validator: FormBuilderValidators.compose([]),
|
||||
// onChanged: (value) {
|
||||
// setState(() {
|
||||
// _depValue = double.parse(value!);
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// const SizedBox(height: 10),
|
||||
// FormBuilderTextField(
|
||||
// name: 'marketValue',
|
||||
// decoration: normalTextFieldStyle(
|
||||
// NumberFormat.currency(
|
||||
// locale: 'en-PH', symbol: "₱")
|
||||
// .format(_totalMarketValue(_unitValue,
|
||||
// _unitBase, _areaValue, _depValue)),
|
||||
// ""),
|
||||
// validator: FormBuilderValidators.compose([]),
|
||||
// onChanged: (value) {
|
||||
// setState(() {
|
||||
// _marketValue = double.parse(value!);
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// const SizedBox(height: 10),
|
||||
// Text('Amount of Depreciation'),
|
||||
// const SizedBox(height: 5),
|
||||
// Container(
|
||||
// height: 45.0,
|
||||
// width: double.infinity,
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.white,
|
||||
// border: Border.all(
|
||||
// color: Colors.grey,
|
||||
// width: 1.0,
|
||||
// ),
|
||||
// borderRadius: BorderRadius.circular(5.0),
|
||||
// ),
|
||||
// child: Align(
|
||||
// alignment: Alignment.center,
|
||||
// child: Text(NumberFormat.currency(
|
||||
// locale: 'en-PH', symbol: "₱")
|
||||
// .format(_amountofDepreciation(_unitValue,
|
||||
// _unitBase, _areaValue, _depValue)))),
|
||||
// ),
|
||||
|
||||
Visibility(
|
||||
visible: !_withoutBUCC,
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
Text('Building is not painted?'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: isPainted,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
isPainted = value!;
|
||||
if (value == false) {
|
||||
_notPaintedUnitVal = 0;
|
||||
} else {
|
||||
_notPaintedUnitVal = 10;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Container(
|
||||
height: 40.0,
|
||||
width: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(' - ' +
|
||||
_notPaintedUnitVal.toString() +
|
||||
'%')),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text('Uses second hand materials?'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: isSecondHand,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
isSecondHand = value!;
|
||||
if (isSecondHand == false) {
|
||||
_secondHandUnitVal = 0;
|
||||
formKey.currentState!.patchValue(
|
||||
{'secondHandMat': '0'});
|
||||
} else {
|
||||
_secondHandUnitVal = 5;
|
||||
formKey.currentState!.patchValue(
|
||||
{'secondHandMat': '5'});
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 40,
|
||||
width: 100,
|
||||
child: FormBuilderTextField(
|
||||
enabled: isSecondHand,
|
||||
name: 'secondHandMat',
|
||||
textAlign: TextAlign.center,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Unit Value", ""),
|
||||
validator:
|
||||
FormBuilderValidators.compose(
|
||||
[]),
|
||||
onChanged: (value) {
|
||||
// Check if the value is not null before parsing to double
|
||||
if (value != null &&
|
||||
value.isNotEmpty) {
|
||||
setState(() {
|
||||
_secondHandUnitVal =
|
||||
int.parse(value);
|
||||
});
|
||||
} else {
|
||||
// Handle the case when the value is empty or null
|
||||
// For example, set _secondHandUnitVal to a default value or show an error message.
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
width: 40,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'%',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 10),
|
||||
Text('Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(_totalMarketValue(
|
||||
_unitValue,
|
||||
_unitBase,
|
||||
_areaValue,
|
||||
_depValue,
|
||||
_withoutBUCC,
|
||||
_className,
|
||||
isPainted,
|
||||
isSecondHand,
|
||||
_notPaintedUnitVal,
|
||||
_secondHandUnitVal)))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
var itemss = AdditionalItems(
|
||||
id: 1,
|
||||
bldgapprDetailsId: widget.tempId,
|
||||
classId: _classId,
|
||||
className: _className,
|
||||
structType: _structureType,
|
||||
unitValue:
|
||||
_withoutBUCC == true ? 0 : _unitValue,
|
||||
baseUnitValue: _unitBase,
|
||||
area: _areaValue,
|
||||
marketValue:
|
||||
(_unitValue * _unitBase) * _areaValue,
|
||||
depreciationRate: _depValue,
|
||||
adjustedMarketVal: _totalMarketValue(
|
||||
_unitValue,
|
||||
_unitBase,
|
||||
_areaValue,
|
||||
_depValue,
|
||||
_withoutBUCC,
|
||||
_className,
|
||||
isPainted,
|
||||
isSecondHand,
|
||||
_notPaintedUnitVal,
|
||||
_secondHandUnitVal),
|
||||
actualUse: 'Test',
|
||||
amtDepreciation: _amountofDepreciation(
|
||||
_unitValue,
|
||||
_unitBase,
|
||||
_areaValue,
|
||||
_depValue,
|
||||
),
|
||||
painted: isPainted == true ? '1' : '0',
|
||||
secondhand:
|
||||
isSecondHand == true ? '1' : '0',
|
||||
paintedUnitval: '1',
|
||||
secondhandUnitval: '1');
|
||||
|
||||
context.read<AdditionalItemsEditBloc>().add(
|
||||
AddAdditionalItemsEdit(items: itemss));
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Submit"),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width:
|
||||
5), // Use SizedBox for horizontal spacing in a Row
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
.read<AdditionalItemBloc>()
|
||||
.add(LoadAdditionalItems());
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Cancel"),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,329 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/additional_item/additional_item_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/additional_items_edit/additional_items_edit_bloc.dart';
|
||||
import 'package:unit2/model/passo/additional_items.dart';
|
||||
import 'package:unit2/model/passo/class_components%20_offline.dart';
|
||||
import 'package:unit2/model/passo/class_components.dart';
|
||||
import 'package:unit2/model/passo/unit_construct.dart';
|
||||
import 'package:unit2/screens/passo/Building/edit_building/AddExtraItems.dart';
|
||||
import 'package:unit2/utils/alerts.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
|
||||
class AdditionalItemEditPage extends StatefulWidget {
|
||||
final List<UnitConstruct> unit;
|
||||
final List<ClassComponentsOffline> options;
|
||||
final int tempId;
|
||||
final VoidCallback NextBtn;
|
||||
final VoidCallback PrevBtn;
|
||||
|
||||
AdditionalItemEditPage(
|
||||
this.unit, this.options, this.tempId, this.NextBtn, this.PrevBtn);
|
||||
|
||||
@override
|
||||
_AdditionalItemEditPage createState() => _AdditionalItemEditPage();
|
||||
}
|
||||
|
||||
class _AdditionalItemEditPage extends State<AdditionalItemEditPage> {
|
||||
void deleteItem(int itemId) {
|
||||
context
|
||||
.read<AdditionalItemsEditBloc>()
|
||||
.add(DeleteAdditionalItemsEdit(id: itemId));
|
||||
}
|
||||
|
||||
// double _totalMarketValue(items) {
|
||||
// double total = 0;
|
||||
// items.forEach((row) {
|
||||
// total += double.parse(row.adjustedMarketVal);
|
||||
// });
|
||||
// return total;
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<AdditionalItemsEditBloc, AdditionalItemsEditState>(
|
||||
listener: (context, state) {
|
||||
if (state is AdditionalItemsEditLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is AdditionalItemsEditLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is AdditionalItemsEditErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
final state = context.watch<AdditionalItemsEditBloc>().state;
|
||||
if (state is AdditionalItemsEditLoaded) {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 500,
|
||||
child: Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('ADDITIONAL ITEMS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
onPressed: () {
|
||||
context
|
||||
.read<AdditionalItemsEditBloc>()
|
||||
.add(ShowAdditionalItemsEdit());
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text('ADD ITEM'), // <-- Text
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
const Icon(
|
||||
// <-- Icon
|
||||
Icons.add,
|
||||
size: 24.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: DataTable(
|
||||
// ignore: prefer_const_literals_to_create_immutables
|
||||
columns: [
|
||||
const DataColumn(
|
||||
label: Text('Items'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Unit Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('% of BUCC'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Market Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Action'),
|
||||
)
|
||||
],
|
||||
rows: state.items.map((dataRow) {
|
||||
return DataRow(
|
||||
cells: [
|
||||
DataCell(Text(dataRow.className)),
|
||||
DataCell(Text(dataRow.baseUnitValue)),
|
||||
DataCell(Text(dataRow.unitValue)),
|
||||
DataCell(Text(((double.parse(
|
||||
dataRow.adjustedMarketVal)))
|
||||
.toString())),
|
||||
DataCell(Row(
|
||||
children: [
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
deleteItem(dataRow.id);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 20.0, right: 20.0),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Total',
|
||||
// style:
|
||||
// TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
// ),
|
||||
// Text(
|
||||
// NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
||||
// .format(_totalMarketValue(state.items)),
|
||||
// style:
|
||||
// TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.PrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.NextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
if (state is AdditionalItemsEditDeletedState) {
|
||||
if (state.success) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
successAlert(context, "Deletion Successful",
|
||||
"Extra item has been deleted successfully", () {
|
||||
Navigator.of(context).pop();
|
||||
context.read<AdditionalItemsEditBloc>().add(
|
||||
LoadAdditionalItemsEdit(
|
||||
items: const <AdditionalItems>[],
|
||||
id: widget.tempId));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
if (state is ShowAddItemsScreenEdit) {
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxHeight: 1000.0),
|
||||
child: AlertDialog(
|
||||
insetPadding: EdgeInsets.symmetric(
|
||||
horizontal: 20.0,
|
||||
vertical: 10.0,
|
||||
),
|
||||
title: Text(
|
||||
'ADD EXTRA ITEMS',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: AddExtraItemsEdit(
|
||||
widget.unit, widget.options, widget.tempId))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('ADDITIONAL MATERIALS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
.read<AdditionalItemBloc>()
|
||||
.add(ShowAdditionalItems());
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text('ADD ITEM'), // <-- Text
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
const Icon(
|
||||
// <-- Icon
|
||||
Icons.add,
|
||||
size: 24.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,419 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:unit2/bloc/passo/barangay/barangay_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/landref/landref_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/location/location_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||
|
||||
import 'package:unit2/bloc/passo/municipality/municipality_bloc.dart';
|
||||
|
||||
import 'package:unit2/model/passo/barangay.dart';
|
||||
import 'package:unit2/model/passo/bldg_loc.dart';
|
||||
import 'package:unit2/model/passo/city.dart';
|
||||
import 'package:unit2/model/passo/land_ref.dart';
|
||||
import 'package:unit2/screens/passo/Building/edit_building/property_owner_info.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
class BldgLocLandRefEdit extends StatefulWidget {
|
||||
final int tempId;
|
||||
final VoidCallback NextBtn;
|
||||
final VoidCallback PrevBtn;
|
||||
|
||||
BldgLocLandRefEdit(this.tempId, this.NextBtn, this.PrevBtn);
|
||||
@override
|
||||
_BldgLocLandRefEdit createState() => _BldgLocLandRefEdit();
|
||||
}
|
||||
|
||||
class _BldgLocLandRefEdit extends State<BldgLocLandRefEdit> {
|
||||
Set<String> seenCityCodes = Set<String>();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<LocationBloc, LocationState>(
|
||||
listener: (context, state) {
|
||||
if (state is LocationLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
|
||||
if (state is LocationErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is LocationLoaded) {
|
||||
final bldgloc = state.bldgloc;
|
||||
return BlocConsumer<LandrefBloc, LandrefState>(
|
||||
listener: (context, state) {
|
||||
if (state is LandrefLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is LandrefErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is LandrefLoaded) {
|
||||
final landRef = state.landRef;
|
||||
return BlocConsumer<MunicipalityBloc, MunicipalityState>(
|
||||
listener: (context, state) {
|
||||
if (state is MunicipalityLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is MunicipalityErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
if (state is MunicipalityLoaded) {
|
||||
final cityList = state.municipality;
|
||||
Set<City> uniqueItems = {};
|
||||
|
||||
// Iterate through the dropdownItems list to filter out duplicates
|
||||
for (var item in cityList) {
|
||||
uniqueItems.add(item);
|
||||
}
|
||||
return BlocConsumer<BarangayBloc, BarangayState>(
|
||||
listener: (context, state) {
|
||||
if (state is BarangayLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is BarangayLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is BarangayErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
if (state is BarangayLoaded) {
|
||||
List<Brgy> brgyList = state.brgy;
|
||||
List<String> brgyNAmes = brgyList
|
||||
.map((brgy) => brgy.barangayDescription)
|
||||
.toList()
|
||||
.cast<String>();
|
||||
return FormBuilder(
|
||||
key: keys,
|
||||
initialValue: {
|
||||
'street': bldgloc.street ?? "",
|
||||
'province': bldgloc.province ?? "",
|
||||
'l_owner': landRef.owner,
|
||||
'oct_tct_cloa': landRef.cloaNo ?? "",
|
||||
'survey_no': landRef.surveyNo ?? "",
|
||||
'lot_no': landRef.lotNo ?? "",
|
||||
'blk_no': landRef.blkNo ?? "",
|
||||
'l_td_arp': landRef.tdn ?? "",
|
||||
'area': landRef.area ?? ""
|
||||
},
|
||||
enabled: true,
|
||||
onChanged: () {
|
||||
keys.currentState!.save();
|
||||
debugPrint(keys.currentState!.value.toString());
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
skipDisabled: true,
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 20,
|
||||
right: 0,
|
||||
bottom: 10),
|
||||
child: const Text('BUILDING LOCATION',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderDropdown<City>(
|
||||
name: 'municipality',
|
||||
autofocus: false,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
bldgloc.municipality ??
|
||||
"Municipality",
|
||||
"",
|
||||
),
|
||||
items: uniqueItems
|
||||
.map(
|
||||
(city) =>
|
||||
DropdownMenuItem<
|
||||
City>(
|
||||
value: city,
|
||||
child: Text(
|
||||
city.cityDescription ??
|
||||
''),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
onChanged: (selectedCityCode) {
|
||||
// Find the corresponding City object using selectedCityCode
|
||||
final selectedCity = cityList
|
||||
.firstWhere((city) =>
|
||||
city.cityCode ==
|
||||
selectedCityCode);
|
||||
|
||||
final barangayBloc = context
|
||||
.read<BarangayBloc>();
|
||||
barangayBloc.add(LoadBarangay(
|
||||
id: selectedCityCode!
|
||||
.cityCode!));
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Province / City",
|
||||
"",
|
||||
'province'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"No. / Street", "", 'street'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customDropDownField(
|
||||
bldgloc.barangay ?? "",
|
||||
"Barangay",
|
||||
'brgy',
|
||||
brgyNAmes))
|
||||
]),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 20,
|
||||
right: 0,
|
||||
bottom: 10),
|
||||
child: const Text('LAND REFERENCE',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
customTextField(
|
||||
"Land Owner", "", 'l_owner'),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"OCT/TCT/CLOA No.",
|
||||
"",
|
||||
'oct_tct_cloa'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Survey No.",
|
||||
"",
|
||||
'survey_no'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Lot No.", "", 'lot_no'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Blk No.", "", 'blk_no'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"TD / ARP No.",
|
||||
"",
|
||||
'l_td_arp'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Area", "", 'area'))
|
||||
]),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(
|
||||
Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.PrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(
|
||||
Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
var bldgLocData = BldgLoc(
|
||||
id: widget.tempId,
|
||||
street: keys.currentState
|
||||
?.value['street'],
|
||||
barangay: keys.currentState
|
||||
?.value['brgy'],
|
||||
municipality: keys
|
||||
.currentState
|
||||
?.value[
|
||||
'municipality']
|
||||
?.cityDescription ??
|
||||
bldgloc.municipality,
|
||||
province: keys.currentState
|
||||
?.value['province'],
|
||||
);
|
||||
var landRefData = LandRef(
|
||||
id: widget.tempId,
|
||||
owner: keys.currentState
|
||||
?.value['l_owner'],
|
||||
cloaNo: keys.currentState
|
||||
?.value['oct_tct_cloa'],
|
||||
lotNo: keys.currentState
|
||||
?.value['lot_no'],
|
||||
tdn: keys.currentState
|
||||
?.value['l_td_arp'],
|
||||
area: keys.currentState
|
||||
?.value['area'],
|
||||
surveyNo: keys.currentState
|
||||
?.value['survey_no'],
|
||||
blkNo: keys.currentState
|
||||
?.value['blk_no'],
|
||||
);
|
||||
context.read<PropertyInfoBloc>()
|
||||
..add(UpdateBldgLoc(
|
||||
bldg_loc: bldgLocData))
|
||||
..add(UpdateLandRef(
|
||||
land_ref: landRefData));
|
||||
|
||||
widget.NextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (state is BarangayErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<BarangayBloc>()
|
||||
.add(LoadBarangay(id: '01'));
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
if (state is MunicipalityErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<MunicipalityBloc>()
|
||||
.add(LoadMunicipality());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
if (state is LandrefErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<LandrefBloc>().add(
|
||||
LoadLandref(id: widget.tempId, landRef: LandRef()));
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
if (state is LocationErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<LocationBloc>()
|
||||
.add(LoadLocation(id: widget.tempId, bldgloc: BldgLoc()));
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,361 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/general_description/general_description_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||
import 'package:unit2/model/passo/general_description.dart';
|
||||
import 'package:unit2/model/passo/unit_construct.dart';
|
||||
import 'package:unit2/screens/passo/Building/edit_building/property_owner_info.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
import '../add_building.dart';
|
||||
|
||||
class GeneralDescriptionEdit extends StatefulWidget {
|
||||
final List<UnitConstruct> unit;
|
||||
final int tempId;
|
||||
final VoidCallback NextBtn;
|
||||
final VoidCallback PrevBtn;
|
||||
|
||||
GeneralDescriptionEdit(this.unit, this.tempId, this.NextBtn, this.PrevBtn);
|
||||
@override
|
||||
_GeneralDescriptionEdit createState() => _GeneralDescriptionEdit();
|
||||
}
|
||||
|
||||
class _GeneralDescriptionEdit extends State<GeneralDescriptionEdit> {
|
||||
final actual_use = [
|
||||
"Residential",
|
||||
"Agricultural",
|
||||
"Commercial",
|
||||
"Industrial",
|
||||
"Mineral",
|
||||
"Timberland",
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child:
|
||||
BlocConsumer<GeneralDescriptionBloc, GeneralDescriptionState>(
|
||||
listener: (context, state) async {
|
||||
if (state is GenDescLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is GenDescLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
|
||||
final tempID = await SharedPreferences.getInstance();
|
||||
await tempID.setInt(
|
||||
'totalValue', int.parse(state.gendesc.totalFloorArea!));
|
||||
await tempID.setString(
|
||||
'actualUse', state.gendesc.actualUse!);
|
||||
}
|
||||
if (state is GenDescErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is GenDescLoaded) {
|
||||
return FormBuilder(
|
||||
key: keys,
|
||||
initialValue: {
|
||||
'bldg_permit': state.gendesc.bldgPermit,
|
||||
'date_issued': state.gendesc.dateIssued.toString(),
|
||||
'cct': state.gendesc.cct.toString(),
|
||||
'coc_issued':
|
||||
state.gendesc.certCompletionIssued.toString(),
|
||||
'coo_issued':
|
||||
state.gendesc.certOccupancyIssued.toString(),
|
||||
'date_cnstructed': state.gendesc.dateIssued.toString(),
|
||||
'date_occupied': state.gendesc.dateOccupied.toString(),
|
||||
'bldg_age': state.gendesc.bldgAge.toString(),
|
||||
'no_of_storeys': state.gendesc.noStoreys.toString(),
|
||||
'area_of_1stFl': state.gendesc.area1Stfloor,
|
||||
'area_of_2ndFl': state.gendesc.area2Ndfloor,
|
||||
'area_of_3rdFl': state.gendesc.area3Rdfloor,
|
||||
'area_of_4thFl': state.gendesc.area4Thfloor,
|
||||
'total_area': state.gendesc.totalFloorArea.toString(),
|
||||
'actual_use': state.gendesc.actualUse
|
||||
},
|
||||
enabled: true,
|
||||
onChanged: () {
|
||||
keys.currentState!.save();
|
||||
debugPrint(keys.currentState!.value.toString());
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
skipDisabled: true,
|
||||
child: Expanded(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('GENERAL DESCRIPTION',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 10, right: 0, bottom: 0),
|
||||
child: FormBuilderDropdown(
|
||||
name: 'bldg_type',
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle(
|
||||
state.gendesc.bldgKind ??
|
||||
"Kind of Building",
|
||||
"Kind of Building"),
|
||||
items: widget.unit
|
||||
.map((e) => DropdownMenuItem(
|
||||
value: e,
|
||||
child: Text(e.bldgType +
|
||||
'-' +
|
||||
e.building),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
customDropDownField(
|
||||
"Actual Use", "", 'actual_use', actual_use),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Bldg. Permit No.",
|
||||
"",
|
||||
'bldg_permit'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customDatTimePicker(
|
||||
"Certificate of Occupancy Issued ON",
|
||||
"",
|
||||
'date_issued'))
|
||||
]),
|
||||
customTextField(
|
||||
"Condominium Certificate of Title (CCT)",
|
||||
"",
|
||||
'cct'),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customDatTimePicker(
|
||||
"Certificate of Completion Issued ON",
|
||||
"",
|
||||
'coc_issued'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customDatTimePicker(
|
||||
"Certificate of Occupancy Issued ON",
|
||||
"",
|
||||
'coo_issued'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customDatTimePicker(
|
||||
"Date Constructed /Completed",
|
||||
"",
|
||||
'date_cnstructed'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customDatTimePicker(
|
||||
"Date Occupied",
|
||||
"",
|
||||
'date_occupied'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Bldg. Age", "", 'bldg_age'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"No. of storeys",
|
||||
"",
|
||||
'no_of_storeys'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Area of 1st Floor",
|
||||
"",
|
||||
'area_of_1stFl'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Area of 2nd Floor",
|
||||
"",
|
||||
'area_of_2ndFl'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Area of 3rd Floor",
|
||||
"",
|
||||
'area_of_3rdFl')),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Area of 4th Floor",
|
||||
"",
|
||||
'area_of_4thFl'))
|
||||
]),
|
||||
customTextField("Total Area", "", 'total_area'),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(
|
||||
Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.PrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(
|
||||
Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
keys.currentState!.save();
|
||||
var genDescData = GeneralDesc(
|
||||
id: widget.tempId,
|
||||
bldgKind: keys
|
||||
.currentState
|
||||
?.value['bldg_type']
|
||||
?.building ??
|
||||
state.gendesc.bldgKind,
|
||||
strucType: keys
|
||||
.currentState
|
||||
?.value['bldg_type']
|
||||
?.bldgType ??
|
||||
state.gendesc.strucType,
|
||||
bldgPermit: keys.currentState
|
||||
?.value['bldg_permit'],
|
||||
dateIssued: keys.currentState
|
||||
?.value['coc_issued'],
|
||||
cct: keys
|
||||
.currentState?.value['cct'],
|
||||
certCompletionIssued: keys
|
||||
.currentState
|
||||
?.value['coc_issued'],
|
||||
certOccupancyIssued: keys
|
||||
.currentState
|
||||
?.value['coo_issued'],
|
||||
dateCompleted:
|
||||
keys.currentState?.value['date_cnstructed'],
|
||||
dateOccupied: keys.currentState?.value['date_occupied'],
|
||||
bldgAge: keys.currentState?.value['bldg_age'],
|
||||
noStoreys: keys.currentState?.value['no_of_storeys'],
|
||||
area1Stfloor: keys.currentState?.value['area_of_1stFl'],
|
||||
area2Ndfloor: keys.currentState?.value['area_of_2ndFl'],
|
||||
area3Rdfloor: keys.currentState?.value['area_of_3rdFl'],
|
||||
area4Thfloor: keys.currentState?.value['area_of_4thFl'],
|
||||
totalFloorArea: keys.currentState?.value['total_area'],
|
||||
floorSketch: null,
|
||||
actualUse: keys.currentState?.value['actual_use']);
|
||||
|
||||
context.read<PropertyInfoBloc>()
|
||||
..add(UpdateGeneralDesc(
|
||||
gen_desc: genDescData));
|
||||
|
||||
widget.NextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (state is GenDescErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<GeneralDescriptionBloc>().add(LoadGenDesc(
|
||||
id: widget.tempId, gendesc: GeneralDesc()));
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,254 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:multiselect/multiselect.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||
import 'package:unit2/model/passo/property_info.dart';
|
||||
import 'package:unit2/theme-data.dart/btn-style.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
GlobalKey<FormBuilderState> keys = GlobalKey<FormBuilderState>();
|
||||
|
||||
class PropertyOwnerInfoEdit extends StatefulWidget {
|
||||
final int index;
|
||||
final PropertyInfo faas;
|
||||
final String title;
|
||||
final VoidCallback NextBtn;
|
||||
final VoidCallback PrevBtn;
|
||||
|
||||
const PropertyOwnerInfoEdit(
|
||||
this.index, this.faas, this.title, this.NextBtn, this.PrevBtn);
|
||||
|
||||
@override
|
||||
State<PropertyOwnerInfoEdit> createState() => _PropertyOwnerInfoEdit();
|
||||
}
|
||||
|
||||
ButtonStyle secondaryBtnStyle(
|
||||
Color background, Color borderColor, Color overlay) {
|
||||
return ButtonStyle(
|
||||
elevation: MaterialStateProperty.all<double>(0),
|
||||
backgroundColor: MaterialStateProperty.all<Color>(background),
|
||||
overlayColor: MaterialStateProperty.all<Color>(overlay),
|
||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
side: BorderSide(
|
||||
width: 2,
|
||||
color: borderColor,
|
||||
))));
|
||||
}
|
||||
|
||||
class _PropertyOwnerInfoEdit extends State<PropertyOwnerInfoEdit> {
|
||||
// late List<String> selectedFoundation = widget.faas.foundations;
|
||||
// late List<String> selectedColumns = widget.faas.columns;
|
||||
// late List<String> selectedBeams = widget.faas.beams;
|
||||
// late List<String> selectedTFraming = widget.faas.truss_framing;
|
||||
// late List<String> selectedRoof = widget.faas.roof;
|
||||
// late List<String> selectedFlooring = widget.faas.flooring;
|
||||
// late List<String> selectedWallPartition = widget.faas.walls_and_partition;
|
||||
|
||||
Map<String, dynamic> myMap = {'zero': 0, 'one': 1, 'two': 2};
|
||||
|
||||
final transaction_codes = ['New', 'Revision'];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocConsumer<PropertyInfoBloc, PropertyInfoState>(
|
||||
listener: (context, state) {
|
||||
if (state is PropertyInfoLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is PropertyInfoLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
|
||||
if (state is PropertyInfoErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
if (state is PropertyInfoLoaded) {
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Expanded(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
FormBuilder(
|
||||
key: keys,
|
||||
initialValue: {
|
||||
'transaction_code': widget.faas.transCode,
|
||||
'arp_td': widget.faas.tdn,
|
||||
'pin': widget.faas.pin,
|
||||
'owner': widget.faas.owner,
|
||||
'address': widget.faas.address,
|
||||
'tel_no': widget.faas.telno,
|
||||
'tin': widget.faas.tin,
|
||||
'benificiary': widget.faas.adminUser,
|
||||
'benificiary_telno': widget.faas.adminTelno,
|
||||
'benificiary_address': widget.faas.adminAddress,
|
||||
'benificaiary_tin': widget.faas.adminTin,
|
||||
},
|
||||
enabled: true,
|
||||
onChanged: () {
|
||||
keys.currentState!.save();
|
||||
debugPrint(keys.currentState!.value.toString());
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
skipDisabled: true,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('PROPERTY OWNER INFO',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
customDropDownField("Transaction Code", "",
|
||||
"transaction_code", transaction_codes),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"ARP No. / TD No.", "", 'arp_td')),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child:
|
||||
customTextField("Pin", "", 'pin')),
|
||||
],
|
||||
),
|
||||
customTextField("Owner", "", 'owner'),
|
||||
customTextField("Address", "", 'address'),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Tel No.", "", 'tel_no'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child:
|
||||
customTextField("TIN", "", 'tin'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Administrator / Benificial User",
|
||||
"",
|
||||
'benificiary'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"TIN", "", 'benificiary_tin'))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField("Address", "",
|
||||
'benificiary_address'),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("Tel No.", "",
|
||||
'benificiary_telno'))
|
||||
]),
|
||||
const SizedBox(height: 25),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: CustomButton(
|
||||
icon: const Icon(Icons.chevron_right,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
var property_info = PropertyInfo(
|
||||
id: widget.faas.id,
|
||||
transCode: keys.currentState!
|
||||
.value['transaction_code']
|
||||
.toString(),
|
||||
tdn: keys.currentState!.value['arp_td'],
|
||||
pin: keys.currentState!.value['pin'],
|
||||
owner:
|
||||
keys.currentState!.value['owner'],
|
||||
address:
|
||||
keys.currentState!.value['address'],
|
||||
telno:
|
||||
keys.currentState!.value['tel_no'],
|
||||
tin: keys.currentState!.value['tin'],
|
||||
adminUser: keys
|
||||
.currentState!.value['benificiary'],
|
||||
adminAddress: keys.currentState!
|
||||
.value['benificiary_address'],
|
||||
adminTin: keys.currentState!
|
||||
.value['benificiary_tin'],
|
||||
adminTelno: keys.currentState!
|
||||
.value['benificiary_telno'],
|
||||
);
|
||||
|
||||
context.read<PropertyInfoBloc>().add(
|
||||
UpdatPropertyInfo(
|
||||
property_info: property_info));
|
||||
|
||||
widget.NextBtn();
|
||||
},
|
||||
),
|
||||
),
|
||||
])),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
if (state is PropertyInfoErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<PropertyInfoBloc>().add(LoadPropertyInfo());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,448 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:multiselect/multiselect.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/structural_material/structural_material_bloc.dart';
|
||||
import 'package:unit2/model/passo/structural_materials_ii.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
class StructuralMaterialsPageEdit extends StatefulWidget {
|
||||
// final VoidCallback onPutStructuralMaterials;
|
||||
final int tempId;
|
||||
final VoidCallback NextBtn;
|
||||
final VoidCallback PrevBtn;
|
||||
|
||||
StructuralMaterialsPageEdit(this.tempId, this.NextBtn, this.PrevBtn);
|
||||
|
||||
@override
|
||||
_StructuralMaterialsPageEdit createState() => _StructuralMaterialsPageEdit();
|
||||
}
|
||||
|
||||
class _StructuralMaterialsPageEdit extends State<StructuralMaterialsPageEdit> {
|
||||
bool foundationOthers = false;
|
||||
bool columOthers = false;
|
||||
bool beamsOthers = false;
|
||||
bool tfOthers = false;
|
||||
bool roofOthers = false;
|
||||
bool flooringOthers = false;
|
||||
bool wpOthers = false;
|
||||
List<String> foundation = [];
|
||||
List<String> column = [];
|
||||
List<String> beam = [];
|
||||
List<String> truss_framing = [];
|
||||
List<String> roof = [];
|
||||
List<String> flooring = [];
|
||||
List<String> walls = [];
|
||||
|
||||
List<String> selectedColumnValues = [];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocConsumer<StructuralMaterialBloc, StructuralMaterialState>(
|
||||
listener: (context, state) {
|
||||
if (state is StructuralMaterialsLoaded) {
|
||||
setState(() {
|
||||
foundation = state.structure.foundation!.split(',') ?? [];
|
||||
column = state.structure.columns!.split(',') ?? [];
|
||||
beam = state.structure.beams!.split(',') ?? [];
|
||||
truss_framing = state.structure.trussFraming!.split(',') ?? [];
|
||||
roof = state.structure.roof!.split(',') ?? [];
|
||||
flooring = state.structure.flooring!.split(',') ?? [];
|
||||
walls = state.structure.walls!.split(',') ?? [];
|
||||
// Update other local state variables here if needed
|
||||
});
|
||||
}
|
||||
// TODO: implement listener
|
||||
}, builder: (context, state) {
|
||||
if (state is StructuralMaterialsLoaded) {
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('STRUCTURAL MATERIALS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'FOUNDATION',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: foundationOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
foundationOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: foundationOthers,
|
||||
child: customTextField(
|
||||
"Enter other foundation", "", "other_foundation"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
foundation = x;
|
||||
});
|
||||
},
|
||||
options: const [
|
||||
'Reinforced Concrete',
|
||||
'Plain Concrete'
|
||||
],
|
||||
selectedValues: foundation,
|
||||
whenEmpty: 'Select Foundations',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'COLUMNS',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: columOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
columOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: columOthers,
|
||||
child: customTextField(
|
||||
"Enter other columns", "", "other_column"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
column = x;
|
||||
});
|
||||
},
|
||||
options: const [
|
||||
'Steel',
|
||||
'Reinforced Concrete',
|
||||
'Wood'
|
||||
],
|
||||
selectedValues: column,
|
||||
whenEmpty: 'Select Column/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'BEAMS',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: beamsOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
beamsOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: beamsOthers,
|
||||
child: customTextField(
|
||||
"Enter other beam/s", "", "other_beam"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
beam = x;
|
||||
});
|
||||
},
|
||||
options: const [
|
||||
'Steel',
|
||||
'Reinforced Concrete',
|
||||
'Wood'
|
||||
],
|
||||
selectedValues: beam,
|
||||
whenEmpty: 'Select Beam/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'TRUSS FRAMING',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: tfOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
tfOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: tfOthers,
|
||||
child: customTextField(
|
||||
"Enter other truss framing/s", "", "other_tf"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
truss_framing = x;
|
||||
});
|
||||
},
|
||||
options: const ['Steel', 'Wood'],
|
||||
selectedValues: truss_framing,
|
||||
whenEmpty: 'Select Truss Framing/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'ROOF',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: roofOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
roofOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: roofOthers,
|
||||
child: customTextField(
|
||||
"Enter other roof/s", "", "other_roof"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
roof = x;
|
||||
});
|
||||
},
|
||||
options: const [
|
||||
'Reinforced Concrete',
|
||||
'Tiles',
|
||||
'G.I Sheet',
|
||||
'Aluminum',
|
||||
'Asbestos',
|
||||
'Long Span',
|
||||
'Concrete Desk',
|
||||
'Nipa/Anahaw/Cogon'
|
||||
],
|
||||
selectedValues: roof,
|
||||
whenEmpty: 'Select Roof/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'FLOORING',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: flooringOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
flooringOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: flooringOthers,
|
||||
child: customTextField(
|
||||
"Enter other flooring/s", "", "other_flooring"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
flooring = x;
|
||||
});
|
||||
},
|
||||
options: const [
|
||||
'Reinforced Concrete',
|
||||
'Plain Cement',
|
||||
'Marble',
|
||||
'Wood',
|
||||
'Tiles'
|
||||
],
|
||||
selectedValues: flooring,
|
||||
whenEmpty: 'Select Flooring/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'WALLS & PARTITIONS',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: wpOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
wpOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: wpOthers,
|
||||
child: customTextField(
|
||||
"Enter other walls & partition/s", "", "other_wp"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
walls = x;
|
||||
});
|
||||
},
|
||||
options: const [
|
||||
'Reinforced Concrete',
|
||||
'Plain Concrete',
|
||||
'Wood',
|
||||
'CHIB',
|
||||
'G.I Sheet',
|
||||
'Build-a-wall',
|
||||
'Sawali',
|
||||
'Bamboo'
|
||||
],
|
||||
selectedValues: walls,
|
||||
whenEmpty: 'Select Walls & Partition/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.PrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
var strucMaterials = StructureMaterialsII(
|
||||
id: widget.tempId,
|
||||
foundation: foundation,
|
||||
columns: column,
|
||||
beams: beam,
|
||||
trussFraming: truss_framing,
|
||||
roof: roof,
|
||||
flooring: flooring,
|
||||
walls: walls,
|
||||
others: ["Others"]);
|
||||
context.read<PropertyInfoBloc>()
|
||||
..add(
|
||||
UpdateStrucMaterials(data: strucMaterials));
|
||||
|
||||
widget.NextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
if (state is StructuralMaterialsErrorState) {
|
||||
return Text(state.error);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,481 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:multiselect/multiselect.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/structural_material/structural_material_bloc.dart';
|
||||
import 'package:unit2/model/passo/structural_materials_ii.dart';
|
||||
import 'package:unit2/screens/passo/Building/add_building.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
class MaterialOption {
|
||||
final String id;
|
||||
final String label;
|
||||
|
||||
MaterialOption(this.id, this.label);
|
||||
}
|
||||
|
||||
class StructuralMaterialsEditPage extends StatefulWidget {
|
||||
final int tempId;
|
||||
final VoidCallback NextBtn;
|
||||
final VoidCallback PrevBtn;
|
||||
|
||||
StructuralMaterialsEditPage(this.tempId, this.NextBtn, this.PrevBtn);
|
||||
|
||||
@override
|
||||
_StructuralMaterialsEditPage createState() => _StructuralMaterialsEditPage();
|
||||
}
|
||||
|
||||
class _StructuralMaterialsEditPage extends State<StructuralMaterialsEditPage> {
|
||||
List<String> foundation = [];
|
||||
List<String> column = [];
|
||||
List<String> beam = [];
|
||||
List<String> truss_framing = [];
|
||||
List<String> roof = [];
|
||||
List<String> flooring = [];
|
||||
List<String> walls = [];
|
||||
bool foundationOthers = false;
|
||||
bool columOthers = false;
|
||||
bool beamsOthers = false;
|
||||
bool tfOthers = false;
|
||||
bool roofOthers = false;
|
||||
bool flooringOthers = false;
|
||||
bool wpOthers = false;
|
||||
|
||||
List<MaterialOption> columnOptions = [
|
||||
MaterialOption('steel', 'Steel'),
|
||||
MaterialOption('concrete', 'Reinforced Concrete'),
|
||||
MaterialOption('wood', 'Wood'),
|
||||
];
|
||||
|
||||
List<String> selectedColumnValues = [];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<StructuralMaterialBloc, StructuralMaterialState>(
|
||||
listener: (context, state) {
|
||||
if (state is StructuralMaterialsLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
|
||||
if (state is StructuralMaterialsLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
setState(() {
|
||||
foundation = state.structure.foundation!.split(',');
|
||||
column = state.structure.columns!.split(',');
|
||||
beam = state.structure.beams!.split(',');
|
||||
truss_framing = state.structure.trussFraming!.split(',');
|
||||
roof = state.structure.roof!.split(',');
|
||||
flooring = state.structure.flooring!.split(',');
|
||||
walls = state.structure.walls!.split(',');
|
||||
// Update other local state variables here if needed
|
||||
});
|
||||
}
|
||||
if (state is StructuralMaterialsErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(30.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('STRUCTURAL MATERIALS',
|
||||
style:
|
||||
TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'FOUNDATION',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: foundationOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
foundationOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: foundationOthers,
|
||||
child: customTextField(
|
||||
"Enter other foundation", "", "other_foundation"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
foundation = x;
|
||||
});
|
||||
},
|
||||
options: const ['Reinforced Concrete', 'Plain Concrete'],
|
||||
selectedValues: foundation,
|
||||
whenEmpty: 'Select Foundations',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'COLUMNS',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: columOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
columOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: columOthers,
|
||||
child: customTextField(
|
||||
"Enter other columns", "", "other_column"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
column = x;
|
||||
});
|
||||
},
|
||||
options: const ['Steel', 'Reinforced Concrete', 'Wood'],
|
||||
selectedValues: column,
|
||||
whenEmpty: 'Select Column/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'BEAMS',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: beamsOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
beamsOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: beamsOthers,
|
||||
child:
|
||||
customTextField("Enter other beam/s", "", "other_beam"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
beam = x;
|
||||
});
|
||||
},
|
||||
options: const ['Steel', 'Reinforced Concrete', 'Wood'],
|
||||
selectedValues: beam,
|
||||
whenEmpty: 'Select Beam/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'TRUSS FRAMING',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: tfOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
tfOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: tfOthers,
|
||||
child: customTextField(
|
||||
"Enter other truss framing/s", "", "other_tf"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
truss_framing = x;
|
||||
});
|
||||
},
|
||||
options: const ['Steel', 'Wood'],
|
||||
selectedValues: truss_framing,
|
||||
whenEmpty: 'Select Truss Framing/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'ROOF',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: roofOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
roofOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: roofOthers,
|
||||
child:
|
||||
customTextField("Enter other roof/s", "", "other_roof"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
roof = x;
|
||||
});
|
||||
},
|
||||
options: const [
|
||||
'Reinforced Concrete',
|
||||
'Tiles',
|
||||
'G.I Sheet',
|
||||
'Aluminum',
|
||||
'Asbestos',
|
||||
'Long Span',
|
||||
'Concrete Desk',
|
||||
'Nipa/Anahaw/Cogon'
|
||||
],
|
||||
selectedValues: roof,
|
||||
whenEmpty: 'Select Roof/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'FLOORING',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: flooringOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
flooringOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: flooringOthers,
|
||||
child: customTextField(
|
||||
"Enter other flooring/s", "", "other_flooring"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
flooring = x;
|
||||
});
|
||||
},
|
||||
options: const [
|
||||
'Reinforced Concrete',
|
||||
'Plain Cement',
|
||||
'Marble',
|
||||
'Wood',
|
||||
'Tiles'
|
||||
],
|
||||
selectedValues: flooring,
|
||||
whenEmpty: 'Select Flooring/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'WALLS & PARTITIONS',
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Others'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: wpOthers,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
wpOthers = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
child: Visibility(
|
||||
visible: wpOthers,
|
||||
child: customTextField(
|
||||
"Enter other walls & partition/s", "", "other_wp"),
|
||||
replacement: DropDownMultiSelect(
|
||||
selected_values_style: TextStyle(color: Colors.black),
|
||||
onChanged: (List<String> x) {
|
||||
setState(() {
|
||||
walls = x;
|
||||
});
|
||||
},
|
||||
options: const [
|
||||
'Reinforced Concrete',
|
||||
'Plain Concrete',
|
||||
'Wood',
|
||||
'CHIB',
|
||||
'G.I Sheet',
|
||||
'Build-a-wall',
|
||||
'Sawali',
|
||||
'Bamboo'
|
||||
],
|
||||
selectedValues: walls,
|
||||
whenEmpty: 'Select Walls & Partition/s',
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.NextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () async {
|
||||
{
|
||||
final tempID = await SharedPreferences.getInstance();
|
||||
var strucMaterials = StructureMaterialsII(
|
||||
id: tempID.getInt('tempid')! - 1,
|
||||
foundation: foundationOthers
|
||||
? formKey
|
||||
.currentState!.value['other_foundation']
|
||||
.split(',')
|
||||
: foundation,
|
||||
columns: columOthers
|
||||
? formKey.currentState!.value['other_column']
|
||||
.split(',')
|
||||
: column,
|
||||
beams: beamsOthers
|
||||
? formKey.currentState!.value['other_beam']
|
||||
.split(',')
|
||||
: beam,
|
||||
trussFraming: tfOthers
|
||||
? formKey.currentState!.value['other_tf']
|
||||
.split(',')
|
||||
: truss_framing,
|
||||
roof: roofOthers
|
||||
? formKey.currentState!.value['other_roof']
|
||||
.split(',')
|
||||
: roof,
|
||||
flooring: flooringOthers
|
||||
? formKey
|
||||
.currentState!.value['other_flooring']
|
||||
.split(',')
|
||||
: flooring,
|
||||
walls: wpOthers
|
||||
? formKey.currentState!.value['other_wp']
|
||||
.split(',')
|
||||
: walls,
|
||||
others: ["Others"]);
|
||||
context.read<PropertyInfoBloc>()
|
||||
..add(UpdateStrucMaterials(data: strucMaterials));
|
||||
|
||||
widget.PrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class PropertyOwnerPage extends StatefulWidget {
|
||||
@override
|
||||
_PropertyOwnerPage createState() => _PropertyOwnerPage();
|
||||
}
|
||||
|
||||
class _PropertyOwnerPage extends State<PropertyOwnerPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(body: Container());
|
||||
}
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
|
||||
import 'package:im_stepper/stepper.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land/land_appraisal.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land/location_and_boundaries.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land/other_improvements.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land/property_assessment.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land/property_assessment_cont.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land/property_owner_info.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land/value_adjustments.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
GlobalKey<FormBuilderState> landKey = GlobalKey<FormBuilderState>();
|
||||
|
||||
class AddLand extends StatefulWidget {
|
||||
@override
|
||||
_AddLand createState() => _AddLand();
|
||||
}
|
||||
|
||||
class _AddLand extends State<AddLand> {
|
||||
// THE FOLLOWING TWO VARIABLES ARE REQUIRED TO CONTROL THE STEPPER.
|
||||
int activeStep = 0; // Initial step set to 5.
|
||||
|
||||
int upperBound = 6; // upperBound MUST BE total number of icons minus 1.
|
||||
|
||||
void PrevBtn() {
|
||||
setState(() {
|
||||
activeStep--;
|
||||
});
|
||||
}
|
||||
|
||||
void NextBtn() {
|
||||
setState(() {
|
||||
activeStep++;
|
||||
});
|
||||
}
|
||||
|
||||
void onSAveAll() {
|
||||
return Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
backgroundColor: primary,
|
||||
title: const Text('Land FAAS'),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
NumberStepper(
|
||||
numbers: const [1, 2, 3, 4, 5, 6, 7],
|
||||
activeStepColor: primary,
|
||||
numberStyle: const TextStyle(color: Colors.white),
|
||||
lineColor: primary,
|
||||
// activeStep property set to activeStep variable defined above.
|
||||
activeStep: activeStep,
|
||||
activeStepBorderColor: Colors.white,
|
||||
activeStepBorderWidth: 1,
|
||||
// This ensures step-tapping updates the activeStep.
|
||||
onStepReached: (index) {
|
||||
setState(() {
|
||||
activeStep = index;
|
||||
});
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: FormBuilder(
|
||||
key: landKey,
|
||||
|
||||
// enabled: false,
|
||||
onChanged: () {
|
||||
landKey.currentState?.save();
|
||||
|
||||
print(landKey.currentState?.value.toString());
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
skipDisabled: true,
|
||||
child: Container(
|
||||
child: content(PrevBtn, NextBtn, onSAveAll),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Returns the next button.
|
||||
|
||||
// Returns the content widget based on the activeStep.
|
||||
Widget content(PrevBtn, NextBtn, onSAveAll) {
|
||||
switch (activeStep) {
|
||||
case 0:
|
||||
return LandPropertyOwnerInfo(NextBtn);
|
||||
case 1:
|
||||
return LandLocationAndBoundaries(PrevBtn, NextBtn);
|
||||
case 2:
|
||||
return LandAppraisal(PrevBtn, NextBtn);
|
||||
case 3:
|
||||
return OtherImprovementPage(PrevBtn, NextBtn);
|
||||
case 4:
|
||||
return ValueAdjustmentPage(PrevBtn, NextBtn);
|
||||
case 5:
|
||||
return LandPropertyAssessmentPage(PrevBtn, NextBtn);
|
||||
case 6:
|
||||
return LandSignatories(onSAveAll);
|
||||
|
||||
default:
|
||||
return LandPropertyOwnerInfo(NextBtn);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,448 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:searchfield/searchfield.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/additional_item/additional_item_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_appraisal/land_appraisal_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_classification/land_classification_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_subclassification/land_subclassification_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/municipality/municipality_bloc.dart';
|
||||
import 'package:unit2/model/passo/additional_items.dart';
|
||||
import 'package:unit2/model/passo/city.dart';
|
||||
import 'package:unit2/model/passo/class_components.dart';
|
||||
import 'package:unit2/model/passo/land_appr.dart';
|
||||
import 'package:unit2/model/passo/land_classification.dart';
|
||||
import 'package:unit2/model/passo/land_subclassification.dart';
|
||||
import 'package:unit2/model/passo/unit_construct.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
class AddLandAppraisalModal extends StatefulWidget {
|
||||
// final List<UnitConstruct> unit;
|
||||
// final List<ClassComponents> options;
|
||||
// final int tempId;
|
||||
|
||||
// AddLandAppraisalModal(this.unit, this.options, this.tempId);
|
||||
|
||||
@override
|
||||
_AddLandAppraisalModal createState() => _AddLandAppraisalModal();
|
||||
}
|
||||
|
||||
class _AddLandAppraisalModal extends State<AddLandAppraisalModal> {
|
||||
final focus = FocusNode();
|
||||
bool isPainted = false;
|
||||
bool isSecondHand = false;
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
double _unitBase = 0;
|
||||
int _areaValue = 0;
|
||||
final double _depValue = 0;
|
||||
double _unitValue = 0;
|
||||
String _subClassDesc = "";
|
||||
int _classId = 0;
|
||||
String _structureType = "";
|
||||
bool _withoutBUCC = false;
|
||||
int _notPaintedUnitVal = 0;
|
||||
int _secondHandUnitVal = 0;
|
||||
String cityCode = '';
|
||||
String cityDesc = '';
|
||||
int classCode = 1;
|
||||
String _classDesc = '';
|
||||
|
||||
GlobalKey<FormBuilderState> appraisalLandKey = GlobalKey<FormBuilderState>();
|
||||
|
||||
BoxDecoration box1() {
|
||||
return const BoxDecoration(boxShadow: [
|
||||
BoxShadow(color: Colors.black12, spreadRadius: 5, blurRadius: 5)
|
||||
], color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(3)));
|
||||
}
|
||||
|
||||
double _amountofDepreciation(unitVal, unitBase, area, depreciation) {
|
||||
return ((unitVal * unitBase) * area) * depreciation;
|
||||
}
|
||||
|
||||
double _totalMarketValue(unitBase, area) {
|
||||
return unitBase * area;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<LandAppraisalBloc, LandAppraisalState>(
|
||||
buildWhen: (previous, current) {
|
||||
return false;
|
||||
}, builder: (context, state) {
|
||||
if (state is ShowAddLandAppraisalScreen) {
|
||||
return BlocConsumer<LandClassificationBloc, LandClassificationState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is LandClassificationLoaded) {
|
||||
final classification = state.land_classification;
|
||||
return BlocConsumer<LandSubClassificationBloc,
|
||||
LandSubClassificationState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is LandSubClassificationLoaded) {
|
||||
final subclassification = state.land_subclassification;
|
||||
return BlocConsumer<MunicipalityBloc, MunicipalityState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is MunicipalityLoaded) {
|
||||
return FormBuilder(
|
||||
key: appraisalLandKey,
|
||||
onChanged: () {
|
||||
appraisalLandKey.currentState?.save();
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 10,
|
||||
right: 0,
|
||||
bottom: 0),
|
||||
child: Expanded(
|
||||
flex: 1,
|
||||
child:
|
||||
FormBuilderDropdown<City>(
|
||||
name:
|
||||
'appraisal_municipality',
|
||||
autofocus: false,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
cityDesc ??
|
||||
"Municipality",
|
||||
""),
|
||||
items: state.municipality
|
||||
.map((municipality) =>
|
||||
DropdownMenuItem<
|
||||
City>(
|
||||
value: municipality,
|
||||
child: Text(municipality
|
||||
.cityDescription!), // Use cityDescription instead of cityName
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (selectedCity) {
|
||||
if (selectedCity != null) {
|
||||
final selectedCityCode =
|
||||
selectedCity.cityCode;
|
||||
setState(() {
|
||||
cityCode =
|
||||
selectedCityCode!;
|
||||
cityDesc = selectedCity
|
||||
.cityDescription!;
|
||||
});
|
||||
final barangayBloc =
|
||||
context.read<
|
||||
LandSubClassificationBloc>();
|
||||
barangayBloc.add(
|
||||
LoadLandSubClassification(
|
||||
classCode:
|
||||
classCode!,
|
||||
cityCode:
|
||||
selectedCityCode!)); // Use selectedCityCode directly
|
||||
}
|
||||
},
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 10,
|
||||
right: 0,
|
||||
bottom: 0),
|
||||
child: Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderDropdown<
|
||||
LandClassification>(
|
||||
name: 'classification',
|
||||
autofocus: false,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
_classDesc
|
||||
.toString() ??
|
||||
"Classification",
|
||||
""),
|
||||
items: classification
|
||||
.map((classification) =>
|
||||
DropdownMenuItem<
|
||||
LandClassification>(
|
||||
value:
|
||||
classification,
|
||||
child: Text(
|
||||
classification
|
||||
.description!), // Use cityDescription instead of cityName
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (selectedClass) {
|
||||
if (selectedClass != null) {
|
||||
final selectedClassCode =
|
||||
selectedClass.id;
|
||||
setState(() {
|
||||
classCode =
|
||||
selectedClassCode!;
|
||||
_classDesc =
|
||||
selectedClass
|
||||
.description!;
|
||||
});
|
||||
final barangayBloc =
|
||||
context.read<
|
||||
LandSubClassificationBloc>();
|
||||
barangayBloc.add(
|
||||
LoadLandSubClassification(
|
||||
classCode:
|
||||
selectedClassCode!,
|
||||
cityCode:
|
||||
cityCode)); // Use selectedCityCode directly
|
||||
}
|
||||
},
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 10,
|
||||
right: 0,
|
||||
bottom: 0),
|
||||
child: SizedBox(
|
||||
height: 45,
|
||||
child: SearchField(
|
||||
itemHeight: 70,
|
||||
suggestions: subclassification
|
||||
.map((LandSubClassification
|
||||
subclass) =>
|
||||
SearchFieldListItem(
|
||||
'${subclass.subclassCode} - ${subclass.subclassDescription}',
|
||||
item: subclass,
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
'${subclass.subclassCode} - ${subclass.subclassDescription!.toUpperCase()}',
|
||||
overflow:
|
||||
TextOverflow
|
||||
.ellipsis,
|
||||
),
|
||||
)))
|
||||
.toList(),
|
||||
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle(
|
||||
"Structure Type",
|
||||
"")
|
||||
.copyWith(
|
||||
suffixIcon:
|
||||
const Icon(Icons
|
||||
.arrow_drop_down)),
|
||||
////agency suggestion tap
|
||||
focusNode: focus,
|
||||
suggestionState:
|
||||
Suggestion.expand,
|
||||
onSuggestionTap: (subclass) {
|
||||
setState(() {
|
||||
_unitBase = double.parse(
|
||||
subclass.item!
|
||||
.baseUnitMarketval!);
|
||||
_subClassDesc =
|
||||
'${subclass.item!.subclassCode} - ${subclass.item!.subclassDescription}';
|
||||
});
|
||||
focus.unfocus();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
FormBuilderTextField(
|
||||
name: 'land_appraisal_area',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Area", ""),
|
||||
validator:
|
||||
FormBuilderValidators.compose(
|
||||
[]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_areaValue = int.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱")
|
||||
.format(
|
||||
_totalMarketValue(
|
||||
_unitBase,
|
||||
_areaValue)))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
final tempID =
|
||||
await SharedPreferences
|
||||
.getInstance();
|
||||
print(tempID
|
||||
.getInt('landid'));
|
||||
var land_appraisal = LandAppr(
|
||||
landapprDetailsId:
|
||||
tempID.getInt(
|
||||
'landid')! -
|
||||
1,
|
||||
classification:
|
||||
_classDesc,
|
||||
subClass: _subClassDesc,
|
||||
area: _areaValue
|
||||
.toString(),
|
||||
unitValue: _unitBase
|
||||
.toString(),
|
||||
baseMarketval:
|
||||
_totalMarketValue(
|
||||
_unitBase,
|
||||
_areaValue)
|
||||
.toString());
|
||||
|
||||
context
|
||||
.read<
|
||||
LandAppraisalBloc>()
|
||||
.add(AddLandAppraisal(
|
||||
land_appr:
|
||||
land_appraisal));
|
||||
},
|
||||
style:
|
||||
ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Submit"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width:
|
||||
5), // Use SizedBox for horizontal spacing in a Row
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
.read<
|
||||
LandAppraisalBloc>()
|
||||
.add(
|
||||
const LoadLandAppraisal());
|
||||
},
|
||||
style:
|
||||
ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Cancel"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
if (state is MunicipalityErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<MunicipalityBloc>()
|
||||
.add(LoadMunicipality());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is LandSubClassificationErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<LandSubClassificationBloc>().add(
|
||||
const LoadLandSubClassification(
|
||||
cityCode: '1', classCode: 1));
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is LandClassificationErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<LandClassificationBloc>()
|
||||
.add(LoadLandClassification());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is LandAppraisalErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<LandAppraisalBloc>().add(LoadLandAppraisal());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,527 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_appraisal/land_appraisal_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_value_adjustments/land_value_adjustments_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/type_of_location/type_of_location_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/type_of_road/type_of_road_bloc.dart';
|
||||
import 'package:unit2/model/passo/land_appr.dart';
|
||||
import 'package:unit2/model/passo/land_value_adjustment.dart';
|
||||
import 'package:unit2/model/passo/type_of_location.dart';
|
||||
import 'package:unit2/model/passo/type_of_road.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
|
||||
class AddLandValueAdjustmentModal extends StatefulWidget {
|
||||
// final List<UnitConstruct> unit;
|
||||
// final List<ClassComponents> options;
|
||||
// final int tempId;
|
||||
|
||||
// AddLandAppraisalModal(this.unit, this.options, this.tempId);
|
||||
|
||||
@override
|
||||
_AddLandValueAdjustmentModal createState() => _AddLandValueAdjustmentModal();
|
||||
}
|
||||
|
||||
class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
||||
final focus = FocusNode();
|
||||
bool isPainted = false;
|
||||
bool isSecondHand = false;
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
double _unitBase = 0;
|
||||
int _areaValue = 0;
|
||||
final double _depValue = 0;
|
||||
double _unitValue = 0;
|
||||
String _subClassDesc = "";
|
||||
int _classId = 0;
|
||||
String _structureType = "";
|
||||
int _notPaintedUnitVal = 0;
|
||||
int _secondHandUnitVal = 0;
|
||||
String cityCode = '';
|
||||
String cityDesc = '';
|
||||
int classCode = 1;
|
||||
String _classDesc = '';
|
||||
String _treeType = "";
|
||||
bool _nonfruitBearing = false;
|
||||
bool _fruitBearing = false;
|
||||
int qty = 0;
|
||||
int pr_qty = 0;
|
||||
int nonpr_qty = 0;
|
||||
double _roadTypeDeduction = 0;
|
||||
double _locTypeRoad = 0;
|
||||
double _locTypePob = 0;
|
||||
String _roadType = '';
|
||||
String _distance = '';
|
||||
String _locRdDistance = '';
|
||||
String _locPobDistance = '';
|
||||
|
||||
GlobalKey<FormBuilderState> otherImpKey = GlobalKey<FormBuilderState>();
|
||||
|
||||
_calculateBaseMarketValue() {
|
||||
double base = 0.00;
|
||||
if (_fruitBearing) {
|
||||
base = (pr_qty + nonpr_qty) * _unitValue;
|
||||
} else {
|
||||
base = qty * _unitValue;
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
double calculateAdjustment() {
|
||||
double adjustment = 0;
|
||||
|
||||
if (_locPobDistance == '0 TO 1') {
|
||||
adjustment = _locTypePob - (_roadTypeDeduction + _locTypeRoad);
|
||||
} else {
|
||||
adjustment = (_roadTypeDeduction + _locTypeRoad + _locTypePob) * -1;
|
||||
}
|
||||
|
||||
return adjustment;
|
||||
}
|
||||
|
||||
double calculateValueAdjustment() {
|
||||
double adjustment = calculateAdjustment();
|
||||
double valueAdjustment = _unitValue * adjustment;
|
||||
|
||||
return valueAdjustment;
|
||||
}
|
||||
|
||||
double calculateMarketValue() {
|
||||
double marketValue = 0;
|
||||
|
||||
marketValue = _unitValue + calculateValueAdjustment(); // Adding adjustment
|
||||
|
||||
return marketValue;
|
||||
}
|
||||
|
||||
BoxDecoration box1() {
|
||||
return const BoxDecoration(boxShadow: [
|
||||
BoxShadow(color: Colors.black12, spreadRadius: 5, blurRadius: 5)
|
||||
], color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(3)));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocBuilder<LandValueAdjustmentsBloc, LandValueAdjustmentsState>(
|
||||
buildWhen: (previous, current) {
|
||||
return false;
|
||||
}, builder: (context, state) {
|
||||
if (state is ShowAddLandValueAdjustmentsScreen) {
|
||||
return BlocConsumer<LandAppraisalBloc, LandAppraisalState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
}, builder: (context, state) {
|
||||
if (state is LandAppraisalLoaded) {
|
||||
final land_appr = state.land_appr;
|
||||
return BlocConsumer<TypeOfRoadBloc, TypeOfRoadState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is TypeOfRoadLoaded) {
|
||||
final roadType = state.road_type;
|
||||
return BlocConsumer<TypeOfLocationBloc,
|
||||
TypeOfLocationState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is TypeOfLocationLoaded) {
|
||||
return FormBuilder(
|
||||
key: otherImpKey,
|
||||
onChanged: () {
|
||||
otherImpKey.currentState?.save();
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 10,
|
||||
right: 0,
|
||||
bottom: 0),
|
||||
child: Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderDropdown<
|
||||
LandAppr?>(
|
||||
name: 'land_appr_item',
|
||||
autofocus: false,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Land Appraisal Items",
|
||||
""),
|
||||
items: land_appr
|
||||
.map((land_appr) =>
|
||||
DropdownMenuItem<
|
||||
LandAppr?>(
|
||||
value: land_appr,
|
||||
child: Text((land_appr
|
||||
.subClass ??
|
||||
"")),
|
||||
))
|
||||
.toList(),
|
||||
onChanged:
|
||||
(selectedLandAppr) {
|
||||
if (selectedLandAppr !=
|
||||
null) {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
selectedLandAppr
|
||||
.baseMarketval!);
|
||||
});
|
||||
}
|
||||
},
|
||||
)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text("Adjustment Factors"),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 10,
|
||||
right: 0,
|
||||
bottom: 0),
|
||||
child: Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderDropdown<
|
||||
TypeOfRoad?>(
|
||||
name: 'road_type',
|
||||
autofocus: false,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Type of Road", ""),
|
||||
items: roadType
|
||||
.map((roadType) =>
|
||||
DropdownMenuItem<
|
||||
TypeOfRoad?>(
|
||||
value: roadType,
|
||||
child: Text((roadType
|
||||
.roadType ??
|
||||
"")),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (selectedRoad) {
|
||||
if (selectedRoad != null) {
|
||||
setState(() {
|
||||
_roadTypeDeduction =
|
||||
double.parse(
|
||||
selectedRoad
|
||||
.deduction!);
|
||||
_roadType = selectedRoad
|
||||
.roadType!;
|
||||
});
|
||||
}
|
||||
},
|
||||
)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text("Type of Location"),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 10,
|
||||
right: 0,
|
||||
bottom: 0),
|
||||
child: Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderDropdown<
|
||||
TypeOfLocation?>(
|
||||
name: 'loc_type_road',
|
||||
autofocus: false,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Distance to Road",
|
||||
""),
|
||||
items: state.loc_type
|
||||
.map((locTypeRoad) =>
|
||||
DropdownMenuItem<
|
||||
TypeOfLocation?>(
|
||||
value: locTypeRoad,
|
||||
child: Text((locTypeRoad
|
||||
.distanceKm ??
|
||||
"")),
|
||||
))
|
||||
.toList(),
|
||||
onChanged:
|
||||
(selectedLoadRoad) {
|
||||
if (selectedLoadRoad !=
|
||||
null) {
|
||||
setState(() {
|
||||
_locTypeRoad = double
|
||||
.parse(selectedLoadRoad
|
||||
.allRoadTypes!);
|
||||
_locRdDistance =
|
||||
selectedLoadRoad
|
||||
.distanceKm!;
|
||||
});
|
||||
}
|
||||
},
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 10,
|
||||
right: 0,
|
||||
bottom: 0),
|
||||
child: Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderDropdown<
|
||||
TypeOfLocation?>(
|
||||
name: 'loc_type_pob',
|
||||
autofocus: false,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Distance to Poblacion",
|
||||
""),
|
||||
items: state.loc_type
|
||||
.map((locTypePob) =>
|
||||
DropdownMenuItem<
|
||||
TypeOfLocation?>(
|
||||
value: locTypePob,
|
||||
child: Text((locTypePob
|
||||
.distanceKm ??
|
||||
"")),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (selectedLocPob) {
|
||||
if (selectedLocPob !=
|
||||
null) {
|
||||
setState(() {
|
||||
_locTypePob = double
|
||||
.parse(selectedLocPob
|
||||
.localTradingCenter!);
|
||||
|
||||
_locPobDistance =
|
||||
selectedLocPob
|
||||
.distanceKm!;
|
||||
});
|
||||
}
|
||||
},
|
||||
)),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
(calculateAdjustment() * 100)
|
||||
.toString() +
|
||||
'%'),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱",
|
||||
).format(
|
||||
calculateValueAdjustment())),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱",
|
||||
).format(calculateMarketValue())),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
final tempID =
|
||||
await SharedPreferences
|
||||
.getInstance();
|
||||
print(tempID
|
||||
.getInt('landid'));
|
||||
var adjustments = ValueAdjustments(
|
||||
landapprDetailsId:
|
||||
tempID.getInt(
|
||||
'landid')! -
|
||||
1,
|
||||
baseMarketval:
|
||||
_unitValue
|
||||
.toString(),
|
||||
adjustmentFactors: _roadType +
|
||||
' , ' +
|
||||
_locPobDistance +
|
||||
' km from road , ' +
|
||||
_locPobDistance +
|
||||
' km from poblacion',
|
||||
adjustment:
|
||||
calculateAdjustment()
|
||||
.toString(),
|
||||
valueAdjustment:
|
||||
calculateValueAdjustment()
|
||||
.toString(),
|
||||
marketValue:
|
||||
calculateMarketValue()
|
||||
.toString());
|
||||
|
||||
context
|
||||
.read<
|
||||
LandValueAdjustmentsBloc>()
|
||||
.add(AddLandValueAdjustments(
|
||||
val_adj:
|
||||
adjustments));
|
||||
},
|
||||
style:
|
||||
ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Submit"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width:
|
||||
5), // Use SizedBox for horizontal spacing in a Row
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
.read<
|
||||
LandValueAdjustmentsBloc>()
|
||||
.add(
|
||||
const LoadLandValueAdjustments());
|
||||
},
|
||||
style:
|
||||
ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Cancel"),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
if (state is TypeOfLocationErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<TypeOfLocationBloc>()
|
||||
.add(LoadTypeOfLocation());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is LandAppraisalErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<LandAppraisalBloc>()
|
||||
.add(LoadLandAppraisal());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is LandValueAdjustmentsErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<LandValueAdjustmentsBloc>()
|
||||
.add(LoadLandValueAdjustments());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
if (state is LandValueAdjustmentsErrorState) {
|
||||
return Text(state.error);
|
||||
}
|
||||
return Container(
|
||||
child: Text("Land Value Adjustment"),
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,359 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_trees_improvements/land_trees_improvements_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/other_improvements/other_improvements_bloc.dart';
|
||||
import 'package:unit2/model/passo/other_improvements.dart';
|
||||
import 'package:unit2/model/passo/trees_improvements.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
|
||||
class AddOtherImprovementModal extends StatefulWidget {
|
||||
// final List<UnitConstruct> unit;
|
||||
// final List<ClassComponents> options;
|
||||
// final int tempId;
|
||||
|
||||
// AddLandAppraisalModal(this.unit, this.options, this.tempId);
|
||||
|
||||
@override
|
||||
_AddOtherImprovementModal createState() => _AddOtherImprovementModal();
|
||||
}
|
||||
|
||||
class _AddOtherImprovementModal extends State<AddOtherImprovementModal> {
|
||||
final focus = FocusNode();
|
||||
bool isPainted = false;
|
||||
bool isSecondHand = false;
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
double _unitBase = 0;
|
||||
int _areaValue = 0;
|
||||
final double _depValue = 0;
|
||||
double _unitValue = 0;
|
||||
String _subClassDesc = "";
|
||||
int _classId = 0;
|
||||
String _structureType = "";
|
||||
int _notPaintedUnitVal = 0;
|
||||
int _secondHandUnitVal = 0;
|
||||
String cityCode = '';
|
||||
String cityDesc = '';
|
||||
int classCode = 1;
|
||||
String _classDesc = '';
|
||||
String _treeType = "";
|
||||
bool _nonfruitBearing = false;
|
||||
bool _fruitBearing = false;
|
||||
int qty = 0;
|
||||
int pr_qty = 0;
|
||||
int nonpr_qty = 0;
|
||||
|
||||
GlobalKey<FormBuilderState> otherImpKey = GlobalKey<FormBuilderState>();
|
||||
|
||||
final typeOfTree = [
|
||||
"Non-Fruit Bearing",
|
||||
"Fruit Bearing",
|
||||
];
|
||||
|
||||
_calculateBaseMarketValue() {
|
||||
double base = 0.00;
|
||||
if (_fruitBearing) {
|
||||
base = (pr_qty + nonpr_qty) * _unitValue;
|
||||
} else {
|
||||
base = qty * _unitValue;
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
BoxDecoration box1() {
|
||||
return const BoxDecoration(boxShadow: [
|
||||
BoxShadow(color: Colors.black12, spreadRadius: 5, blurRadius: 5)
|
||||
], color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(3)));
|
||||
}
|
||||
|
||||
double _amountofDepreciation(unitVal, unitBase, area, depreciation) {
|
||||
return ((unitVal * unitBase) * area) * depreciation;
|
||||
}
|
||||
|
||||
double _totalMarketValue(unitBase, area) {
|
||||
return unitBase * area;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<OtherImprovementsBloc, OtherImprovementsState>(
|
||||
buildWhen: (previous, current) {
|
||||
return false;
|
||||
}, builder: (context, state) {
|
||||
if (state is ShowAddOtherImprovementScreen) {
|
||||
return BlocConsumer<LandTreesImprovementsBloc,
|
||||
LandTreesImprovementsState>(listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
}, builder: (context, state) {
|
||||
if (state is LandTreesImprovementsLoaded) {
|
||||
final trees = state.trees_imp;
|
||||
return FormBuilder(
|
||||
key: otherImpKey,
|
||||
onChanged: () {
|
||||
otherImpKey.currentState?.save();
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 10, right: 0, bottom: 0),
|
||||
child: Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderDropdown<TreesImprovements>(
|
||||
name: 'kinds_of_trees',
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Kinds of Trees", ""),
|
||||
items: state.trees_imp
|
||||
.map((trees) =>
|
||||
DropdownMenuItem<TreesImprovements>(
|
||||
value: trees,
|
||||
child: Text(
|
||||
(trees.improvement ?? "") +
|
||||
" " +
|
||||
(trees.subclassCode ?? ""),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (selectedTree) {
|
||||
if (selectedTree != null) {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
selectedTree.pricePerTree!);
|
||||
_treeType = selectedTree.improvement!;
|
||||
});
|
||||
}
|
||||
},
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: _fruitBearing,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
_fruitBearing = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
Text('Fruit Bearing ?'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !_fruitBearing,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: FormBuilderTextField(
|
||||
name: 'subClass',
|
||||
decoration: normalTextFieldStyle(
|
||||
"SubClass/Age", ""),
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_subClassDesc = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: FormBuilderTextField(
|
||||
name: 'qty',
|
||||
decoration: normalTextFieldStyle("No.", ""),
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
qty = int.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
replacement: Column(
|
||||
children: [
|
||||
FormBuilderTextField(
|
||||
name: 'no_of_productive',
|
||||
decoration: normalTextFieldStyle(
|
||||
"No. of Productive", ""),
|
||||
validator: FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
pr_qty = int.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
FormBuilderTextField(
|
||||
name: 'no_of_nonproductive',
|
||||
decoration: normalTextFieldStyle(
|
||||
"No. of Non-Productive", ""),
|
||||
validator: FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
nonpr_qty = int.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(_unitValue))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Base Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱",
|
||||
).format(_calculateBaseMarketValue().toString() ==
|
||||
"0.00"
|
||||
? "00.0"
|
||||
: _calculateBaseMarketValue())),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
final tempID =
|
||||
await SharedPreferences.getInstance();
|
||||
print(tempID.getInt('landid'));
|
||||
var improvement = OtherImprovements(
|
||||
landapprDetailsId:
|
||||
tempID.getInt('landid')! - 1,
|
||||
kindsOfTrees: _treeType,
|
||||
subclassAge: _subClassDesc,
|
||||
quantity: qty,
|
||||
unitValue: _unitValue.toString(),
|
||||
baseMarketval:
|
||||
_calculateBaseMarketValue()
|
||||
.toString(),
|
||||
noOfProductive: pr_qty,
|
||||
noOfNonproductive: nonpr_qty,
|
||||
fruitBearing:
|
||||
_fruitBearing == true ? '1' : '0');
|
||||
|
||||
context.read<OtherImprovementsBloc>().add(
|
||||
AddOtherImprovement(
|
||||
other_imp: improvement));
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Submit"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width:
|
||||
5), // Use SizedBox for horizontal spacing in a Row
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
.read<OtherImprovementsBloc>()
|
||||
.add(const LoadOtherImprovement());
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Cancel"),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
if (state is LandTreesImprovementsErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<LandTreesImprovementsBloc>()
|
||||
.add(LoadLandTreesImprovements());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
if (state is OtherImprovementErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<OtherImprovementsBloc>().add(LoadOtherImprovement());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,352 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_property_assessment/land_property_assessment_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_value_adjustments/land_value_adjustments_bloc.dart';
|
||||
import 'package:unit2/model/passo/land_property_assessment.dart';
|
||||
import 'package:unit2/model/passo/land_value_adjustment.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
|
||||
class AddPropertyAssessmentModal extends StatefulWidget {
|
||||
// final List<UnitConstruct> unit;
|
||||
// final List<ClassComponents> options;
|
||||
// final int tempId;
|
||||
|
||||
// AddLandAppraisalModal(this.unit, this.options, this.tempId);
|
||||
|
||||
@override
|
||||
_AddPropertyAssessmentModal createState() => _AddPropertyAssessmentModal();
|
||||
}
|
||||
|
||||
class _AddPropertyAssessmentModal extends State<AddPropertyAssessmentModal> {
|
||||
final focus = FocusNode();
|
||||
bool isPainted = false;
|
||||
bool isSecondHand = false;
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
double _unitBase = 0;
|
||||
int _areaValue = 0;
|
||||
final double _depValue = 0;
|
||||
double _unitValue = 0;
|
||||
String _subClassDesc = "";
|
||||
int _classId = 0;
|
||||
String _structureType = "";
|
||||
int _notPaintedUnitVal = 0;
|
||||
int _secondHandUnitVal = 0;
|
||||
String cityCode = '';
|
||||
String cityDesc = '';
|
||||
int classCode = 1;
|
||||
String _classDesc = '';
|
||||
String _treeType = "";
|
||||
bool _nonfruitBearing = false;
|
||||
bool _fruitBearing = false;
|
||||
int qty = 0;
|
||||
int pr_qty = 0;
|
||||
int nonpr_qty = 0;
|
||||
String _actualUse = "Residential";
|
||||
String _assessmentLevel = "";
|
||||
|
||||
GlobalKey<FormBuilderState> assessmentKey = GlobalKey<FormBuilderState>();
|
||||
|
||||
final typeOfTree = [
|
||||
"Non-Fruit Bearing",
|
||||
"Fruit Bearing",
|
||||
];
|
||||
|
||||
final actual_use = [
|
||||
"Residential",
|
||||
"Agricultural",
|
||||
"Commercial",
|
||||
"Industrial",
|
||||
"Mineral",
|
||||
"Timberland",
|
||||
];
|
||||
|
||||
calculateAssessmentValue() {
|
||||
switch (_actualUse) {
|
||||
case "Residential":
|
||||
return (_unitValue * 0.20).ceil();
|
||||
case "Agricultural":
|
||||
return (_unitValue * 0.40).ceil();
|
||||
case "Commercial":
|
||||
return (_unitValue * 0.50).ceil();
|
||||
case "Industrial":
|
||||
return (_unitValue * 0.50).ceil();
|
||||
case "Mineral":
|
||||
return (_unitValue * 0.50).ceil();
|
||||
case "Timberland":
|
||||
return (_unitValue * 0.20).ceil();
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
BoxDecoration box1() {
|
||||
return const BoxDecoration(boxShadow: [
|
||||
BoxShadow(color: Colors.black12, spreadRadius: 5, blurRadius: 5)
|
||||
], color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(3)));
|
||||
}
|
||||
|
||||
double _amountofDepreciation(unitVal, unitBase, area, depreciation) {
|
||||
return ((unitVal * unitBase) * area) * depreciation;
|
||||
}
|
||||
|
||||
double _totalMarketValue(unitBase, area) {
|
||||
return unitBase * area;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<LandPropertyAssessmentBloc, LandPropertyAssessmentState>(
|
||||
buildWhen: (previous, current) {
|
||||
return false;
|
||||
}, builder: (context, state) {
|
||||
if (state is ShowAddLandPropertyAssessmentScreen) {
|
||||
return BlocConsumer<LandValueAdjustmentsBloc,
|
||||
LandValueAdjustmentsState>(listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
}, builder: (context, state) {
|
||||
if (state is LandValueAdjustmentsLoaded) {
|
||||
final assessment = state.val_adj;
|
||||
return FormBuilder(
|
||||
key: assessmentKey,
|
||||
onChanged: () {
|
||||
assessmentKey.currentState?.save();
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 10, right: 0, bottom: 0),
|
||||
child: Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderDropdown<ValueAdjustments>(
|
||||
name: 'value_adjustments',
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Value Adjustments", ""),
|
||||
items: state.val_adj
|
||||
.map((adj) =>
|
||||
DropdownMenuItem<ValueAdjustments>(
|
||||
value: adj,
|
||||
child: Text(
|
||||
(adj.adjustmentFactors ?? ""),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (selectedAdj) {
|
||||
if (selectedAdj != null) {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
selectedAdj.marketValue!);
|
||||
});
|
||||
}
|
||||
},
|
||||
)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
FormBuilderDropdown<String?>(
|
||||
name: "land_actual_use",
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle("Actual Use", ""),
|
||||
items: actual_use
|
||||
.map((item) => DropdownMenuItem(
|
||||
value: item,
|
||||
child: Text(item),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_actualUse = value!;
|
||||
|
||||
switch (value) {
|
||||
case "Residential":
|
||||
setState(() {
|
||||
_assessmentLevel = '20';
|
||||
});
|
||||
|
||||
break;
|
||||
case "Agricultural":
|
||||
setState(() {
|
||||
_assessmentLevel = '40';
|
||||
});
|
||||
|
||||
break;
|
||||
case "Commercial":
|
||||
setState(() {
|
||||
_assessmentLevel = '50';
|
||||
});
|
||||
|
||||
break;
|
||||
case "Industrial":
|
||||
setState(() {
|
||||
_assessmentLevel = '50';
|
||||
});
|
||||
|
||||
break;
|
||||
case "Mineral":
|
||||
setState(() {
|
||||
_assessmentLevel = '50';
|
||||
});
|
||||
|
||||
break;
|
||||
case "Timberland":
|
||||
setState(() {
|
||||
_assessmentLevel = '20';
|
||||
});
|
||||
|
||||
break;
|
||||
default:
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text('Assessment Level'),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(_assessmentLevel + '%'),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text('Assessment Value'),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱",
|
||||
).format(calculateAssessmentValue().toString() ==
|
||||
"0.00"
|
||||
? "00.0"
|
||||
: calculateAssessmentValue())),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
final tempID =
|
||||
await SharedPreferences.getInstance();
|
||||
print(tempID.getInt('landid')! - 1);
|
||||
var assessment = LandPropertyAssessment(
|
||||
landapprDetailsId:
|
||||
tempID.getInt('landid')! - 1,
|
||||
actualUse: _actualUse,
|
||||
marketval: _unitValue.toString(),
|
||||
assessmentLevel: _assessmentLevel,
|
||||
assessedValue:
|
||||
calculateAssessmentValue()
|
||||
.toString(),
|
||||
totalMarketval: '0',
|
||||
totalAssessedval: '0');
|
||||
|
||||
context
|
||||
.read<LandPropertyAssessmentBloc>()
|
||||
.add(AddLandPropertyAssessment(
|
||||
assessment: assessment));
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Submit"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width:
|
||||
5), // Use SizedBox for horizontal spacing in a Row
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
.read<LandPropertyAssessmentBloc>()
|
||||
.add(
|
||||
const LoadLandPropertyAssessment());
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Cancel"),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
if (state is LandValueAdjustmentsErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<LandValueAdjustmentsBloc>()
|
||||
.add(const LoadLandValueAdjustments());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
if (state is LandPropertyAssessmentErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<LandPropertyAssessmentBloc>()
|
||||
.add(const LoadLandPropertyAssessment());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,282 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_appraisal/land_appraisal_bloc.dart';
|
||||
import 'package:unit2/model/passo/land_appr.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land/AddLandAppraisal.dart';
|
||||
import 'package:unit2/utils/alerts.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
|
||||
class LandAppraisal extends StatefulWidget {
|
||||
Function PrevBtn;
|
||||
Function NextBtn;
|
||||
LandAppraisal(this.PrevBtn, this.NextBtn);
|
||||
@override
|
||||
_LandAppraisal createState() => _LandAppraisal();
|
||||
}
|
||||
|
||||
class _LandAppraisal extends State<LandAppraisal> {
|
||||
// double _totalMarketValue(items) {
|
||||
// double total = 0;
|
||||
// items.forEach((row) {
|
||||
// total += double.parse(row);
|
||||
// });
|
||||
// return total;
|
||||
// }
|
||||
|
||||
void deleteItem(int itemId) {
|
||||
context.read<LandAppraisalBloc>().add(DeleteLandAppraisal(id: itemId));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<LandAppraisalBloc, LandAppraisalState>(
|
||||
listener: (context, state) {
|
||||
if (state is LandAppraisalLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is LandAppraisalLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is LandAppraisalErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
final state = context.watch<LandAppraisalBloc>().state;
|
||||
if (state is LandAppraisalLoaded) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('LAND APPRAISAL',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
onPressed: () {
|
||||
context
|
||||
.read<LandAppraisalBloc>()
|
||||
.add(ShowLandAppraisal());
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text('ADD ITEM'), // <-- Text
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
const Icon(
|
||||
// <-- Icon
|
||||
Icons.add,
|
||||
size: 24.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: DataTable(
|
||||
// ignore: prefer_const_literals_to_create_immutables
|
||||
columns: [
|
||||
const DataColumn(
|
||||
label: Text('Classification'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Sub-Classification'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Area'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Unit Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Base MArket Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Action'),
|
||||
)
|
||||
],
|
||||
rows: state.land_appr.map((dataRow) {
|
||||
return DataRow(
|
||||
cells: [
|
||||
DataCell(Text(dataRow.classification!)),
|
||||
DataCell(Text(dataRow.subClass!)),
|
||||
DataCell(Text(dataRow.area!)),
|
||||
DataCell(Text(
|
||||
((double.parse(dataRow.unitValue!)))
|
||||
.toString())),
|
||||
DataCell(Text(((double.parse(
|
||||
dataRow.baseMarketval!)))
|
||||
.toString())),
|
||||
DataCell(Row(
|
||||
children: [
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
deleteItem(dataRow.id!);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
);
|
||||
}).toList()))
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 20.0, right: 20.0),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Total',
|
||||
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
// ),
|
||||
// Text(
|
||||
// NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
||||
// .format('1.0'),
|
||||
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.PrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.NextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
if (state is LandAppraisalDeletedState) {
|
||||
if (state.success) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
successAlert(context, "Deletion Successful",
|
||||
"Extra item has been deleted successfully", () {
|
||||
Navigator.of(context).pop();
|
||||
context
|
||||
.read<LandAppraisalBloc>()
|
||||
.add(const LoadLandAppraisal());
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
if (state is ShowAddLandAppraisalScreen) {
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxHeight: 1000.0),
|
||||
child: AlertDialog(
|
||||
insetPadding: EdgeInsets.symmetric(
|
||||
horizontal: 20.0,
|
||||
vertical: 10.0,
|
||||
),
|
||||
title: Text(
|
||||
'ADD LAND APPRAISAL',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(child: AddLandAppraisalModal()),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (state is LandAppraisalErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<LandAppraisalBloc>().add(LoadLandAppraisal());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,143 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_property_owner_info/land_property_owner_info_bloc.dart';
|
||||
import 'package:unit2/model/passo/land_property_boundaries.dart';
|
||||
import 'package:unit2/model/passo/land_property_loc.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
class LandLocationAndBoundaries extends StatefulWidget {
|
||||
Function PrevBtn;
|
||||
Function NextBtn;
|
||||
LandLocationAndBoundaries(this.PrevBtn, this.NextBtn);
|
||||
@override
|
||||
_LandLocationAndBoundaries createState() => _LandLocationAndBoundaries();
|
||||
}
|
||||
|
||||
class _LandLocationAndBoundaries extends State<LandLocationAndBoundaries> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('PROPERTY LOCATION',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("No. / Street", "", "street")),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("Brgy./District", "", "brgy")),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child:
|
||||
customTextField("Municipality", "", "municipality"),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("Province/City", "", "province"))
|
||||
]),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('PROPERTY BOUNDARIES',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField("North", "", "north"),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("East", "", "east"))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField("South", "", "south"),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("West", "", "west"))
|
||||
]),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left, color: Colors.white),
|
||||
onPressed: () {
|
||||
widget.PrevBtn();
|
||||
}),
|
||||
CustomButton(
|
||||
icon:
|
||||
const Icon(Icons.chevron_right, color: Colors.white),
|
||||
onPressed: () async {
|
||||
final tempID = await SharedPreferences.getInstance();
|
||||
print(tempID.getInt('landid'));
|
||||
var boundaries = LandPropertyBoundaries(
|
||||
id: tempID.getInt('landid')! - 1,
|
||||
north: landKey.currentState?.value['north'],
|
||||
east: landKey.currentState?.value['east'],
|
||||
west: landKey.currentState?.value['west'],
|
||||
south: landKey.currentState?.value['south'],
|
||||
);
|
||||
var location = LandPropertyLoc(
|
||||
id: tempID.getInt('landid')! - 1,
|
||||
street: landKey.currentState?.value['street'],
|
||||
barangay: landKey.currentState?.value['brgy'],
|
||||
municipality:
|
||||
landKey.currentState?.value['municipality'],
|
||||
province: landKey.currentState?.value['province'],
|
||||
);
|
||||
|
||||
// context.read<LandPropertyOwnerInfoBloc>()
|
||||
// ..add(
|
||||
// UpdateLandBoundaries(land_boundaries: boundaries))
|
||||
// ..add(UpdateLandLoc(land_loc: location));
|
||||
|
||||
widget.NextBtn();
|
||||
})
|
||||
],
|
||||
)
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,285 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:unit2/bloc/passo/land/other_improvements/other_improvements_bloc.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land/AddOtherImprovementModal.dart';
|
||||
import 'package:unit2/utils/alerts.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
|
||||
class OtherImprovementPage extends StatefulWidget {
|
||||
Function PrevBtn;
|
||||
Function NextBtn;
|
||||
OtherImprovementPage(this.PrevBtn, this.NextBtn);
|
||||
@override
|
||||
_OtherImprovementPage createState() => _OtherImprovementPage();
|
||||
}
|
||||
|
||||
class _OtherImprovementPage extends State<OtherImprovementPage> {
|
||||
// double _totalMarketValue(items) {
|
||||
// double total = 0;
|
||||
// items.forEach((row) {
|
||||
// total += double.parse(row);
|
||||
// });
|
||||
// return total;
|
||||
// }
|
||||
|
||||
void deleteItem(int itemId) {
|
||||
context
|
||||
.read<OtherImprovementsBloc>()
|
||||
.add(DeleteOtherImprovement(id: itemId));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<OtherImprovementsBloc, OtherImprovementsState>(
|
||||
listener: (context, state) {
|
||||
if (state is OtherImprovementLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is OtherImprovementLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is OtherImprovementErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
final state = context.watch<OtherImprovementsBloc>().state;
|
||||
if (state is OtherImprovementLoaded) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('OTHER IMPROVEMENTS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
onPressed: () {
|
||||
context
|
||||
.read<OtherImprovementsBloc>()
|
||||
.add(ShowOtherImprovement());
|
||||
},
|
||||
child: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text('ADD ITEM'), // <-- Text
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Icon(
|
||||
// <-- Icon
|
||||
Icons.add,
|
||||
size: 24.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: DataTable(
|
||||
// ignore: prefer_const_literals_to_create_immutables
|
||||
columns: [
|
||||
const DataColumn(
|
||||
label: Text('Kinds of Tress'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Sub-Class / Age'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Type of Tree'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('No.'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('No. of Productive'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('No. of Non-Productive'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Unit Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Base Market Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Action'),
|
||||
)
|
||||
],
|
||||
rows: state.other_imp.map((dataRow) {
|
||||
return DataRow(
|
||||
cells: [
|
||||
DataCell(Text(dataRow.kindsOfTrees!)),
|
||||
DataCell(Text(dataRow.subclassAge!)),
|
||||
DataCell(Text(dataRow.fruitBearing == '1'
|
||||
? "Fruit Bearing"
|
||||
: "Non-Fruit Bearing")),
|
||||
DataCell(
|
||||
Text(dataRow.quantity.toString()!)),
|
||||
DataCell(Text(
|
||||
dataRow.noOfProductive.toString()!)),
|
||||
DataCell(Text(dataRow.noOfNonproductive
|
||||
.toString()!)),
|
||||
DataCell(
|
||||
Text(dataRow.unitValue.toString()!)),
|
||||
DataCell(Text(
|
||||
dataRow.baseMarketval.toString()!)),
|
||||
DataCell(Row(
|
||||
children: [
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
deleteItem(dataRow.id!);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
);
|
||||
}).toList()))
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 20.0, right: 20.0),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Total',
|
||||
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
// ),
|
||||
// Text(
|
||||
// NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
||||
// .format('1.0'),
|
||||
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.PrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.NextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
if (state is OtherImprovementDeletedState) {
|
||||
if (state.success) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
successAlert(context, "Deletion Successful",
|
||||
"Extra item has been deleted successfully", () {
|
||||
Navigator.of(context).pop();
|
||||
context
|
||||
.read<OtherImprovementsBloc>()
|
||||
.add(const LoadOtherImprovement());
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
if (state is ShowAddOtherImprovementScreen) {
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxHeight: 1000.0),
|
||||
child: AlertDialog(
|
||||
insetPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 20.0,
|
||||
vertical: 10.0,
|
||||
),
|
||||
title: const Text(
|
||||
'ADD OTHER IMPROVEMENTS',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [Expanded(child: AddOtherImprovementModal())],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,263 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_property_assessment/land_property_assessment_bloc.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land/AddPropertyAssessmentModal.dart';
|
||||
import 'package:unit2/utils/alerts.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
|
||||
class LandPropertyAssessmentPage extends StatefulWidget {
|
||||
Function PrevBtn;
|
||||
Function NextBtn;
|
||||
LandPropertyAssessmentPage(this.PrevBtn, this.NextBtn);
|
||||
@override
|
||||
_LandPropertyAssessmentPage createState() => _LandPropertyAssessmentPage();
|
||||
}
|
||||
|
||||
class _LandPropertyAssessmentPage extends State<LandPropertyAssessmentPage> {
|
||||
// double _totalMarketValue(items) {
|
||||
// double total = 0;
|
||||
// items.forEach((row) {
|
||||
// total += double.parse(row);
|
||||
// });
|
||||
// return total;
|
||||
// }
|
||||
|
||||
void deleteItem(int itemId) {
|
||||
context
|
||||
.read<LandPropertyAssessmentBloc>()
|
||||
.add(DeleteLandPropertyAssessment(id: itemId));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<LandPropertyAssessmentBloc,
|
||||
LandPropertyAssessmentState>(listener: (context, state) {
|
||||
if (state is LandPropertyAssessmentLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is LandPropertyAssessmentLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is LandPropertyAssessmentErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
final state = context.watch<LandPropertyAssessmentBloc>().state;
|
||||
if (state is LandPropertyAssessmentLoaded) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('PROPERTY ASSESSMENT',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
onPressed: () {
|
||||
context
|
||||
.read<LandPropertyAssessmentBloc>()
|
||||
.add(ShowLandPropertyAssessment());
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text('ADD ITEM'), // <-- Text
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
const Icon(
|
||||
// <-- Icon
|
||||
Icons.add,
|
||||
size: 24.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: DataTable(
|
||||
// ignore: prefer_const_literals_to_create_immutables
|
||||
columns: [
|
||||
const DataColumn(
|
||||
label: Text('Actual Use'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Market Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Assessment Level'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Assessed Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Action'),
|
||||
)
|
||||
],
|
||||
rows: state.assessment.map((dataRow) {
|
||||
return DataRow(
|
||||
cells: [
|
||||
DataCell(Text(dataRow.actualUse!)),
|
||||
DataCell(Text(dataRow.marketval!)),
|
||||
DataCell(
|
||||
Text(dataRow.assessmentLevel! + '%')),
|
||||
DataCell(Text(dataRow.assessedValue!)),
|
||||
DataCell(Row(
|
||||
children: [
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
deleteItem(dataRow.id!);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
);
|
||||
}).toList()))
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 20.0, right: 20.0),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Total',
|
||||
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
// ),
|
||||
// Text(
|
||||
// NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
||||
// .format('1.0'),
|
||||
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.PrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.NextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
if (state is LandPropertyAssessmentDeletedState) {
|
||||
if (state.success) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
successAlert(context, "Deletion Successful",
|
||||
"Extra item has been deleted successfully", () {
|
||||
Navigator.of(context).pop();
|
||||
context
|
||||
.read<LandPropertyAssessmentBloc>()
|
||||
.add(const LoadLandPropertyAssessment());
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
if (state is ShowAddLandPropertyAssessmentScreen) {
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxHeight: 1000.0),
|
||||
child: AlertDialog(
|
||||
insetPadding: EdgeInsets.symmetric(
|
||||
horizontal: 20.0,
|
||||
vertical: 10.0,
|
||||
),
|
||||
title: Text(
|
||||
'ADD PROPERTY ASSESSMENT',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [Expanded(child: AddPropertyAssessmentModal())],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,621 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:searchfield/searchfield.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_ext/land_ext_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/memoranda/memoranda_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/signatories/signatories_bloc.dart';
|
||||
import 'package:unit2/model/passo/land_ext.dart';
|
||||
import 'package:unit2/model/passo/memoranda.dart';
|
||||
import 'package:unit2/model/passo/signatories.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
|
||||
class LandSignatories extends StatefulWidget {
|
||||
Function onSAve;
|
||||
LandSignatories(this.onSAve);
|
||||
|
||||
@override
|
||||
_LandSignatories createState() => _LandSignatories();
|
||||
}
|
||||
|
||||
class _LandSignatories extends State<LandSignatories> {
|
||||
bool isTaxable = false;
|
||||
bool isExempt = false;
|
||||
final focus = FocusNode();
|
||||
String _memoranda = "";
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<LandExtBloc, LandExtState>(
|
||||
listener: (context, state) {
|
||||
if (state is LandExtLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
|
||||
if (state is LandExtErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is LandExtLoaded) {
|
||||
return BlocConsumer<SignatoriesBloc, SignatoriesState>(
|
||||
listener: (context, state) {
|
||||
if (state is SignatoriesLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
|
||||
if (state is SignatoriesErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is SignatoriesLoaded) {
|
||||
final signatories = state.signatories;
|
||||
return BlocConsumer<MemorandaBloc, MemorandaState>(
|
||||
listener: (context, state) {
|
||||
if (state is MemorandaLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is MemorandaLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is MemorandaErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is MemorandaLoaded) {
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('PROPERTY ASSESSMENT cont..',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Text('Taxable'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: isTaxable,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
isTaxable = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Text('Exempt'),
|
||||
Checkbox(
|
||||
checkColor: Colors.white,
|
||||
value: isExempt,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
isExempt = value!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
const Text(
|
||||
'EFFECTIVITY OF ASSESSMENT / REASSESSMENT :',
|
||||
style:
|
||||
TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
const Text('Qtr.'),
|
||||
SizedBox(
|
||||
width: 70,
|
||||
height: 25,
|
||||
child: FormBuilderTextField(
|
||||
name: 'land_qtr',
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
const Text('Yr.'),
|
||||
SizedBox(
|
||||
width: 70,
|
||||
height: 25,
|
||||
child: FormBuilderTextField(
|
||||
name: 'land_yr',
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 40, right: 0, bottom: 10),
|
||||
child: const Text('SIGNATORIES',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'APPRAISED/ASSESSED BY:',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: FormBuilderDropdown<Signatories>(
|
||||
name: 'appraised_by_land',
|
||||
autofocus: false,
|
||||
items: signatories
|
||||
.map((signatories) =>
|
||||
DropdownMenuItem(
|
||||
value: signatories,
|
||||
child: Text(
|
||||
'${signatories.firstname} ${signatories.middlename} ${signatories.lastname}'),
|
||||
))
|
||||
.toList()),
|
||||
),
|
||||
Text('Name'),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 15,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: FormBuilderDateTimePicker(
|
||||
name: 'app_date_land',
|
||||
initialEntryMode:
|
||||
DatePickerEntryMode.calendarOnly,
|
||||
initialValue: DateTime.now(),
|
||||
inputType: InputType.date,
|
||||
|
||||
initialTime: const TimeOfDay(
|
||||
hour: 8, minute: 0),
|
||||
// locale: const Locale.fromSubtags(languageCode: 'fr'),
|
||||
),
|
||||
),
|
||||
Text('Date'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
const Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'RECOMMENDING APPROVAL:',
|
||||
style:
|
||||
TextStyle(fontWeight: FontWeight.bold),
|
||||
)),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: FormBuilderDropdown<Signatories>(
|
||||
name: 'rec_approval_land',
|
||||
autofocus: false,
|
||||
items: signatories
|
||||
.map((signatories) =>
|
||||
DropdownMenuItem(
|
||||
value: signatories,
|
||||
child: Text(
|
||||
'${signatories.firstname} ${signatories.middlename} ${signatories.lastname}'),
|
||||
))
|
||||
.toList()),
|
||||
),
|
||||
Text('Name'),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 15,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: FormBuilderDateTimePicker(
|
||||
name: 'rec_date_land',
|
||||
initialEntryMode:
|
||||
DatePickerEntryMode.calendarOnly,
|
||||
initialValue: DateTime.now(),
|
||||
inputType: InputType.date,
|
||||
|
||||
initialTime: const TimeOfDay(
|
||||
hour: 8, minute: 0),
|
||||
// locale: const Locale.fromSubtags(languageCode: 'fr'),
|
||||
),
|
||||
),
|
||||
Text('Date'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
const Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'APPROVED BY:',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: FormBuilderDropdown<Signatories>(
|
||||
name: 'apprvd_by_land',
|
||||
autofocus: false,
|
||||
items: signatories
|
||||
.map((signatories) =>
|
||||
DropdownMenuItem(
|
||||
value: signatories,
|
||||
child: Text(
|
||||
'${signatories.firstname} ${signatories.middlename} ${signatories.lastname}'),
|
||||
))
|
||||
.toList()),
|
||||
),
|
||||
Text('Name'),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 15,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: FormBuilderDateTimePicker(
|
||||
name: 'apprvd_by_date_land',
|
||||
initialEntryMode:
|
||||
DatePickerEntryMode.calendarOnly,
|
||||
initialValue: DateTime.now(),
|
||||
inputType: InputType.date,
|
||||
|
||||
initialTime: const TimeOfDay(
|
||||
hour: 8, minute: 0),
|
||||
// locale: const Locale.fromSubtags(languageCode: 'fr'),
|
||||
),
|
||||
),
|
||||
Text('Date'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
const Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'MEMORANDA: ',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
SizedBox(
|
||||
width: 500,
|
||||
height: 100,
|
||||
child: SearchField(
|
||||
suggestions: state.memorada
|
||||
.map((Memoranda memoranda) =>
|
||||
SearchFieldListItem(
|
||||
'${memoranda.memoranda}',
|
||||
item:
|
||||
memoranda, // Change: Use individual Memoranda object
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
'${memoranda.memoranda}',
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
// searchInputDecoration:
|
||||
// normalTextFieldStyle(
|
||||
// "Memoranda", "")
|
||||
// .copyWith(
|
||||
// suffixIcon: const Icon(
|
||||
// Icons.arrow_drop_down),
|
||||
// ),
|
||||
// focusNode: focus,
|
||||
suggestionState: Suggestion.expand,
|
||||
onSuggestionTap: (memoranda) {
|
||||
setState(() {
|
||||
_memoranda = memoranda.item!.memoranda!;
|
||||
});
|
||||
focus.unfocus();
|
||||
},
|
||||
)),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Sworn Statement No. :'),
|
||||
SizedBox(
|
||||
width: 150,
|
||||
height: 20,
|
||||
child: FormBuilderTextField(
|
||||
name: 'sworn_statement_land',
|
||||
decoration: InputDecoration(),
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Date Received:'),
|
||||
SizedBox(
|
||||
width: 150,
|
||||
height: 20,
|
||||
child: FormBuilderDateTimePicker(
|
||||
name: 'date_received_land',
|
||||
initialEntryMode:
|
||||
DatePickerEntryMode.calendarOnly,
|
||||
initialValue: DateTime.now(),
|
||||
inputType: InputType.date,
|
||||
|
||||
initialTime:
|
||||
const TimeOfDay(hour: 8, minute: 0),
|
||||
// locale: const Locale.fromSubtags(languageCode: 'fr'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Date of Entry in the Rec. of Ass. :'),
|
||||
SizedBox(
|
||||
width: 100,
|
||||
height: 20,
|
||||
child: FormBuilderDateTimePicker(
|
||||
name: 'date_of_entry_land',
|
||||
initialEntryMode:
|
||||
DatePickerEntryMode.calendarOnly,
|
||||
initialValue: DateTime.now(),
|
||||
inputType: InputType.date,
|
||||
|
||||
initialTime:
|
||||
const TimeOfDay(hour: 8, minute: 0),
|
||||
// locale: const Locale.fromSubtags(languageCode: 'fr'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('By:'),
|
||||
SizedBox(
|
||||
width: 150,
|
||||
height: 20,
|
||||
child: FormBuilderTextField(
|
||||
name: 'by_land',
|
||||
decoration: InputDecoration(),
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
final tempID =
|
||||
await SharedPreferences.getInstance();
|
||||
var ext = LandExt(
|
||||
landapprDetailsId:
|
||||
tempID.getInt('landid')! - 1,
|
||||
taxable: isTaxable == true ? '1' : '0',
|
||||
exempt: isExempt == true ? '1' : '0',
|
||||
qtr: landKey
|
||||
.currentState!.value['land_qtr'],
|
||||
yr: landKey
|
||||
.currentState!.value['land_yr'],
|
||||
appraisedbyName: landKey.currentState!.value['appraised_by_land'].firstname +
|
||||
' ' +
|
||||
landKey
|
||||
.currentState!
|
||||
.value['appraised_by_land']
|
||||
.middlename +
|
||||
' ' +
|
||||
landKey
|
||||
.currentState!
|
||||
.value['appraised_by_land']
|
||||
.lastname,
|
||||
appraisedbyDate: landKey
|
||||
.currentState!.value['app_date_land'],
|
||||
recommendapprName: landKey.currentState!.value['rec_approval_land'].firstname +
|
||||
' ' +
|
||||
landKey
|
||||
.currentState!
|
||||
.value['rec_approval_land']
|
||||
.middlename +
|
||||
' ' +
|
||||
landKey
|
||||
.currentState!
|
||||
.value['rec_approval_land']
|
||||
.lastname,
|
||||
recommendapprDate: landKey
|
||||
.currentState!.value['rec_date_land'],
|
||||
approvedbyName: landKey.currentState!.value['apprvd_by_land'].firstname +
|
||||
' ' +
|
||||
landKey.currentState!.value['apprvd_by_land'].middlename +
|
||||
' ' +
|
||||
landKey.currentState!.value['apprvd_by_land'].lastname,
|
||||
approvedbyDate: landKey.currentState!.value['apprvd_by_date_land'],
|
||||
memoranda: _memoranda,
|
||||
swornstatementNo: landKey.currentState!.value['sworn_statement_land'],
|
||||
dateReceived: landKey.currentState!.value['date_received_land'],
|
||||
entryDateAssessment: landKey.currentState!.value['date_of_entry_land'],
|
||||
entryDateBy: landKey.currentState!.value['by_land']);
|
||||
|
||||
print(ext.toJson());
|
||||
context.read<LandExtBloc>()
|
||||
..add(UpdateLandExt(landext: ext));
|
||||
// widget.onSAve();
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: primary,
|
||||
foregroundColor: Colors.red),
|
||||
child: SizedBox(
|
||||
width: 250,
|
||||
height: 50,
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'Save',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
if (state is MemorandaErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<MemorandaBloc>()
|
||||
.add(LoadMemoranda());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is SignatoriesErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<SignatoriesBloc>().add(LoadSignatories());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is LandExtErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<LandExtBloc>().add(LoadLandExt());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,170 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_property_owner_info/land_property_owner_info_bloc.dart';
|
||||
import 'package:unit2/model/passo/land_property_owner.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
class LandPropertyOwnerInfo extends StatefulWidget {
|
||||
Function NextBtn;
|
||||
LandPropertyOwnerInfo(this.NextBtn);
|
||||
@override
|
||||
_LandPropertyOwnerInfo createState() => _LandPropertyOwnerInfo();
|
||||
}
|
||||
|
||||
class _LandPropertyOwnerInfo extends State<LandPropertyOwnerInfo> {
|
||||
final transaction_codes = ['New', 'Revision'];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin:
|
||||
const EdgeInsets.only(left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('PROPERTY OWNER INFO',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
customDropDownField(
|
||||
"Transaction Code", "", "transaction_code", transaction_codes),
|
||||
customTextField("ARP No./ TD No.", "", "td_no"),
|
||||
customTextField("Owner", "", "owner"),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(flex: 1, child: customTextField("PIN", "", "pin")),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("TIN", "", "tin"))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField("OCT/TCT CLOA No.", "", "cloa_no"),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customDatTimePicker("Dated", "", "dated"))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField("Survey No.", "", "survey_no"),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("Lot No.", "", "lot_no")),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("Blk", "", "blk")),
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField("Address", "", "address"),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("Tel No.", "", "tel_no"))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField(
|
||||
"Administrator/Beneficial User", "", "admin"),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("TIN", "", "admin_tin"))
|
||||
]),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: customTextField("Address", "", "admin_address"),
|
||||
),
|
||||
const SizedBox(width: 10.0),
|
||||
Expanded(
|
||||
// optional flex property if flex is 1 because the default flex is 1
|
||||
flex: 1,
|
||||
child: customTextField("Tel No.", "", "admin_telno"))
|
||||
]),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right, color: Colors.white),
|
||||
onPressed: () {
|
||||
var land = LandPropertyOwner(
|
||||
id: 1,
|
||||
transCode: landKey
|
||||
.currentState!.value['transaction_code']
|
||||
.toString(),
|
||||
tdn: landKey.currentState!.value['td_no'],
|
||||
cloaNo: landKey.currentState!.value['cloa_no'],
|
||||
dated: landKey.currentState!.value['dated'],
|
||||
assessedById: "1",
|
||||
assessedByName: "cyril",
|
||||
dateCreated: landKey.currentState!.value['dated'],
|
||||
dateModified: landKey.currentState!.value['dated'],
|
||||
pin: landKey.currentState!.value['pin'],
|
||||
surveyNo: landKey.currentState!.value['survey_no'],
|
||||
lotNo: landKey.currentState!.value['lot_no'],
|
||||
blkNo: landKey.currentState!.value['blk'],
|
||||
owner: landKey.currentState!.value['owner'],
|
||||
address: landKey.currentState!.value['address'],
|
||||
telno: landKey.currentState!.value['tel_no'],
|
||||
tin: landKey.currentState!.value['tin'],
|
||||
adminUser: landKey.currentState!.value['admin'],
|
||||
adminAddress:
|
||||
landKey.currentState!.value['admin_address'],
|
||||
adminTin: landKey.currentState!.value['admin_tin'],
|
||||
// faasType: "LAND",
|
||||
adminTelno: landKey.currentState!.value['admin_telno']);
|
||||
|
||||
context
|
||||
.read<LandPropertyOwnerInfoBloc>()
|
||||
.add(AddPropertyOwnerLand(land: land));
|
||||
|
||||
widget.NextBtn();
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
]),
|
||||
));
|
||||
}
|
||||
}
|
|
@ -1,260 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_value_adjustments/land_value_adjustments_bloc.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land/AddLandValueAdjustmentModal.dart';
|
||||
import 'package:unit2/utils/alerts.dart';
|
||||
import 'package:unit2/widgets/passo/custom_button.dart';
|
||||
|
||||
class ValueAdjustmentPage extends StatefulWidget {
|
||||
Function PrevBtn;
|
||||
Function NextBtn;
|
||||
ValueAdjustmentPage(this.PrevBtn, this.NextBtn);
|
||||
@override
|
||||
_ValueAdjustmentPage createState() => _ValueAdjustmentPage();
|
||||
}
|
||||
|
||||
class _ValueAdjustmentPage extends State<ValueAdjustmentPage> {
|
||||
void deleteItem(int itemId) {
|
||||
context
|
||||
.read<LandValueAdjustmentsBloc>()
|
||||
.add(DeleteLandValueAdjustments(id: itemId));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child:
|
||||
BlocConsumer<LandValueAdjustmentsBloc, LandValueAdjustmentsState>(
|
||||
listener: (context, state) {
|
||||
if (state is LandValueAdjustmentsLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is LandValueAdjustmentsLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is LandValueAdjustmentsErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
}, builder: (context, state) {
|
||||
final state = context.watch<LandValueAdjustmentsBloc>().state;
|
||||
if (state is LandValueAdjustmentsLoaded) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 20, right: 0, bottom: 10),
|
||||
child: const Text('VALUE ADJUSTMENTS',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
onPressed: () {
|
||||
context
|
||||
.read<LandValueAdjustmentsBloc>()
|
||||
.add(ShowLandValueAdjustments());
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text('ADD ITEM'), // <-- Text
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
const Icon(
|
||||
// <-- Icon
|
||||
Icons.add,
|
||||
size: 24.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: DataTable(
|
||||
// ignore: prefer_const_literals_to_create_immutables
|
||||
columns: [
|
||||
const DataColumn(
|
||||
label: Text('Base Market Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Adjustment Factors'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('% Adjustment'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Value Adjustment'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Market Value'),
|
||||
),
|
||||
const DataColumn(
|
||||
label: Text('Action'),
|
||||
)
|
||||
],
|
||||
rows: state.val_adj.map((dataRow) {
|
||||
return DataRow(
|
||||
cells: [
|
||||
DataCell(Text(dataRow.baseMarketval!)),
|
||||
DataCell(
|
||||
Text(dataRow.adjustmentFactors!)),
|
||||
DataCell(Text(dataRow.adjustment!)),
|
||||
DataCell(Text(dataRow.valueAdjustment!)),
|
||||
DataCell(Text(dataRow.marketValue!)),
|
||||
DataCell(Row(
|
||||
children: [
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
deleteItem(dataRow.id!);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color: Colors.white,
|
||||
size: 20.0,
|
||||
),
|
||||
),
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
);
|
||||
}).toList()))
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 20.0, right: 20.0),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Total',
|
||||
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
// ),
|
||||
// Text(
|
||||
// NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
||||
// .format('1.0'),
|
||||
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_left_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.PrevBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
),
|
||||
CustomButton(
|
||||
icon: const Icon(Icons.chevron_right_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () {
|
||||
{
|
||||
widget.NextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
if (state is LandValueAdjustmentsDeletedState) {
|
||||
if (state.success) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
successAlert(context, "Deletion Successful",
|
||||
"Extra item has been deleted successfully", () {
|
||||
Navigator.of(context).pop();
|
||||
context
|
||||
.read<LandValueAdjustmentsBloc>()
|
||||
.add(const LoadLandValueAdjustments());
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
if (state is ShowAddLandValueAdjustmentsScreen) {
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(maxHeight: 1000.0),
|
||||
child: AlertDialog(
|
||||
insetPadding: EdgeInsets.symmetric(
|
||||
horizontal: 20.0,
|
||||
vertical: 10.0,
|
||||
),
|
||||
title: Text(
|
||||
'ADD VALUE ADJUSTMENTS',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [Expanded(child: AddLandValueAdjustmentModal())],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
|
||||
import 'package:im_stepper/stepper.dart';
|
||||
import 'package:unit2/model/passo/land_property_owner.dart';
|
||||
import 'package:unit2/screens/passo/Land/edit_land/land_appraisal.dart';
|
||||
import 'package:unit2/screens/passo/Land/edit_land/location_and_boundaries_edit.dart';
|
||||
import 'package:unit2/screens/passo/Land/edit_land/other_improvements_edit.dart';
|
||||
import 'package:unit2/screens/passo/Land/edit_land/property_assessment_cont_edit.dart';
|
||||
import 'package:unit2/screens/passo/Land/edit_land/property_assessment_edit.dart';
|
||||
import 'package:unit2/screens/passo/Land/edit_land/property_owner_info_edit.dart';
|
||||
import 'package:unit2/screens/passo/Land/edit_land/value_adjustments_edit.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
|
||||
GlobalKey<FormBuilderState> landKey = GlobalKey<FormBuilderState>();
|
||||
|
||||
class EditLand extends StatefulWidget {
|
||||
final int index;
|
||||
final LandPropertyOwner faas;
|
||||
final String title;
|
||||
|
||||
const EditLand(
|
||||
{super.key,
|
||||
required this.title,
|
||||
required this.index,
|
||||
required this.faas});
|
||||
@override
|
||||
_EditLand createState() => _EditLand();
|
||||
}
|
||||
|
||||
class _EditLand extends State<EditLand> {
|
||||
// THE FOLLOWING TWO VARIABLES ARE REQUIRED TO CONTROL THE STEPPER.
|
||||
int activeStep = 0; // Initial step set to 5.
|
||||
|
||||
int upperBound = 6; // upperBound MUST BE total number of icons minus 1.
|
||||
|
||||
void PrevBtn() {
|
||||
setState(() {
|
||||
activeStep--;
|
||||
});
|
||||
}
|
||||
|
||||
void NextBtn() {
|
||||
setState(() {
|
||||
activeStep++;
|
||||
});
|
||||
}
|
||||
|
||||
void onSAveAll() {
|
||||
return Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
backgroundColor: primary,
|
||||
title: Text('Land FAAS'),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
NumberStepper(
|
||||
numbers: [1, 2, 3, 4, 5, 6, 7],
|
||||
activeStepColor: primary,
|
||||
numberStyle: TextStyle(color: Colors.white),
|
||||
lineColor: primary,
|
||||
// activeStep property set to activeStep variable defined above.
|
||||
activeStep: activeStep,
|
||||
activeStepBorderColor: Colors.white,
|
||||
activeStepBorderWidth: 1,
|
||||
// This ensures step-tapping updates the activeStep.
|
||||
onStepReached: (index) {
|
||||
setState(() {
|
||||
activeStep = index;
|
||||
});
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: content(PrevBtn, NextBtn, onSAveAll),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Returns the next button.
|
||||
|
||||
// Returns the content widget based on the activeStep.
|
||||
Widget content(PrevBtn, NextBtn, onSAveAll) {
|
||||
switch (activeStep) {
|
||||
case 0:
|
||||
return LandPropertyOwnerInfoEdit(NextBtn, widget.faas!);
|
||||
case 1:
|
||||
return LandLocationAndBoundariesEdit(PrevBtn, NextBtn, widget.faas!);
|
||||
case 2:
|
||||
return LandAppraisalEdit(PrevBtn, NextBtn, widget.faas.id!);
|
||||
case 3:
|
||||
return OtherImprovementEditPage(PrevBtn, NextBtn, widget.faas.id!);
|
||||
case 4:
|
||||
return ValueAdjustmentEditPage(PrevBtn, NextBtn, widget.faas.id!);
|
||||
case 5:
|
||||
return LandPropertyAssessmentEditPage(
|
||||
PrevBtn, NextBtn, widget.faas.id!);
|
||||
case 6:
|
||||
return LandSignatoriesEdit(onSAveAll, widget.faas.id!);
|
||||
|
||||
default:
|
||||
return LandPropertyOwnerInfoEdit(NextBtn, widget.faas!);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,464 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:searchfield/searchfield.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/bulding/additional_item/additional_item_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_appraisal/land_appraisal_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_classification/land_classification_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_subclassification/land_subclassification_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/municipality/municipality_bloc.dart';
|
||||
import 'package:unit2/model/passo/additional_items.dart';
|
||||
import 'package:unit2/model/passo/city.dart';
|
||||
import 'package:unit2/model/passo/class_components.dart';
|
||||
import 'package:unit2/model/passo/land_appr.dart';
|
||||
import 'package:unit2/model/passo/land_classification.dart';
|
||||
import 'package:unit2/model/passo/land_subclassification.dart';
|
||||
import 'package:unit2/model/passo/unit_construct.dart';
|
||||
import 'package:unit2/screens/passo/Land/add_land.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||
|
||||
class AddLandAppraisalEditModal extends StatefulWidget {
|
||||
// final List<UnitConstruct> unit;
|
||||
// final List<ClassComponents> options;
|
||||
final int tempId;
|
||||
|
||||
AddLandAppraisalEditModal(this.tempId);
|
||||
|
||||
@override
|
||||
_AddLandAppraisalEditModal createState() => _AddLandAppraisalEditModal();
|
||||
}
|
||||
|
||||
class _AddLandAppraisalEditModal extends State<AddLandAppraisalEditModal> {
|
||||
final focus = FocusNode();
|
||||
bool isPainted = false;
|
||||
bool isSecondHand = false;
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
double _unitBase = 0;
|
||||
int _areaValue = 0;
|
||||
final double _depValue = 0;
|
||||
double _unitValue = 0;
|
||||
String _subClassDesc = "";
|
||||
int _classId = 0;
|
||||
String _structureType = "";
|
||||
bool _withoutBUCC = false;
|
||||
int _notPaintedUnitVal = 0;
|
||||
int _secondHandUnitVal = 0;
|
||||
String cityCode = '';
|
||||
String cityDesc = '';
|
||||
int classCode = 1;
|
||||
String _classDesc = '';
|
||||
|
||||
GlobalKey<FormBuilderState> appraisalLandKey = GlobalKey<FormBuilderState>();
|
||||
|
||||
BoxDecoration box1() {
|
||||
return const BoxDecoration(boxShadow: [
|
||||
BoxShadow(color: Colors.black12, spreadRadius: 5, blurRadius: 5)
|
||||
], color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(3)));
|
||||
}
|
||||
|
||||
double _amountofDepreciation(unitVal, unitBase, area, depreciation) {
|
||||
return ((unitVal * unitBase) * area) * depreciation;
|
||||
}
|
||||
|
||||
double _totalMarketValue(unitBase, area) {
|
||||
return unitBase * area;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocConsumer<LandAppraisalBloc, LandAppraisalState>(
|
||||
listener: (context, state) {
|
||||
if (state is LandAppraisalLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is LandAppraisalLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is LandAppraisalErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
}, buildWhen: (previous, current) {
|
||||
return false;
|
||||
}, builder: (context, state) {
|
||||
if (state is ShowAddLandAppraisalScreen) {
|
||||
return BlocConsumer<LandClassificationBloc, LandClassificationState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is LandClassificationLoaded) {
|
||||
final classification = state.land_classification;
|
||||
return BlocConsumer<LandSubClassificationBloc,
|
||||
LandSubClassificationState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is LandSubClassificationLoaded) {
|
||||
final subclassification = state.land_subclassification;
|
||||
return BlocConsumer<MunicipalityBloc, MunicipalityState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is MunicipalityLoaded) {
|
||||
return FormBuilder(
|
||||
key: appraisalLandKey,
|
||||
onChanged: () {
|
||||
appraisalLandKey.currentState?.save();
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 10,
|
||||
right: 0,
|
||||
bottom: 0),
|
||||
child: Expanded(
|
||||
flex: 1,
|
||||
child:
|
||||
FormBuilderDropdown<City>(
|
||||
name:
|
||||
'appraisal_municipality',
|
||||
autofocus: false,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
cityDesc ??
|
||||
"Municipality",
|
||||
""),
|
||||
items: state.municipality
|
||||
.map((municipality) =>
|
||||
DropdownMenuItem<
|
||||
City>(
|
||||
value: municipality,
|
||||
child: Text(municipality
|
||||
.cityDescription!), // Use cityDescription instead of cityName
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (selectedCity) {
|
||||
if (selectedCity != null) {
|
||||
final selectedCityCode =
|
||||
selectedCity.cityCode;
|
||||
setState(() {
|
||||
cityCode =
|
||||
selectedCityCode!;
|
||||
cityDesc = selectedCity
|
||||
.cityDescription!;
|
||||
});
|
||||
final barangayBloc =
|
||||
context.read<
|
||||
LandSubClassificationBloc>();
|
||||
barangayBloc.add(
|
||||
LoadLandSubClassification(
|
||||
classCode:
|
||||
classCode!,
|
||||
cityCode:
|
||||
selectedCityCode!)); // Use selectedCityCode directly
|
||||
}
|
||||
},
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 10,
|
||||
right: 0,
|
||||
bottom: 0),
|
||||
child: Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderDropdown<
|
||||
LandClassification>(
|
||||
name: 'classification',
|
||||
autofocus: false,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
_classDesc
|
||||
.toString() ??
|
||||
"Classification",
|
||||
""),
|
||||
items: classification
|
||||
.map((classification) =>
|
||||
DropdownMenuItem<
|
||||
LandClassification>(
|
||||
value:
|
||||
classification,
|
||||
child: Text(
|
||||
classification
|
||||
.description!), // Use cityDescription instead of cityName
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (selectedClass) {
|
||||
if (selectedClass != null) {
|
||||
final selectedClassCode =
|
||||
selectedClass.id;
|
||||
setState(() {
|
||||
classCode =
|
||||
selectedClassCode!;
|
||||
_classDesc =
|
||||
selectedClass
|
||||
.description!;
|
||||
});
|
||||
final barangayBloc =
|
||||
context.read<
|
||||
LandSubClassificationBloc>();
|
||||
barangayBloc.add(
|
||||
LoadLandSubClassification(
|
||||
classCode:
|
||||
selectedClassCode!,
|
||||
cityCode:
|
||||
cityCode)); // Use selectedCityCode directly
|
||||
}
|
||||
},
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0,
|
||||
top: 10,
|
||||
right: 0,
|
||||
bottom: 0),
|
||||
child: SizedBox(
|
||||
height: 45,
|
||||
child: SearchField(
|
||||
itemHeight: 70,
|
||||
suggestions: subclassification
|
||||
.map((LandSubClassification
|
||||
subclass) =>
|
||||
SearchFieldListItem(
|
||||
'${subclass.subclassCode} - ${subclass.subclassDescription}',
|
||||
item: subclass,
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
'${subclass.subclassCode} - ${subclass.subclassDescription!.toUpperCase()}',
|
||||
overflow:
|
||||
TextOverflow
|
||||
.ellipsis,
|
||||
),
|
||||
)))
|
||||
.toList(),
|
||||
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
|
||||
searchInputDecoration:
|
||||
normalTextFieldStyle(
|
||||
"Structure Type",
|
||||
"")
|
||||
.copyWith(
|
||||
suffixIcon:
|
||||
const Icon(Icons
|
||||
.arrow_drop_down)),
|
||||
////agency suggestion tap
|
||||
focusNode: focus,
|
||||
suggestionState:
|
||||
Suggestion.expand,
|
||||
onSuggestionTap: (subclass) {
|
||||
setState(() {
|
||||
_unitBase = double.parse(
|
||||
subclass.item!
|
||||
.baseUnitMarketval!);
|
||||
_subClassDesc =
|
||||
'${subclass.item!.subclassCode} - ${subclass.item!.subclassDescription}';
|
||||
});
|
||||
focus.unfocus();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
FormBuilderTextField(
|
||||
name: 'land_appraisal_area',
|
||||
decoration: normalTextFieldStyle(
|
||||
"Area", ""),
|
||||
validator:
|
||||
FormBuilderValidators.compose(
|
||||
[]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_areaValue = int.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱")
|
||||
.format(
|
||||
_totalMarketValue(
|
||||
_unitBase,
|
||||
_areaValue)))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
final tempID =
|
||||
await SharedPreferences
|
||||
.getInstance();
|
||||
print(tempID
|
||||
.getInt('landid'));
|
||||
var land_appraisal = LandAppr(
|
||||
landapprDetailsId:
|
||||
widget.tempId,
|
||||
classification:
|
||||
_classDesc,
|
||||
subClass: _subClassDesc,
|
||||
area: _areaValue
|
||||
.toString(),
|
||||
unitValue: _unitBase
|
||||
.toString(),
|
||||
baseMarketval:
|
||||
_totalMarketValue(
|
||||
_unitBase,
|
||||
_areaValue)
|
||||
.toString());
|
||||
|
||||
context
|
||||
.read<
|
||||
LandAppraisalBloc>()
|
||||
.add(AddLandAppraisal(
|
||||
land_appr:
|
||||
land_appraisal));
|
||||
},
|
||||
style:
|
||||
ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Submit"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width:
|
||||
5), // Use SizedBox for horizontal spacing in a Row
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
.read<
|
||||
LandAppraisalBloc>()
|
||||
.add(
|
||||
LoadLandAppraisalEdit(
|
||||
land_appr: <
|
||||
LandAppr>[],
|
||||
id: widget.tempId,
|
||||
));
|
||||
},
|
||||
style:
|
||||
ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Cancel"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
if (state is MunicipalityErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<MunicipalityBloc>()
|
||||
.add(LoadMunicipality());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is LandSubClassificationErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<LandSubClassificationBloc>().add(
|
||||
const LoadLandSubClassification(
|
||||
cityCode: '1', classCode: 1));
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is LandClassificationErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<LandClassificationBloc>()
|
||||
.add(LoadLandClassification());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is LandAppraisalErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<LandAppraisalBloc>().add(LoadLandAppraisal());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,358 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_trees_improvements/land_trees_improvements_bloc.dart';
|
||||
import 'package:unit2/bloc/passo/land/other_improvements/other_improvements_bloc.dart';
|
||||
import 'package:unit2/model/passo/other_improvements.dart';
|
||||
import 'package:unit2/model/passo/trees_improvements.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
|
||||
class AddOtherImprovementEditModal extends StatefulWidget {
|
||||
// final List<UnitConstruct> unit;
|
||||
// final List<ClassComponents> options;
|
||||
final int tempId;
|
||||
|
||||
AddOtherImprovementEditModal(this.tempId);
|
||||
|
||||
@override
|
||||
_AddOtherImprovementEditModal createState() =>
|
||||
_AddOtherImprovementEditModal();
|
||||
}
|
||||
|
||||
class _AddOtherImprovementEditModal
|
||||
extends State<AddOtherImprovementEditModal> {
|
||||
final focus = FocusNode();
|
||||
bool isPainted = false;
|
||||
bool isSecondHand = false;
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
double _unitBase = 0;
|
||||
int _areaValue = 0;
|
||||
final double _depValue = 0;
|
||||
double _unitValue = 0;
|
||||
String _subClassDesc = "";
|
||||
int _classId = 0;
|
||||
String _structureType = "";
|
||||
int _notPaintedUnitVal = 0;
|
||||
int _secondHandUnitVal = 0;
|
||||
String cityCode = '';
|
||||
String cityDesc = '';
|
||||
int classCode = 1;
|
||||
String _classDesc = '';
|
||||
String _treeType = "";
|
||||
bool _nonfruitBearing = false;
|
||||
bool _fruitBearing = false;
|
||||
int qty = 0;
|
||||
int pr_qty = 0;
|
||||
int nonpr_qty = 0;
|
||||
|
||||
GlobalKey<FormBuilderState> otherImpKey = GlobalKey<FormBuilderState>();
|
||||
|
||||
final typeOfTree = [
|
||||
"Non-Fruit Bearing",
|
||||
"Fruit Bearing",
|
||||
];
|
||||
|
||||
_calculateBaseMarketValue() {
|
||||
double base = 0.00;
|
||||
if (_fruitBearing) {
|
||||
base = (pr_qty + nonpr_qty) * _unitValue;
|
||||
} else {
|
||||
base = qty * _unitValue;
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
BoxDecoration box1() {
|
||||
return const BoxDecoration(boxShadow: [
|
||||
BoxShadow(color: Colors.black12, spreadRadius: 5, blurRadius: 5)
|
||||
], color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(3)));
|
||||
}
|
||||
|
||||
double _amountofDepreciation(unitVal, unitBase, area, depreciation) {
|
||||
return ((unitVal * unitBase) * area) * depreciation;
|
||||
}
|
||||
|
||||
double _totalMarketValue(unitBase, area) {
|
||||
return unitBase * area;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<OtherImprovementsBloc, OtherImprovementsState>(
|
||||
buildWhen: (previous, current) {
|
||||
return false;
|
||||
}, builder: (context, state) {
|
||||
if (state is ShowAddOtherImprovementScreen) {
|
||||
return BlocConsumer<LandTreesImprovementsBloc,
|
||||
LandTreesImprovementsState>(listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
}, builder: (context, state) {
|
||||
if (state is LandTreesImprovementsLoaded) {
|
||||
final trees = state.trees_imp;
|
||||
return FormBuilder(
|
||||
key: otherImpKey,
|
||||
onChanged: () {
|
||||
otherImpKey.currentState?.save();
|
||||
},
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 0, top: 10, right: 0, bottom: 0),
|
||||
child: Expanded(
|
||||
flex: 1,
|
||||
child: FormBuilderDropdown<TreesImprovements>(
|
||||
name: 'kinds_of_trees',
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Kinds of Trees", ""),
|
||||
items: state.trees_imp
|
||||
.map((trees) =>
|
||||
DropdownMenuItem<TreesImprovements>(
|
||||
value: trees,
|
||||
child: Text(
|
||||
(trees.improvement ?? "") +
|
||||
" " +
|
||||
(trees.subclassCode ?? ""),
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (selectedTree) {
|
||||
if (selectedTree != null) {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
selectedTree.pricePerTree!);
|
||||
_treeType = selectedTree.improvement!;
|
||||
});
|
||||
}
|
||||
},
|
||||
)),
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: _fruitBearing,
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
_fruitBearing = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
Text('Fruit Bearing ?'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: !_fruitBearing,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: FormBuilderTextField(
|
||||
name: 'subClass',
|
||||
decoration: normalTextFieldStyle(
|
||||
"SubClass/Age", ""),
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_subClassDesc = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: FormBuilderTextField(
|
||||
name: 'qty',
|
||||
decoration: normalTextFieldStyle("No.", ""),
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
qty = int.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
replacement: Column(
|
||||
children: [
|
||||
FormBuilderTextField(
|
||||
name: 'no_of_productive',
|
||||
decoration: normalTextFieldStyle(
|
||||
"No. of Productive", ""),
|
||||
validator: FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
pr_qty = int.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
FormBuilderTextField(
|
||||
name: 'no_of_nonproductive',
|
||||
decoration: normalTextFieldStyle(
|
||||
"No. of Non-Productive", ""),
|
||||
validator: FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
nonpr_qty = int.parse(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH', symbol: "₱")
|
||||
.format(_unitValue))),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text('Base Market Value'),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
height: 45.0,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱",
|
||||
).format(_calculateBaseMarketValue().toString() ==
|
||||
"0.00"
|
||||
? "00.0"
|
||||
: _calculateBaseMarketValue())),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
var improvement = OtherImprovements(
|
||||
landapprDetailsId: widget.tempId,
|
||||
kindsOfTrees: _treeType,
|
||||
subclassAge: _subClassDesc,
|
||||
quantity: qty,
|
||||
unitValue: _unitValue.toString(),
|
||||
baseMarketval:
|
||||
_calculateBaseMarketValue()
|
||||
.toString(),
|
||||
noOfProductive: pr_qty,
|
||||
noOfNonproductive: nonpr_qty,
|
||||
fruitBearing:
|
||||
_fruitBearing == true ? "1" : "0");
|
||||
|
||||
context.read<OtherImprovementsBloc>().add(
|
||||
AddOtherImprovement(
|
||||
other_imp: improvement));
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Submit"),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width:
|
||||
5), // Use SizedBox for horizontal spacing in a Row
|
||||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context.read<OtherImprovementsBloc>().add(
|
||||
LoadOtherImprovementEdit(
|
||||
other_imps: <OtherImprovements>[],
|
||||
ids: widget.tempId));
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Cancel"),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
if (state is LandTreesImprovementsErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<LandTreesImprovementsBloc>()
|
||||
.add(LoadLandTreesImprovements());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
if (state is OtherImprovementErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<OtherImprovementsBloc>().add(LoadOtherImprovement());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
});
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue