Fix minor bugs on transactional items; added building structure transactional; change ui of property assessment and property appraisal
parent
5b1752b813
commit
a8f7fc8d7c
|
@ -22,7 +22,11 @@ class SignatoriesAdminBloc
|
||||||
signatoryId: event.signatoryId,
|
signatoryId: event.signatoryId,
|
||||||
firstname: event.firstname,
|
firstname: event.firstname,
|
||||||
middlename: event.middlename,
|
middlename: event.middlename,
|
||||||
lastname: event.lastname));
|
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 firstname;
|
||||||
final String middlename;
|
final String middlename;
|
||||||
final String lastname;
|
final String lastname;
|
||||||
|
final String genCode;
|
||||||
|
final String designation;
|
||||||
|
// final String status;
|
||||||
|
|
||||||
const AddSignatories({
|
const AddSignatories({
|
||||||
required this.id,
|
required this.id,
|
||||||
|
@ -20,6 +23,9 @@ class AddSignatories extends SignatoriesAdminEvent {
|
||||||
required this.firstname,
|
required this.firstname,
|
||||||
required this.middlename,
|
required this.middlename,
|
||||||
required this.lastname,
|
required this.lastname,
|
||||||
|
required this.genCode,
|
||||||
|
required this.designation,
|
||||||
|
// required this.status
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -29,6 +35,9 @@ class AddSignatories extends SignatoriesAdminEvent {
|
||||||
firstname,
|
firstname,
|
||||||
middlename,
|
middlename,
|
||||||
lastname,
|
lastname,
|
||||||
|
genCode,
|
||||||
|
designation,
|
||||||
|
// status
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,8 @@ class UnitConstructionAdminBloc
|
||||||
id: event.id,
|
id: event.id,
|
||||||
bldgType: event.bldgType,
|
bldgType: event.bldgType,
|
||||||
building: event.building,
|
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 bldgType;
|
||||||
final String building;
|
final String building;
|
||||||
final String unitValue;
|
final String unitValue;
|
||||||
|
final String genCode;
|
||||||
|
|
||||||
const AddUnitConstruct({
|
const AddUnitConstruct({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.bldgType,
|
required this.bldgType,
|
||||||
required this.building,
|
required this.building,
|
||||||
required this.unitValue,
|
required this.unitValue,
|
||||||
|
required this.genCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [
|
List<Object> get props => [id, bldgType, building, unitValue, genCode];
|
||||||
id,
|
|
||||||
bldgType,
|
|
||||||
building,
|
|
||||||
unitValue,
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class LoadUnitConstruct extends UnitConstructionAdminEvent {
|
class LoadUnitConstruct extends UnitConstructionAdminEvent {
|
||||||
|
|
|
@ -55,7 +55,8 @@ class AdditionalItemsOfflineBloc
|
||||||
secondhand: event.secondhand == true ? '1' : '0',
|
secondhand: event.secondhand == true ? '1' : '0',
|
||||||
paintedUnitval: event.paintedUnitval,
|
paintedUnitval: event.paintedUnitval,
|
||||||
secondhandUnitval: event.secondhandUnitval,
|
secondhandUnitval: event.secondhandUnitval,
|
||||||
actualUse: event.actualUse));
|
actualUse: event.actualUse,
|
||||||
|
genCode: event.genCode));
|
||||||
|
|
||||||
print(item.toJson());
|
print(item.toJson());
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ class AddAdditionalItems extends AdditionalItemsOfflineEvent {
|
||||||
final dynamic paintedUnitval;
|
final dynamic paintedUnitval;
|
||||||
final dynamic secondhandUnitval;
|
final dynamic secondhandUnitval;
|
||||||
final String actualUse;
|
final String actualUse;
|
||||||
|
final String genCode;
|
||||||
|
|
||||||
const AddAdditionalItems({
|
const AddAdditionalItems({
|
||||||
required this.id,
|
required this.id,
|
||||||
|
@ -71,6 +72,7 @@ class AddAdditionalItems extends AdditionalItemsOfflineEvent {
|
||||||
required this.paintedUnitval,
|
required this.paintedUnitval,
|
||||||
required this.secondhandUnitval,
|
required this.secondhandUnitval,
|
||||||
required this.actualUse,
|
required this.actualUse,
|
||||||
|
required this.genCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -95,7 +97,8 @@ class AddAdditionalItems extends AdditionalItemsOfflineEvent {
|
||||||
secondhand,
|
secondhand,
|
||||||
paintedUnitval,
|
paintedUnitval,
|
||||||
secondhandUnitval,
|
secondhandUnitval,
|
||||||
actualUse
|
actualUse,
|
||||||
|
genCode
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,8 @@ class BldgAppraisalOfflineBloc
|
||||||
totalpercentDepreciation: event.totalpercentDepreciation,
|
totalpercentDepreciation: event.totalpercentDepreciation,
|
||||||
marketValue: event.marketValue,
|
marketValue: event.marketValue,
|
||||||
totalArea: event.totalArea,
|
totalArea: event.totalArea,
|
||||||
actualUse: event.actualUse));
|
actualUse: event.actualUse,
|
||||||
|
));
|
||||||
});
|
});
|
||||||
on<FetchSingleBldgAppraisal>((event, emit) async {
|
on<FetchSingleBldgAppraisal>((event, emit) async {
|
||||||
List<Map<String, dynamic>> result =
|
List<Map<String, dynamic>> result =
|
||||||
|
|
|
@ -25,6 +25,7 @@ class AddBldgAppraisal extends BldgAppraisalOfflineEvent {
|
||||||
final String marketValue;
|
final String marketValue;
|
||||||
final String totalArea;
|
final String totalArea;
|
||||||
final String actualUse;
|
final String actualUse;
|
||||||
|
final String genCode;
|
||||||
|
|
||||||
const AddBldgAppraisal(
|
const AddBldgAppraisal(
|
||||||
{required this.id,
|
{required this.id,
|
||||||
|
@ -43,7 +44,8 @@ class AddBldgAppraisal extends BldgAppraisalOfflineEvent {
|
||||||
required this.totalpercentDepreciation,
|
required this.totalpercentDepreciation,
|
||||||
required this.marketValue,
|
required this.marketValue,
|
||||||
required this.totalArea,
|
required this.totalArea,
|
||||||
required this.actualUse});
|
required this.actualUse,
|
||||||
|
required this.genCode});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [
|
List<Object> get props => [
|
||||||
|
@ -63,7 +65,8 @@ class AddBldgAppraisal extends BldgAppraisalOfflineEvent {
|
||||||
totalpercentDepreciation,
|
totalpercentDepreciation,
|
||||||
marketValue,
|
marketValue,
|
||||||
totalArea,
|
totalArea,
|
||||||
actualUse
|
actualUse,
|
||||||
|
genCode
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,13 +15,17 @@ class BldgAssessmentOfflineBloc
|
||||||
await SQLServices.instance.createBldgAssessment(PropertyAssessment(
|
await SQLServices.instance.createBldgAssessment(PropertyAssessment(
|
||||||
id: event.id,
|
id: event.id,
|
||||||
bldgapprDetailsId: event.bldgapprDetailsId,
|
bldgapprDetailsId: event.bldgapprDetailsId,
|
||||||
|
assessedById: event.assessedById,
|
||||||
|
assessedByName: event.assessedByName,
|
||||||
|
dateCreated: event.dateCreated,
|
||||||
|
dateModified: event.dateModified,
|
||||||
actualUse: event.actualUse,
|
actualUse: event.actualUse,
|
||||||
marketValue: event.marketValue,
|
marketValue: event.marketValue,
|
||||||
assessmentLevel: event.assessmentLevel,
|
assessmentLevel: event.assessmentLevel,
|
||||||
assessedValue: event.assessedValue,
|
assessedValue: event.assessedValue,
|
||||||
taxable: event.taxable,
|
taxable: event.taxable,
|
||||||
exempt: event.exempt,
|
exempt: event.exempt,
|
||||||
qtr: event.qtr.toString(),
|
qtr: event.qtr,
|
||||||
yr: event.yr.toString(),
|
yr: event.yr.toString(),
|
||||||
appraisedbyName: event.appraisedbyName,
|
appraisedbyName: event.appraisedbyName,
|
||||||
appraisedbyDate: event.appraisedbyDate,
|
appraisedbyDate: event.appraisedbyDate,
|
||||||
|
@ -32,7 +36,12 @@ class BldgAssessmentOfflineBloc
|
||||||
swornstatementNo: event.swornstatementNo,
|
swornstatementNo: event.swornstatementNo,
|
||||||
dateReceived: event.dateReceived,
|
dateReceived: event.dateReceived,
|
||||||
entryDateAssessment: event.entryDateAssessment,
|
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 {
|
on<FetchSingleBldgAssessment>((event, emit) async {
|
||||||
List<Map<String, dynamic>> result =
|
List<Map<String, dynamic>> result =
|
||||||
|
|
|
@ -20,7 +20,7 @@ class AddBldgAssessment extends BldgAssessmentOfflineEvent {
|
||||||
final String assessedValue;
|
final String assessedValue;
|
||||||
final String taxable;
|
final String taxable;
|
||||||
final String exempt;
|
final String exempt;
|
||||||
final int qtr;
|
final String qtr;
|
||||||
final int yr;
|
final int yr;
|
||||||
final String appraisedbyName;
|
final String appraisedbyName;
|
||||||
final String appraisedbyDate;
|
final String appraisedbyDate;
|
||||||
|
@ -32,6 +32,11 @@ class AddBldgAssessment extends BldgAssessmentOfflineEvent {
|
||||||
final String dateReceived;
|
final String dateReceived;
|
||||||
final String entryDateAssessment;
|
final String entryDateAssessment;
|
||||||
final String entryDateBy;
|
final String entryDateBy;
|
||||||
|
final String genCode;
|
||||||
|
final String note;
|
||||||
|
final String appraisedbyDesignation;
|
||||||
|
final String recommendapprDesignation;
|
||||||
|
final String approvedbyDesignation;
|
||||||
|
|
||||||
const AddBldgAssessment({
|
const AddBldgAssessment({
|
||||||
required this.id,
|
required this.id,
|
||||||
|
@ -58,6 +63,11 @@ class AddBldgAssessment extends BldgAssessmentOfflineEvent {
|
||||||
required this.dateReceived,
|
required this.dateReceived,
|
||||||
required this.entryDateAssessment,
|
required this.entryDateAssessment,
|
||||||
required this.entryDateBy,
|
required this.entryDateBy,
|
||||||
|
required this.genCode,
|
||||||
|
required this.note,
|
||||||
|
required this.appraisedbyDesignation,
|
||||||
|
required this.recommendapprDesignation,
|
||||||
|
required this.approvedbyDesignation,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -86,6 +96,11 @@ class AddBldgAssessment extends BldgAssessmentOfflineEvent {
|
||||||
dateReceived,
|
dateReceived,
|
||||||
entryDateAssessment,
|
entryDateAssessment,
|
||||||
entryDateBy,
|
entryDateBy,
|
||||||
|
genCode,
|
||||||
|
note,
|
||||||
|
appraisedbyDesignation,
|
||||||
|
recommendapprDesignation,
|
||||||
|
approvedbyDesignation,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,8 @@ class GeneralDescriptionBloc
|
||||||
totalFloorArea: event.totalFloorArea,
|
totalFloorArea: event.totalFloorArea,
|
||||||
floorSketch: event.floorSketch,
|
floorSketch: event.floorSketch,
|
||||||
actualUse: event.actualUse,
|
actualUse: event.actualUse,
|
||||||
unitValue: event.unitValue));
|
unitValue: event.unitValue,
|
||||||
|
genCode: event.genCode));
|
||||||
});
|
});
|
||||||
on<FetchSingleGeneralDescription>((event, emit) async {
|
on<FetchSingleGeneralDescription>((event, emit) async {
|
||||||
List<Map<String, dynamic>> result =
|
List<Map<String, dynamic>> result =
|
||||||
|
|
|
@ -33,6 +33,7 @@ class AddGendesc extends GeneralDescriptionEvent {
|
||||||
final dynamic floorSketch;
|
final dynamic floorSketch;
|
||||||
final String actualUse;
|
final String actualUse;
|
||||||
final String unitValue;
|
final String unitValue;
|
||||||
|
final String genCode;
|
||||||
|
|
||||||
const AddGendesc(
|
const AddGendesc(
|
||||||
{required this.id,
|
{required this.id,
|
||||||
|
@ -59,7 +60,8 @@ class AddGendesc extends GeneralDescriptionEvent {
|
||||||
required this.totalFloorArea,
|
required this.totalFloorArea,
|
||||||
required this.floorSketch,
|
required this.floorSketch,
|
||||||
required this.actualUse,
|
required this.actualUse,
|
||||||
required this.unitValue});
|
required this.unitValue,
|
||||||
|
required this.genCode});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [
|
List<Object> get props => [
|
||||||
|
@ -87,7 +89,8 @@ class AddGendesc extends GeneralDescriptionEvent {
|
||||||
totalFloorArea,
|
totalFloorArea,
|
||||||
floorSketch,
|
floorSketch,
|
||||||
actualUse,
|
actualUse,
|
||||||
unitValue
|
unitValue,
|
||||||
|
genCode
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,8 @@ class LandrefLocationBloc
|
||||||
tdn: event.tdn,
|
tdn: event.tdn,
|
||||||
area: event.area,
|
area: event.area,
|
||||||
surveyNo: event.surveyNo,
|
surveyNo: event.surveyNo,
|
||||||
blkNo: event.blkNo),
|
blkNo: event.blkNo,
|
||||||
|
genCode: event.genCode),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -51,8 +52,8 @@ class LandrefLocationBloc
|
||||||
bldgapprDetailsId: result[0]["bldgapprDetailsId"],
|
bldgapprDetailsId: result[0]["bldgapprDetailsId"],
|
||||||
assessedById: result[0]["assessedById"],
|
assessedById: result[0]["assessedById"],
|
||||||
assessedByName: result[0]["assessedByName"],
|
assessedByName: result[0]["assessedByName"],
|
||||||
dateCreated: DateTime.now(),
|
dateCreated: DateTime.now().toString(),
|
||||||
dateModified: DateTime.now(),
|
dateModified: DateTime.now().toString(),
|
||||||
owner: result[0]["owner"],
|
owner: result[0]["owner"],
|
||||||
cloaNo: result[0]["cloaNo"],
|
cloaNo: result[0]["cloaNo"],
|
||||||
lotNo: result[0]["lotNo"],
|
lotNo: result[0]["lotNo"],
|
||||||
|
|
|
@ -21,6 +21,7 @@ class AddLandRef extends LandrefLocationEvent {
|
||||||
final dynamic blkNo;
|
final dynamic blkNo;
|
||||||
final String dateCreated;
|
final String dateCreated;
|
||||||
final String dateModified;
|
final String dateModified;
|
||||||
|
final String genCode;
|
||||||
|
|
||||||
const AddLandRef(
|
const AddLandRef(
|
||||||
{required this.id,
|
{required this.id,
|
||||||
|
@ -35,7 +36,8 @@ class AddLandRef extends LandrefLocationEvent {
|
||||||
required this.surveyNo,
|
required this.surveyNo,
|
||||||
required this.blkNo,
|
required this.blkNo,
|
||||||
required this.dateCreated,
|
required this.dateCreated,
|
||||||
required this.dateModified});
|
required this.dateModified,
|
||||||
|
required this.genCode});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [
|
List<Object> get props => [
|
||||||
|
@ -51,7 +53,8 @@ class AddLandRef extends LandrefLocationEvent {
|
||||||
surveyNo,
|
surveyNo,
|
||||||
blkNo,
|
blkNo,
|
||||||
dateCreated,
|
dateCreated,
|
||||||
dateModified
|
dateModified,
|
||||||
|
genCode
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ class LocationBloc extends Bloc<LocationEvent, LocationState> {
|
||||||
barangay: event.barangay,
|
barangay: event.barangay,
|
||||||
municipality: event.municipality,
|
municipality: event.municipality,
|
||||||
province: event.province,
|
province: event.province,
|
||||||
));
|
genCode: event.genCode));
|
||||||
});
|
});
|
||||||
on<FetchSingleLocation>((event, emit) async {
|
on<FetchSingleLocation>((event, emit) async {
|
||||||
List<Map<String, dynamic>> result =
|
List<Map<String, dynamic>> result =
|
||||||
|
|
|
@ -18,6 +18,7 @@ class AddLocation extends LocationEvent {
|
||||||
final String province;
|
final String province;
|
||||||
final String dateCreated;
|
final String dateCreated;
|
||||||
final String dateModified;
|
final String dateModified;
|
||||||
|
final String genCode;
|
||||||
|
|
||||||
const AddLocation(
|
const AddLocation(
|
||||||
{required this.id,
|
{required this.id,
|
||||||
|
@ -29,7 +30,8 @@ class AddLocation extends LocationEvent {
|
||||||
required this.municipality,
|
required this.municipality,
|
||||||
required this.province,
|
required this.province,
|
||||||
required this.dateCreated,
|
required this.dateCreated,
|
||||||
required this.dateModified});
|
required this.dateModified,
|
||||||
|
required this.genCode});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [
|
List<Object> get props => [
|
||||||
|
@ -41,7 +43,8 @@ class AddLocation extends LocationEvent {
|
||||||
municipality,
|
municipality,
|
||||||
province,
|
province,
|
||||||
dateCreated,
|
dateCreated,
|
||||||
dateModified
|
dateModified,
|
||||||
|
genCode
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,10 @@ class CrudBloc extends Bloc<CrudEvent, CrudState> {
|
||||||
transCode: event.transCode,
|
transCode: event.transCode,
|
||||||
tdn: event.tdn,
|
tdn: event.tdn,
|
||||||
pin: event.pin,
|
pin: event.pin,
|
||||||
owner: event.owner,
|
fname: event.fname,
|
||||||
|
mname: event.mname,
|
||||||
|
lname: event.lname,
|
||||||
|
bday: event.bday,
|
||||||
address: event.address,
|
address: event.address,
|
||||||
telno: event.telno,
|
telno: event.telno,
|
||||||
tin: event.tin,
|
tin: event.tin,
|
||||||
|
@ -31,7 +34,8 @@ class CrudBloc extends Bloc<CrudEvent, CrudState> {
|
||||||
assessedById: event.assessedById,
|
assessedById: event.assessedById,
|
||||||
assessedByName: event.assessedByName,
|
assessedByName: event.assessedByName,
|
||||||
dateCreated: event.dateCreated,
|
dateCreated: event.dateCreated,
|
||||||
dateModified: event.dateModified),
|
dateModified: event.dateModified,
|
||||||
|
genCode: event.genCode),
|
||||||
);
|
);
|
||||||
|
|
||||||
propertyOwner.add(ownerInfo);
|
propertyOwner.add(ownerInfo);
|
||||||
|
|
|
@ -9,7 +9,10 @@ class AddTodo extends CrudEvent {
|
||||||
final String transCode;
|
final String transCode;
|
||||||
final String tdn;
|
final String tdn;
|
||||||
final String pin;
|
final String pin;
|
||||||
final String owner;
|
final String fname;
|
||||||
|
final String mname;
|
||||||
|
final String lname;
|
||||||
|
final String bday;
|
||||||
final String address;
|
final String address;
|
||||||
final String telno;
|
final String telno;
|
||||||
final String tin;
|
final String tin;
|
||||||
|
@ -22,13 +25,17 @@ class AddTodo extends CrudEvent {
|
||||||
final String assessedByName;
|
final String assessedByName;
|
||||||
final String dateCreated;
|
final String dateCreated;
|
||||||
final String dateModified;
|
final String dateModified;
|
||||||
|
final String genCode;
|
||||||
|
|
||||||
const AddTodo(
|
const AddTodo(
|
||||||
{required this.id,
|
{required this.id,
|
||||||
required this.transCode,
|
required this.transCode,
|
||||||
required this.tdn,
|
required this.tdn,
|
||||||
required this.pin,
|
required this.pin,
|
||||||
required this.owner,
|
required this.fname,
|
||||||
|
required this.mname,
|
||||||
|
required this.lname,
|
||||||
|
required this.bday,
|
||||||
required this.address,
|
required this.address,
|
||||||
required this.telno,
|
required this.telno,
|
||||||
required this.tin,
|
required this.tin,
|
||||||
|
@ -40,7 +47,8 @@ class AddTodo extends CrudEvent {
|
||||||
required this.assessedById,
|
required this.assessedById,
|
||||||
required this.assessedByName,
|
required this.assessedByName,
|
||||||
required this.dateCreated,
|
required this.dateCreated,
|
||||||
required this.dateModified});
|
required this.dateModified,
|
||||||
|
required this.genCode});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object?> get props => [
|
List<Object?> get props => [
|
||||||
|
@ -48,7 +56,10 @@ class AddTodo extends CrudEvent {
|
||||||
transCode,
|
transCode,
|
||||||
tdn,
|
tdn,
|
||||||
pin,
|
pin,
|
||||||
owner,
|
fname,
|
||||||
|
mname,
|
||||||
|
lname,
|
||||||
|
bday,
|
||||||
address,
|
address,
|
||||||
telno,
|
telno,
|
||||||
tin,
|
tin,
|
||||||
|
@ -60,7 +71,8 @@ class AddTodo extends CrudEvent {
|
||||||
assessedById,
|
assessedById,
|
||||||
assessedByName,
|
assessedByName,
|
||||||
dateCreated,
|
dateCreated,
|
||||||
dateModified
|
dateModified,
|
||||||
|
genCode
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,11 @@ class StructuralMaterialOfflineBloc extends Bloc<StructuralMaterialOfflineEvent,
|
||||||
flooring: event.flooring!.join(', ').split(', '),
|
flooring: event.flooring!.join(', ').split(', '),
|
||||||
walls: event.walls!.join(', ').split(', '),
|
walls: event.walls!.join(', ').split(', '),
|
||||||
others: event.others!.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 {
|
on<FetchSingleStructuralMaterial>((event, emit) async {
|
||||||
List<Map<String, dynamic>> result =
|
List<Map<String, dynamic>> result =
|
||||||
|
|
|
@ -22,6 +22,7 @@ class AddStructuralMaterial extends StructuralMaterialOfflineEvent {
|
||||||
final String assessedByName;
|
final String assessedByName;
|
||||||
final String dateCreated;
|
final String dateCreated;
|
||||||
final String dateModified;
|
final String dateModified;
|
||||||
|
final String genCode;
|
||||||
|
|
||||||
const AddStructuralMaterial(
|
const AddStructuralMaterial(
|
||||||
{required this.id,
|
{required this.id,
|
||||||
|
@ -37,7 +38,8 @@ class AddStructuralMaterial extends StructuralMaterialOfflineEvent {
|
||||||
required this.assessedById,
|
required this.assessedById,
|
||||||
required this.assessedByName,
|
required this.assessedByName,
|
||||||
required this.dateCreated,
|
required this.dateCreated,
|
||||||
required this.dateModified});
|
required this.dateModified,
|
||||||
|
required this.genCode});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [
|
List<Object> get props => [
|
||||||
|
@ -54,7 +56,8 @@ class AddStructuralMaterial extends StructuralMaterialOfflineEvent {
|
||||||
assessedById,
|
assessedById,
|
||||||
assessedByName,
|
assessedByName,
|
||||||
dateCreated,
|
dateCreated,
|
||||||
dateModified
|
dateModified,
|
||||||
|
genCode
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,10 @@ class AdditionalItems {
|
||||||
final dynamic paintedUnitval;
|
final dynamic paintedUnitval;
|
||||||
final dynamic secondhandUnitval;
|
final dynamic secondhandUnitval;
|
||||||
final String actualUse;
|
final String actualUse;
|
||||||
|
final String genCode;
|
||||||
|
|
||||||
AdditionalItems({
|
AdditionalItems(
|
||||||
required this.id,
|
{required this.id,
|
||||||
required this.bldgapprDetailsId,
|
required this.bldgapprDetailsId,
|
||||||
required this.classId,
|
required this.classId,
|
||||||
required this.className,
|
required this.className,
|
||||||
|
@ -48,10 +49,10 @@ class AdditionalItems {
|
||||||
required this.paintedUnitval,
|
required this.paintedUnitval,
|
||||||
required this.secondhandUnitval,
|
required this.secondhandUnitval,
|
||||||
required this.actualUse,
|
required this.actualUse,
|
||||||
});
|
required this.genCode});
|
||||||
|
|
||||||
AdditionalItems copy({
|
AdditionalItems copy(
|
||||||
int? id,
|
{int? id,
|
||||||
int? bldgapprDetailsId,
|
int? bldgapprDetailsId,
|
||||||
int? classId,
|
int? classId,
|
||||||
String? className,
|
String? className,
|
||||||
|
@ -68,7 +69,7 @@ class AdditionalItems {
|
||||||
dynamic paintedUnitval,
|
dynamic paintedUnitval,
|
||||||
dynamic secondhandUnitval,
|
dynamic secondhandUnitval,
|
||||||
String? actualUse,
|
String? actualUse,
|
||||||
}) {
|
String? genCode}) {
|
||||||
return AdditionalItems(
|
return AdditionalItems(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||||
|
@ -86,7 +87,8 @@ class AdditionalItems {
|
||||||
secondhand: secondhand ?? this.secondhand,
|
secondhand: secondhand ?? this.secondhand,
|
||||||
paintedUnitval: paintedUnitval ?? this.paintedUnitval,
|
paintedUnitval: paintedUnitval ?? this.paintedUnitval,
|
||||||
secondhandUnitval: secondhandUnitval ?? this.secondhandUnitval,
|
secondhandUnitval: secondhandUnitval ?? this.secondhandUnitval,
|
||||||
actualUse: actualUse ?? this.actualUse);
|
actualUse: actualUse ?? this.actualUse,
|
||||||
|
genCode: genCode ?? this.genCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory AdditionalItems.fromJson(Map<String, dynamic> json) =>
|
factory AdditionalItems.fromJson(Map<String, dynamic> json) =>
|
||||||
|
@ -108,7 +110,7 @@ class AdditionalItems {
|
||||||
paintedUnitval: json["paintedUnitval"],
|
paintedUnitval: json["paintedUnitval"],
|
||||||
secondhandUnitval: json["secondhandUnitval"],
|
secondhandUnitval: json["secondhandUnitval"],
|
||||||
actualUse: json["actualUse"],
|
actualUse: json["actualUse"],
|
||||||
);
|
genCode: json["gen_code"]);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
|
@ -128,5 +130,6 @@ class AdditionalItems {
|
||||||
"painted_unitval": paintedUnitval,
|
"painted_unitval": paintedUnitval,
|
||||||
"secondhand_unitval": secondhandUnitval,
|
"secondhand_unitval": secondhandUnitval,
|
||||||
"actual_use": actualUse,
|
"actual_use": actualUse,
|
||||||
|
"gen_code": genCode
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,27 +14,30 @@ class Brgy {
|
||||||
final String? barangayCode;
|
final String? barangayCode;
|
||||||
final String? cityCode;
|
final String? cityCode;
|
||||||
final String? barangayDescription;
|
final String? barangayDescription;
|
||||||
|
final String? genCode;
|
||||||
|
|
||||||
Brgy({
|
Brgy(
|
||||||
this.id,
|
{this.id,
|
||||||
this.barangayId,
|
this.barangayId,
|
||||||
this.barangayCode,
|
this.barangayCode,
|
||||||
this.cityCode,
|
this.cityCode,
|
||||||
this.barangayDescription,
|
this.barangayDescription,
|
||||||
});
|
this.genCode});
|
||||||
|
|
||||||
Brgy copy(
|
Brgy copy(
|
||||||
{int? id,
|
{int? id,
|
||||||
int? barangayId,
|
int? barangayId,
|
||||||
String? barangayCode,
|
String? barangayCode,
|
||||||
String? cityCode,
|
String? cityCode,
|
||||||
String? barangayDescription}) {
|
String? barangayDescription,
|
||||||
|
String? genCode}) {
|
||||||
return Brgy(
|
return Brgy(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
barangayId: barangayId ?? this.barangayId,
|
barangayId: barangayId ?? this.barangayId,
|
||||||
barangayCode: barangayCode ?? this.barangayCode,
|
barangayCode: barangayCode ?? this.barangayCode,
|
||||||
cityCode: cityCode ?? this.cityCode,
|
cityCode: cityCode ?? this.cityCode,
|
||||||
barangayDescription: barangayDescription ?? this.barangayDescription);
|
barangayDescription: barangayDescription ?? this.barangayDescription,
|
||||||
|
genCode: genCode ?? this.genCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Brgy.fromJson(Map<String, dynamic> json) => Brgy(
|
factory Brgy.fromJson(Map<String, dynamic> json) => Brgy(
|
||||||
|
@ -43,6 +46,7 @@ class Brgy {
|
||||||
barangayCode: json["barangay_code"],
|
barangayCode: json["barangay_code"],
|
||||||
cityCode: json["city_code"],
|
cityCode: json["city_code"],
|
||||||
barangayDescription: json["barangay_description"],
|
barangayDescription: json["barangay_description"],
|
||||||
|
genCode: json["gen_code"],
|
||||||
);
|
);
|
||||||
|
|
||||||
factory Brgy.fromJson2(Map<String, dynamic> json) => Brgy(
|
factory Brgy.fromJson2(Map<String, dynamic> json) => Brgy(
|
||||||
|
@ -51,6 +55,7 @@ class Brgy {
|
||||||
barangayCode: json["barangayCode"],
|
barangayCode: json["barangayCode"],
|
||||||
cityCode: json["cityCode"],
|
cityCode: json["cityCode"],
|
||||||
barangayDescription: json["barangayDescription"],
|
barangayDescription: json["barangayDescription"],
|
||||||
|
genCode: json["gen_code"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
|
@ -59,5 +64,6 @@ class Brgy {
|
||||||
"barangay_code": barangayCode,
|
"barangay_code": barangayCode,
|
||||||
"city_code": cityCode,
|
"city_code": cityCode,
|
||||||
"barangay_description": barangayDescription,
|
"barangay_description": barangayDescription,
|
||||||
|
"gen_code": genCode,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,12 +13,13 @@ class BldgLoc {
|
||||||
final int? bldgapprDetailsId;
|
final int? bldgapprDetailsId;
|
||||||
final String? assessedById;
|
final String? assessedById;
|
||||||
final String? assessedByName;
|
final String? assessedByName;
|
||||||
final DateTime? dateCreated;
|
final String? dateCreated;
|
||||||
final DateTime? dateModified;
|
final String? dateModified;
|
||||||
final dynamic street;
|
final dynamic street;
|
||||||
final dynamic barangay;
|
final dynamic barangay;
|
||||||
final dynamic municipality;
|
final dynamic municipality;
|
||||||
final dynamic province;
|
final dynamic province;
|
||||||
|
final String? genCode;
|
||||||
|
|
||||||
BldgLoc({
|
BldgLoc({
|
||||||
this.id,
|
this.id,
|
||||||
|
@ -31,20 +32,21 @@ class BldgLoc {
|
||||||
this.barangay,
|
this.barangay,
|
||||||
this.municipality,
|
this.municipality,
|
||||||
this.province,
|
this.province,
|
||||||
|
this.genCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
BldgLoc copy({
|
BldgLoc copy(
|
||||||
int? id,
|
{int? id,
|
||||||
int? bldgapprDetailsId,
|
int? bldgapprDetailsId,
|
||||||
String? assessedById,
|
String? assessedById,
|
||||||
String? assessedByName,
|
String? assessedByName,
|
||||||
DateTime? dateCreated,
|
String? dateCreated,
|
||||||
DateTime? dateModified,
|
String? dateModified,
|
||||||
dynamic street,
|
dynamic street,
|
||||||
dynamic barangay,
|
dynamic barangay,
|
||||||
dynamic municipality,
|
dynamic municipality,
|
||||||
dynamic province,
|
dynamic province,
|
||||||
}) {
|
String? genCode}) {
|
||||||
return BldgLoc(
|
return BldgLoc(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||||
|
@ -55,7 +57,8 @@ class BldgLoc {
|
||||||
street: street ?? this.street,
|
street: street ?? this.street,
|
||||||
barangay: barangay ?? this.barangay,
|
barangay: barangay ?? this.barangay,
|
||||||
municipality: municipality ?? this.municipality,
|
municipality: municipality ?? this.municipality,
|
||||||
province: province ?? this.province);
|
province: province ?? this.province,
|
||||||
|
genCode: genCode ?? this.genCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory BldgLoc.fromJson(Map<String, dynamic> json) => BldgLoc(
|
factory BldgLoc.fromJson(Map<String, dynamic> json) => BldgLoc(
|
||||||
|
@ -63,16 +66,27 @@ class BldgLoc {
|
||||||
bldgapprDetailsId: json["bldgappr_details_id"],
|
bldgapprDetailsId: json["bldgappr_details_id"],
|
||||||
assessedById: json["assessed_by_id"],
|
assessedById: json["assessed_by_id"],
|
||||||
assessedByName: json["assessed_by_name"],
|
assessedByName: json["assessed_by_name"],
|
||||||
dateCreated: json["date_created"] == null
|
dateCreated: json["date_created"],
|
||||||
? null
|
dateModified: json["date_modified"],
|
||||||
: DateTime.parse(json["date_created"]),
|
|
||||||
dateModified: json["date_modified"] == null
|
|
||||||
? null
|
|
||||||
: DateTime.parse(json["date_modified"]),
|
|
||||||
street: json["street"],
|
street: json["street"],
|
||||||
barangay: json["barangay"],
|
barangay: json["barangay"],
|
||||||
municipality: json["municipality"],
|
municipality: json["municipality"],
|
||||||
province: json["province"],
|
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() => {
|
Map<String, dynamic> toJson() => {
|
||||||
|
@ -80,11 +94,12 @@ class BldgLoc {
|
||||||
"bldgappr_details_id": bldgapprDetailsId,
|
"bldgappr_details_id": bldgapprDetailsId,
|
||||||
"assessed_by_id": assessedById,
|
"assessed_by_id": assessedById,
|
||||||
"assessed_by_name": assessedByName,
|
"assessed_by_name": assessedByName,
|
||||||
"date_created": dateCreated?.toIso8601String(),
|
"date_created": dateCreated,
|
||||||
"date_modified": dateModified?.toIso8601String(),
|
"date_modified": dateModified,
|
||||||
"street": street,
|
"street": street,
|
||||||
"barangay": barangay,
|
"barangay": barangay,
|
||||||
"municipality": municipality,
|
"municipality": municipality,
|
||||||
"province": province,
|
"province": province,
|
||||||
|
"gen_code": genCode,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,119 +13,107 @@ String bldgAndStructureToJson(BldgAndStructure data) =>
|
||||||
class BldgAndStructure {
|
class BldgAndStructure {
|
||||||
final int? id;
|
final int? id;
|
||||||
final int? bldgapprDetailsId;
|
final int? bldgapprDetailsId;
|
||||||
final String? assessedById;
|
|
||||||
final String? assessedByName;
|
|
||||||
final String? dateCreated;
|
|
||||||
final String? dateModified;
|
|
||||||
final String? bldgType;
|
final String? bldgType;
|
||||||
final String? strucType;
|
final String? structType;
|
||||||
final String? description;
|
final String? description;
|
||||||
final String? actualUse;
|
final String? actualUse;
|
||||||
final String? floorCount;
|
final String? floorCount;
|
||||||
final String? bldgArea;
|
final String? bldgArea;
|
||||||
final String? unitValue;
|
final String? unitValue;
|
||||||
|
final String? buccPercentage;
|
||||||
final String? depRate;
|
final String? depRate;
|
||||||
final String? marketValue;
|
final String? marketValue;
|
||||||
final String? depAmount;
|
final String? depAmount;
|
||||||
final String? adjustedMarketValue;
|
final String? adjustedMarketValue;
|
||||||
|
final String? genCode;
|
||||||
|
|
||||||
BldgAndStructure({
|
BldgAndStructure({
|
||||||
this.id,
|
this.id,
|
||||||
this.bldgapprDetailsId,
|
this.bldgapprDetailsId,
|
||||||
this.assessedById,
|
|
||||||
this.assessedByName,
|
|
||||||
this.dateCreated,
|
|
||||||
this.dateModified,
|
|
||||||
this.bldgType,
|
this.bldgType,
|
||||||
this.strucType,
|
this.structType,
|
||||||
this.description,
|
this.description,
|
||||||
this.actualUse,
|
this.actualUse,
|
||||||
this.floorCount,
|
this.floorCount,
|
||||||
this.bldgArea,
|
this.bldgArea,
|
||||||
this.unitValue,
|
this.unitValue,
|
||||||
|
this.buccPercentage,
|
||||||
this.depRate,
|
this.depRate,
|
||||||
this.marketValue,
|
this.marketValue,
|
||||||
this.depAmount,
|
this.depAmount,
|
||||||
this.adjustedMarketValue,
|
this.adjustedMarketValue,
|
||||||
|
this.genCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
BldgAndStructure copy({
|
BldgAndStructure copy({
|
||||||
int? id,
|
int? id,
|
||||||
int? bldgapprDetailsId,
|
int? bldgapprDetailsId,
|
||||||
String? assessedById,
|
|
||||||
String? assessedByName,
|
|
||||||
String? dateCreated,
|
|
||||||
String? dateModified,
|
|
||||||
String? bldgType,
|
String? bldgType,
|
||||||
String? strucType,
|
String? structType,
|
||||||
String? description,
|
String? description,
|
||||||
String? actualUse,
|
String? actualUse,
|
||||||
String? floorCount,
|
String? floorCount,
|
||||||
String? bldgArea,
|
String? bldgArea,
|
||||||
String? unitValue,
|
String? unitValue,
|
||||||
|
String? buccPercentage,
|
||||||
String? depRate,
|
String? depRate,
|
||||||
String? marketValue,
|
String? marketValue,
|
||||||
String? depAmount,
|
String? depAmount,
|
||||||
String? adjustedMarketValue,
|
String? adjustedMarketValue,
|
||||||
|
String? genCode,
|
||||||
}) =>
|
}) =>
|
||||||
BldgAndStructure(
|
BldgAndStructure(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||||
assessedById: assessedById ?? this.assessedById,
|
|
||||||
assessedByName: assessedByName ?? this.assessedByName,
|
|
||||||
dateCreated: dateCreated ?? this.dateCreated,
|
|
||||||
dateModified: dateModified ?? this.dateModified,
|
|
||||||
bldgType: bldgType ?? this.bldgType,
|
bldgType: bldgType ?? this.bldgType,
|
||||||
strucType: strucType ?? this.strucType,
|
structType: structType ?? this.structType,
|
||||||
description: description ?? this.description,
|
description: description ?? this.description,
|
||||||
actualUse: actualUse ?? this.actualUse,
|
actualUse: actualUse ?? this.actualUse,
|
||||||
floorCount: floorCount ?? this.floorCount,
|
floorCount: floorCount ?? this.floorCount,
|
||||||
bldgArea: bldgArea ?? this.bldgArea,
|
bldgArea: bldgArea ?? this.bldgArea,
|
||||||
unitValue: unitValue ?? this.unitValue,
|
unitValue: unitValue ?? this.unitValue,
|
||||||
|
buccPercentage: buccPercentage ?? this.buccPercentage,
|
||||||
depRate: depRate ?? this.depRate,
|
depRate: depRate ?? this.depRate,
|
||||||
marketValue: marketValue ?? this.marketValue,
|
marketValue: marketValue ?? this.marketValue,
|
||||||
depAmount: depAmount ?? this.depAmount,
|
depAmount: depAmount ?? this.depAmount,
|
||||||
adjustedMarketValue: adjustedMarketValue ?? this.adjustedMarketValue,
|
adjustedMarketValue: adjustedMarketValue ?? this.adjustedMarketValue,
|
||||||
|
genCode: genCode ?? this.genCode,
|
||||||
);
|
);
|
||||||
|
|
||||||
factory BldgAndStructure.fromJson(Map<String, dynamic> json) =>
|
factory BldgAndStructure.fromJson(Map<String, dynamic> json) =>
|
||||||
BldgAndStructure(
|
BldgAndStructure(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
bldgapprDetailsId: json["bldgapprDetailsId"],
|
bldgapprDetailsId: json["bldgapprDetailsId"],
|
||||||
assessedById: json["assessedById"],
|
|
||||||
assessedByName: json["assessedByName"],
|
|
||||||
dateCreated: json["dateCreated"],
|
|
||||||
dateModified: json["dateModified"],
|
|
||||||
bldgType: json["bldgType"],
|
bldgType: json["bldgType"],
|
||||||
strucType: json["strucType"],
|
structType: json["structType"],
|
||||||
description: json["description"],
|
description: json["description"],
|
||||||
actualUse: json["actualUse"],
|
actualUse: json["actualUse"],
|
||||||
floorCount: json["floorCount"],
|
floorCount: json["floorCount"],
|
||||||
bldgArea: json["bldgArea"],
|
bldgArea: json["bldgArea"],
|
||||||
unitValue: json["unitValue"],
|
unitValue: json["unitValue"],
|
||||||
|
buccPercentage: json["buccPercentage"],
|
||||||
depRate: json["depRate"],
|
depRate: json["depRate"],
|
||||||
marketValue: json["marketValue"],
|
marketValue: json["marketValue"],
|
||||||
depAmount: json["depAmount"],
|
depAmount: json["depAmount"],
|
||||||
adjustedMarketValue: json["adjustedMarketValue"],
|
adjustedMarketValue: json["adjustedMarketValue"],
|
||||||
|
genCode: json["gen_code"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
"bldgapprDetailsId": bldgapprDetailsId,
|
"bldgappr_details_id": bldgapprDetailsId,
|
||||||
"assessedById": assessedById,
|
"bldg_type": bldgType,
|
||||||
"assessedByName": assessedByName,
|
"struct_type": structType,
|
||||||
"dateCreated": dateCreated,
|
|
||||||
"dateModified": dateModified,
|
|
||||||
"bldgType": bldgType,
|
|
||||||
"strucType": strucType,
|
|
||||||
"description": description,
|
"description": description,
|
||||||
"actualUse": actualUse,
|
"actual_use": actualUse,
|
||||||
"floorCount": floorCount,
|
"floor_count": floorCount,
|
||||||
"bldgArea": bldgArea,
|
"bldg_area": bldgArea,
|
||||||
"unitValue": unitValue,
|
"unit_value": unitValue,
|
||||||
"depRate": depRate,
|
"bucc_percentage": buccPercentage,
|
||||||
"marketValue": marketValue,
|
"dep_rate": depRate,
|
||||||
"depAmount": depAmount,
|
"market_value": marketValue,
|
||||||
"adjustedMarketValue": adjustedMarketValue,
|
"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 int? id;
|
||||||
final String? cityCode;
|
final String? cityCode;
|
||||||
final String? cityDescription;
|
final String? cityDescription;
|
||||||
|
final String? genCode;
|
||||||
|
|
||||||
City({
|
City({this.id, this.cityCode, this.cityDescription, this.genCode});
|
||||||
this.id,
|
|
||||||
this.cityCode,
|
|
||||||
this.cityDescription,
|
|
||||||
});
|
|
||||||
|
|
||||||
City copy({int? id, String? cityCode, String? cityDescription}) {
|
City copy(
|
||||||
|
{int? id, String? cityCode, String? cityDescription, String? genCode}) {
|
||||||
return City(
|
return City(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
cityCode: cityCode ?? this.cityCode,
|
cityCode: cityCode ?? this.cityCode,
|
||||||
cityDescription: cityDescription ?? this.cityDescription);
|
cityDescription: cityDescription ?? this.cityDescription,
|
||||||
|
genCode: genCode ?? this.genCode,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory City.fromJson(Map<String, dynamic> json) => City(
|
factory City.fromJson(Map<String, dynamic> json) => City(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
cityCode: json["city_code"],
|
cityCode: json["city_code"],
|
||||||
cityDescription: json["city_description"],
|
cityDescription: json["city_description"],
|
||||||
|
genCode: json["gen_code"],
|
||||||
);
|
);
|
||||||
|
|
||||||
factory City.fromJson2(Map<String, dynamic> json) => City(
|
factory City.fromJson2(Map<String, dynamic> json) => City(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
cityCode: json["cityCode"],
|
cityCode: json["cityCode"],
|
||||||
cityDescription: json["cityDescription"],
|
cityDescription: json["cityDescription"],
|
||||||
);
|
genCode: json["genCode"]);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
"city_code": cityCode,
|
"city_code": cityCode,
|
||||||
"city_description": cityDescription,
|
"city_description": cityDescription,
|
||||||
|
"gen_code": genCode
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ class ClassComponentsOffline {
|
||||||
final String? roughFinish;
|
final String? roughFinish;
|
||||||
final String? highFinish;
|
final String? highFinish;
|
||||||
final int? withoutBucc;
|
final int? withoutBucc;
|
||||||
|
// final String? genCode;
|
||||||
|
|
||||||
ClassComponentsOffline({
|
ClassComponentsOffline({
|
||||||
this.id,
|
this.id,
|
||||||
|
@ -48,6 +49,7 @@ class ClassComponentsOffline {
|
||||||
this.roughFinish,
|
this.roughFinish,
|
||||||
this.highFinish,
|
this.highFinish,
|
||||||
this.withoutBucc,
|
this.withoutBucc,
|
||||||
|
// this.genCode
|
||||||
});
|
});
|
||||||
|
|
||||||
ClassComponentsOffline copy({
|
ClassComponentsOffline copy({
|
||||||
|
@ -68,6 +70,7 @@ class ClassComponentsOffline {
|
||||||
String? roughFinish,
|
String? roughFinish,
|
||||||
String? highFinish,
|
String? highFinish,
|
||||||
int? withoutBucc,
|
int? withoutBucc,
|
||||||
|
// String? genCode,
|
||||||
}) {
|
}) {
|
||||||
return ClassComponentsOffline(
|
return ClassComponentsOffline(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
|
@ -89,6 +92,7 @@ class ClassComponentsOffline {
|
||||||
roughFinish: roughFinish ?? this.roughFinish,
|
roughFinish: roughFinish ?? this.roughFinish,
|
||||||
highFinish: highFinish ?? this.highFinish,
|
highFinish: highFinish ?? this.highFinish,
|
||||||
withoutBucc: withoutBucc ?? this.withoutBucc,
|
withoutBucc: withoutBucc ?? this.withoutBucc,
|
||||||
|
// genCode: genCode ?? this.genCode,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +115,7 @@ class ClassComponentsOffline {
|
||||||
roughFinish: json["rough_finish"],
|
roughFinish: json["rough_finish"],
|
||||||
highFinish: json["high_finish"],
|
highFinish: json["high_finish"],
|
||||||
withoutBucc: json["without_bucc"],
|
withoutBucc: json["without_bucc"],
|
||||||
|
// genCode: json["gen_code"],
|
||||||
);
|
);
|
||||||
|
|
||||||
factory ClassComponentsOffline.fromJson2(Map<String, dynamic> json) =>
|
factory ClassComponentsOffline.fromJson2(Map<String, dynamic> json) =>
|
||||||
|
@ -132,6 +137,7 @@ class ClassComponentsOffline {
|
||||||
roughFinish: json["roughFinish"],
|
roughFinish: json["roughFinish"],
|
||||||
highFinish: json["highFinish"],
|
highFinish: json["highFinish"],
|
||||||
withoutBucc: json["withoutBucc"],
|
withoutBucc: json["withoutBucc"],
|
||||||
|
// genCode: json["genCode"]
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
|
@ -152,5 +158,6 @@ class ClassComponentsOffline {
|
||||||
"rough_finish": roughFinish,
|
"rough_finish": roughFinish,
|
||||||
"high_finish": highFinish,
|
"high_finish": highFinish,
|
||||||
"without_bucc": withoutBucc,
|
"without_bucc": withoutBucc,
|
||||||
|
// "gen_code": genCode
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ class ClassComponents {
|
||||||
final String roughFinish;
|
final String roughFinish;
|
||||||
final String highFinish;
|
final String highFinish;
|
||||||
final bool withoutBucc;
|
final bool withoutBucc;
|
||||||
|
// final String genCode;
|
||||||
|
|
||||||
ClassComponents({
|
ClassComponents({
|
||||||
required this.id,
|
required this.id,
|
||||||
|
@ -48,6 +49,7 @@ class ClassComponents {
|
||||||
required this.roughFinish,
|
required this.roughFinish,
|
||||||
required this.highFinish,
|
required this.highFinish,
|
||||||
required this.withoutBucc,
|
required this.withoutBucc,
|
||||||
|
// required this.genCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory ClassComponents.fromJson(Map<String, dynamic> json) =>
|
factory ClassComponents.fromJson(Map<String, dynamic> json) =>
|
||||||
|
@ -69,6 +71,7 @@ class ClassComponents {
|
||||||
roughFinish: json["rough_finish"],
|
roughFinish: json["rough_finish"],
|
||||||
highFinish: json["high_finish"],
|
highFinish: json["high_finish"],
|
||||||
withoutBucc: json["without_bucc"],
|
withoutBucc: json["without_bucc"],
|
||||||
|
// genCode: json["gen_code"]
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
|
@ -89,5 +92,6 @@ class ClassComponents {
|
||||||
"rough_finish": roughFinish,
|
"rough_finish": roughFinish,
|
||||||
"high_finish": highFinish,
|
"high_finish": highFinish,
|
||||||
"without_bucc": withoutBucc,
|
"without_bucc": withoutBucc,
|
||||||
|
// "gen_code": genCode,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,9 +35,10 @@ class GeneralDesc {
|
||||||
final dynamic floorSketch;
|
final dynamic floorSketch;
|
||||||
final String? actualUse;
|
final String? actualUse;
|
||||||
final String? unitValue;
|
final String? unitValue;
|
||||||
|
final String? genCode;
|
||||||
|
|
||||||
GeneralDesc(
|
GeneralDesc({
|
||||||
{this.id,
|
this.id,
|
||||||
this.bldgapprDetailsId,
|
this.bldgapprDetailsId,
|
||||||
this.assessedById,
|
this.assessedById,
|
||||||
this.assessedByName,
|
this.assessedByName,
|
||||||
|
@ -61,10 +62,12 @@ class GeneralDesc {
|
||||||
this.totalFloorArea,
|
this.totalFloorArea,
|
||||||
this.floorSketch,
|
this.floorSketch,
|
||||||
this.actualUse,
|
this.actualUse,
|
||||||
this.unitValue});
|
this.unitValue,
|
||||||
|
this.genCode,
|
||||||
|
});
|
||||||
|
|
||||||
GeneralDesc copy(
|
GeneralDesc copy({
|
||||||
{int? id,
|
int? id,
|
||||||
int? bldgapprDetailsId,
|
int? bldgapprDetailsId,
|
||||||
String? assessedById,
|
String? assessedById,
|
||||||
String? assessedByName,
|
String? assessedByName,
|
||||||
|
@ -88,7 +91,9 @@ class GeneralDesc {
|
||||||
String? totalFloorArea,
|
String? totalFloorArea,
|
||||||
dynamic floorSketch,
|
dynamic floorSketch,
|
||||||
String? actualUse,
|
String? actualUse,
|
||||||
String? unitValue}) {
|
String? unitValue,
|
||||||
|
String? genCode,
|
||||||
|
}) {
|
||||||
return GeneralDesc(
|
return GeneralDesc(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||||
|
@ -114,7 +119,9 @@ class GeneralDesc {
|
||||||
totalFloorArea: totalFloorArea ?? this.totalFloorArea,
|
totalFloorArea: totalFloorArea ?? this.totalFloorArea,
|
||||||
floorSketch: floorSketch ?? this.floorSketch,
|
floorSketch: floorSketch ?? this.floorSketch,
|
||||||
actualUse: actualUse ?? this.actualUse,
|
actualUse: actualUse ?? this.actualUse,
|
||||||
unitValue: unitValue ?? this.unitValue);
|
unitValue: unitValue ?? this.unitValue,
|
||||||
|
genCode: genCode ?? this.genCode,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory GeneralDesc.fromJson(Map<String, dynamic> json) => GeneralDesc(
|
factory GeneralDesc.fromJson(Map<String, dynamic> json) => GeneralDesc(
|
||||||
|
@ -142,7 +149,8 @@ class GeneralDesc {
|
||||||
totalFloorArea: json["total_floor_area"],
|
totalFloorArea: json["total_floor_area"],
|
||||||
floorSketch: json["floor_sketch"],
|
floorSketch: json["floor_sketch"],
|
||||||
actualUse: json["actual_use"],
|
actualUse: json["actual_use"],
|
||||||
unitValue: json["unit_value"]);
|
unitValue: json["unit_value"],
|
||||||
|
genCode: json["gen_code"]);
|
||||||
|
|
||||||
factory GeneralDesc.fromJson2(Map<String, dynamic> json) => GeneralDesc(
|
factory GeneralDesc.fromJson2(Map<String, dynamic> json) => GeneralDesc(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
|
@ -169,7 +177,8 @@ class GeneralDesc {
|
||||||
totalFloorArea: json["totalFloorArea"],
|
totalFloorArea: json["totalFloorArea"],
|
||||||
floorSketch: json["floorSketch"],
|
floorSketch: json["floorSketch"],
|
||||||
actualUse: json["actualUse"],
|
actualUse: json["actualUse"],
|
||||||
unitValue: json["unitValue"]);
|
unitValue: json["unitValue"],
|
||||||
|
genCode: json["gen_code"]);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
|
@ -196,6 +205,7 @@ class GeneralDesc {
|
||||||
"total_floor_area": totalFloorArea,
|
"total_floor_area": totalFloorArea,
|
||||||
"floor_sketch": floorSketch,
|
"floor_sketch": floorSketch,
|
||||||
"actual_use": actualUse,
|
"actual_use": actualUse,
|
||||||
"unit_value": unitValue
|
"unit_value": unitValue,
|
||||||
|
"gen_code": genCode,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,9 @@ class LandExt {
|
||||||
final String? dateReceived;
|
final String? dateReceived;
|
||||||
final String? entryDateAssessment;
|
final String? entryDateAssessment;
|
||||||
final String? entryDateBy;
|
final String? entryDateBy;
|
||||||
|
final String? appraisedbyDesignation;
|
||||||
|
final String? recommendapprDesignation;
|
||||||
|
final String? approvedbyDesignation;
|
||||||
|
|
||||||
LandExt({
|
LandExt({
|
||||||
this.id,
|
this.id,
|
||||||
|
@ -53,6 +56,9 @@ class LandExt {
|
||||||
this.dateReceived,
|
this.dateReceived,
|
||||||
this.entryDateAssessment,
|
this.entryDateAssessment,
|
||||||
this.entryDateBy,
|
this.entryDateBy,
|
||||||
|
this.appraisedbyDesignation,
|
||||||
|
this.recommendapprDesignation,
|
||||||
|
this.approvedbyDesignation,
|
||||||
});
|
});
|
||||||
|
|
||||||
LandExt copy({
|
LandExt copy({
|
||||||
|
@ -77,6 +83,9 @@ class LandExt {
|
||||||
final String? dateReceived,
|
final String? dateReceived,
|
||||||
final String? entryDateAssessment,
|
final String? entryDateAssessment,
|
||||||
final String? entryDateBy,
|
final String? entryDateBy,
|
||||||
|
final String? appraisedbyDesignation,
|
||||||
|
final String? recommendapprDesignation,
|
||||||
|
final String? approvedbyDesignation,
|
||||||
}) {
|
}) {
|
||||||
return LandExt(
|
return LandExt(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
|
@ -100,6 +109,12 @@ class LandExt {
|
||||||
dateReceived: dateReceived ?? this.dateReceived,
|
dateReceived: dateReceived ?? this.dateReceived,
|
||||||
entryDateAssessment: entryDateAssessment ?? this.entryDateAssessment,
|
entryDateAssessment: entryDateAssessment ?? this.entryDateAssessment,
|
||||||
entryDateBy: entryDateBy ?? this.entryDateBy,
|
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"],
|
dateReceived: json["date_received"],
|
||||||
entryDateAssessment: json["entry_date_assessment"],
|
entryDateAssessment: json["entry_date_assessment"],
|
||||||
entryDateBy: json["entry_date_by"],
|
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(
|
factory LandExt.fromJson2(Map<String, dynamic> json) => LandExt(
|
||||||
|
@ -149,6 +167,9 @@ class LandExt {
|
||||||
dateReceived: json["dateReceived"],
|
dateReceived: json["dateReceived"],
|
||||||
entryDateAssessment: json["entryDateAssessment"],
|
entryDateAssessment: json["entryDateAssessment"],
|
||||||
entryDateBy: json["entryDateBy"],
|
entryDateBy: json["entryDateBy"],
|
||||||
|
appraisedbyDesignation: json["appraisedby_designation"],
|
||||||
|
recommendapprDesignation: json["recommendappr_designation"],
|
||||||
|
approvedbyDesignation: json["approvedby_designation"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
|
@ -173,5 +194,8 @@ class LandExt {
|
||||||
"date_received": dateReceived,
|
"date_received": dateReceived,
|
||||||
"entry_date_assessment": entryDateAssessment,
|
"entry_date_assessment": entryDateAssessment,
|
||||||
"entry_date_by": entryDateBy,
|
"entry_date_by": entryDateBy,
|
||||||
|
"appraisedby_designation": appraisedbyDesignation,
|
||||||
|
"recommendappr_designation": recommendapprDesignation,
|
||||||
|
"approvedby_designation": approvedbyDesignation,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,8 @@ class LandRef {
|
||||||
final int? bldgapprDetailsId;
|
final int? bldgapprDetailsId;
|
||||||
final String? assessedById;
|
final String? assessedById;
|
||||||
final String? assessedByName;
|
final String? assessedByName;
|
||||||
final DateTime? dateCreated;
|
final String? dateCreated;
|
||||||
final DateTime? dateModified;
|
final String? dateModified;
|
||||||
final dynamic owner;
|
final dynamic owner;
|
||||||
final dynamic cloaNo;
|
final dynamic cloaNo;
|
||||||
final dynamic lotNo;
|
final dynamic lotNo;
|
||||||
|
@ -22,6 +22,7 @@ class LandRef {
|
||||||
final dynamic area;
|
final dynamic area;
|
||||||
final dynamic surveyNo;
|
final dynamic surveyNo;
|
||||||
final dynamic blkNo;
|
final dynamic blkNo;
|
||||||
|
final String? genCode;
|
||||||
|
|
||||||
LandRef({
|
LandRef({
|
||||||
this.id,
|
this.id,
|
||||||
|
@ -37,6 +38,7 @@ class LandRef {
|
||||||
this.area,
|
this.area,
|
||||||
this.surveyNo,
|
this.surveyNo,
|
||||||
this.blkNo,
|
this.blkNo,
|
||||||
|
this.genCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
LandRef copy({
|
LandRef copy({
|
||||||
|
@ -44,8 +46,8 @@ class LandRef {
|
||||||
int? bldgapprDetailsId,
|
int? bldgapprDetailsId,
|
||||||
String? assessedById,
|
String? assessedById,
|
||||||
String? assessedByName,
|
String? assessedByName,
|
||||||
DateTime? dateCreated,
|
String? dateCreated,
|
||||||
DateTime? dateModified,
|
String? dateModified,
|
||||||
String? owner,
|
String? owner,
|
||||||
String? cloaNo,
|
String? cloaNo,
|
||||||
String? lotNo,
|
String? lotNo,
|
||||||
|
@ -53,6 +55,7 @@ class LandRef {
|
||||||
String? area,
|
String? area,
|
||||||
String? surveyNo,
|
String? surveyNo,
|
||||||
String? blkNo,
|
String? blkNo,
|
||||||
|
String? genCode,
|
||||||
}) {
|
}) {
|
||||||
return LandRef(
|
return LandRef(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
|
@ -68,6 +71,7 @@ class LandRef {
|
||||||
area: area ?? this.area,
|
area: area ?? this.area,
|
||||||
surveyNo: surveyNo ?? this.surveyNo,
|
surveyNo: surveyNo ?? this.surveyNo,
|
||||||
blkNo: blkNo ?? this.blkNo,
|
blkNo: blkNo ?? this.blkNo,
|
||||||
|
genCode: genCode ?? this.genCode,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,12 +80,7 @@ class LandRef {
|
||||||
bldgapprDetailsId: json["bldgappr_details_id"],
|
bldgapprDetailsId: json["bldgappr_details_id"],
|
||||||
assessedById: json["assessed_by_id"],
|
assessedById: json["assessed_by_id"],
|
||||||
assessedByName: json["assessed_by_name"],
|
assessedByName: json["assessed_by_name"],
|
||||||
dateCreated: json["date_created"] == null
|
dateCreated: json["date_created"],
|
||||||
? null
|
|
||||||
: DateTime.parse(json["date_created"]),
|
|
||||||
dateModified: json["date_modified"] == null
|
|
||||||
? null
|
|
||||||
: DateTime.parse(json["date_modified"]),
|
|
||||||
owner: json["owner"],
|
owner: json["owner"],
|
||||||
cloaNo: json["cloa_no"],
|
cloaNo: json["cloa_no"],
|
||||||
lotNo: json["lot_no"],
|
lotNo: json["lot_no"],
|
||||||
|
@ -89,19 +88,15 @@ class LandRef {
|
||||||
area: json["area"],
|
area: json["area"],
|
||||||
surveyNo: json["survey_no"],
|
surveyNo: json["survey_no"],
|
||||||
blkNo: json["blk_no"],
|
blkNo: json["blk_no"],
|
||||||
);
|
genCode: json["gen_code"]);
|
||||||
|
|
||||||
factory LandRef.fromJson2(Map<String, dynamic> json) => LandRef(
|
factory LandRef.fromJson2(Map<String, dynamic> json) => LandRef(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
bldgapprDetailsId: json["bldgapprDetailsId"],
|
bldgapprDetailsId: json["bldgapprDetailsId"],
|
||||||
assessedById: json["assessedById"],
|
assessedById: json["assessedById"],
|
||||||
assessedByName: json["assessedByName"],
|
assessedByName: json["assessedByName"],
|
||||||
dateCreated: json["dateCreated"] == null
|
dateCreated: json["dateCreated"],
|
||||||
? null
|
dateModified: json["dateModified"],
|
||||||
: DateTime.parse(json["dateCreated"]),
|
|
||||||
dateModified: json["dateModified"] == null
|
|
||||||
? null
|
|
||||||
: DateTime.parse(json["dateModified"]),
|
|
||||||
owner: json["owner"],
|
owner: json["owner"],
|
||||||
cloaNo: json["cloaNo"],
|
cloaNo: json["cloaNo"],
|
||||||
lotNo: json["lotNo"],
|
lotNo: json["lotNo"],
|
||||||
|
@ -109,6 +104,7 @@ class LandRef {
|
||||||
area: json["area"],
|
area: json["area"],
|
||||||
surveyNo: json["surveyNo"],
|
surveyNo: json["surveyNo"],
|
||||||
blkNo: json["blkNo"],
|
blkNo: json["blkNo"],
|
||||||
|
genCode: json["gen_code"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
|
@ -116,8 +112,8 @@ class LandRef {
|
||||||
"bldgappr_details_id": bldgapprDetailsId,
|
"bldgappr_details_id": bldgapprDetailsId,
|
||||||
"assessed_by_id": assessedById,
|
"assessed_by_id": assessedById,
|
||||||
"assessed_by_name": assessedByName,
|
"assessed_by_name": assessedByName,
|
||||||
"date_created": dateCreated?.toIso8601String(),
|
"date_created": dateCreated,
|
||||||
"date_modified": dateModified?.toIso8601String(),
|
"date_modified": dateModified,
|
||||||
"owner": owner,
|
"owner": owner,
|
||||||
"cloa_no": cloaNo,
|
"cloa_no": cloaNo,
|
||||||
"lot_no": lotNo,
|
"lot_no": lotNo,
|
||||||
|
@ -125,5 +121,6 @@ class LandRef {
|
||||||
"area": area,
|
"area": area,
|
||||||
"survey_no": surveyNo,
|
"survey_no": surveyNo,
|
||||||
"blk_no": blkNo,
|
"blk_no": blkNo,
|
||||||
|
"gen_code": genCode,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,39 +12,44 @@ class Memoranda {
|
||||||
final int? id;
|
final int? id;
|
||||||
final String? code;
|
final String? code;
|
||||||
final String? memoranda;
|
final String? memoranda;
|
||||||
|
final String? genCode;
|
||||||
|
|
||||||
Memoranda({
|
Memoranda({
|
||||||
this.id,
|
this.id,
|
||||||
this.code,
|
this.code,
|
||||||
this.memoranda,
|
this.memoranda,
|
||||||
|
this.genCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
Memoranda copy({
|
Memoranda copy({
|
||||||
int? id,
|
int? id,
|
||||||
String? code,
|
String? code,
|
||||||
String? memoranda,
|
String? memoranda,
|
||||||
|
String? genCode,
|
||||||
}) {
|
}) {
|
||||||
return Memoranda(
|
return Memoranda(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
code: code ?? this.code,
|
code: code ?? this.code,
|
||||||
memoranda: memoranda ?? this.memoranda);
|
memoranda: memoranda ?? this.memoranda,
|
||||||
|
genCode: genCode ?? this.genCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Memoranda.fromJson(Map<String, dynamic> json) => Memoranda(
|
factory Memoranda.fromJson(Map<String, dynamic> json) => Memoranda(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
code: json["code"],
|
code: json["code"],
|
||||||
memoranda: json["memoranda"],
|
memoranda: json["memoranda"],
|
||||||
);
|
genCode: json["gen_code"]);
|
||||||
|
|
||||||
factory Memoranda.fromJson2(Map<String, dynamic> json) => Memoranda(
|
factory Memoranda.fromJson2(Map<String, dynamic> json) => Memoranda(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
code: json["code"],
|
code: json["code"],
|
||||||
memoranda: json["memoranda"],
|
memoranda: json["memoranda"],
|
||||||
);
|
genCode: json["genCode"]);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
"code": code,
|
"code": code,
|
||||||
"memoranda": memoranda,
|
"memoranda": memoranda,
|
||||||
|
"gen_code": genCode,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,10 @@ String propertyAssessmentToJson(PropertyAssessment data) =>
|
||||||
class PropertyAssessment {
|
class PropertyAssessment {
|
||||||
final int id;
|
final int id;
|
||||||
final int bldgapprDetailsId;
|
final int bldgapprDetailsId;
|
||||||
|
final String? assessedById;
|
||||||
|
final String? assessedByName;
|
||||||
|
final String? dateCreated;
|
||||||
|
final String? dateModified;
|
||||||
final String actualUse;
|
final String actualUse;
|
||||||
final String marketValue;
|
final String marketValue;
|
||||||
final String assessmentLevel;
|
final String assessmentLevel;
|
||||||
|
@ -32,10 +36,19 @@ class PropertyAssessment {
|
||||||
final String dateReceived;
|
final String dateReceived;
|
||||||
final String entryDateAssessment;
|
final String entryDateAssessment;
|
||||||
final String entryDateBy;
|
final String entryDateBy;
|
||||||
|
final String genCode;
|
||||||
|
final String note;
|
||||||
|
final String? appraisedbyDesignation;
|
||||||
|
final String? recommendapprDesignation;
|
||||||
|
final String? approvedbyDesignation;
|
||||||
|
|
||||||
PropertyAssessment({
|
PropertyAssessment({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.bldgapprDetailsId,
|
required this.bldgapprDetailsId,
|
||||||
|
required this.assessedById,
|
||||||
|
required this.assessedByName,
|
||||||
|
required this.dateCreated,
|
||||||
|
required this.dateModified,
|
||||||
required this.actualUse,
|
required this.actualUse,
|
||||||
required this.marketValue,
|
required this.marketValue,
|
||||||
required this.assessmentLevel,
|
required this.assessmentLevel,
|
||||||
|
@ -54,11 +67,21 @@ class PropertyAssessment {
|
||||||
required this.dateReceived,
|
required this.dateReceived,
|
||||||
required this.entryDateAssessment,
|
required this.entryDateAssessment,
|
||||||
required this.entryDateBy,
|
required this.entryDateBy,
|
||||||
|
required this.genCode,
|
||||||
|
required this.note,
|
||||||
|
required this.appraisedbyDesignation,
|
||||||
|
required this.recommendapprDesignation,
|
||||||
|
required this.approvedbyDesignation,
|
||||||
});
|
});
|
||||||
|
|
||||||
PropertyAssessment copy({
|
PropertyAssessment copy({
|
||||||
int? id,
|
int? id,
|
||||||
int? bldgapprDetailsId,
|
int? bldgapprDetailsId,
|
||||||
|
String? ass,
|
||||||
|
String? assessedById,
|
||||||
|
String? assessedByName,
|
||||||
|
String? dateCreated,
|
||||||
|
String? dateModified,
|
||||||
String? actualUse,
|
String? actualUse,
|
||||||
String? marketValue,
|
String? marketValue,
|
||||||
String? assessmentLevel,
|
String? assessmentLevel,
|
||||||
|
@ -77,10 +100,19 @@ class PropertyAssessment {
|
||||||
String? dateReceived,
|
String? dateReceived,
|
||||||
String? entryDateAssessment,
|
String? entryDateAssessment,
|
||||||
String? entryDateBy,
|
String? entryDateBy,
|
||||||
|
String? genCode,
|
||||||
|
String? note,
|
||||||
|
String? appraisedbyDesignation,
|
||||||
|
String? recommendapprDesignation,
|
||||||
|
String? approvedbyDesignation,
|
||||||
}) =>
|
}) =>
|
||||||
PropertyAssessment(
|
PropertyAssessment(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||||
|
assessedById: assessedById ?? this.assessedById,
|
||||||
|
assessedByName: assessedByName ?? this.assessedByName,
|
||||||
|
dateCreated: dateCreated ?? this.dateCreated,
|
||||||
|
dateModified: dateModified ?? this.dateModified,
|
||||||
actualUse: actualUse ?? this.actualUse,
|
actualUse: actualUse ?? this.actualUse,
|
||||||
marketValue: marketValue ?? this.marketValue,
|
marketValue: marketValue ?? this.marketValue,
|
||||||
assessmentLevel: assessmentLevel ?? this.assessmentLevel,
|
assessmentLevel: assessmentLevel ?? this.assessmentLevel,
|
||||||
|
@ -99,12 +131,24 @@ class PropertyAssessment {
|
||||||
dateReceived: dateReceived ?? this.dateReceived,
|
dateReceived: dateReceived ?? this.dateReceived,
|
||||||
entryDateAssessment: entryDateAssessment ?? this.entryDateAssessment,
|
entryDateAssessment: entryDateAssessment ?? this.entryDateAssessment,
|
||||||
entryDateBy: entryDateBy ?? this.entryDateBy,
|
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) =>
|
factory PropertyAssessment.fromJson(Map<String, dynamic> json) =>
|
||||||
PropertyAssessment(
|
PropertyAssessment(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
bldgapprDetailsId: json["bldgappr_details_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"],
|
actualUse: json["actual_use"],
|
||||||
marketValue: json["market_value"],
|
marketValue: json["market_value"],
|
||||||
assessmentLevel: json["assessment_level"],
|
assessmentLevel: json["assessment_level"],
|
||||||
|
@ -123,12 +167,21 @@ class PropertyAssessment {
|
||||||
dateReceived: json["date_received"],
|
dateReceived: json["date_received"],
|
||||||
entryDateAssessment: json["entry_date_assessment"],
|
entryDateAssessment: json["entry_date_assessment"],
|
||||||
entryDateBy: json["entry_date_by"],
|
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) =>
|
factory PropertyAssessment.fromJson2(Map<String, dynamic> json) =>
|
||||||
PropertyAssessment(
|
PropertyAssessment(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
bldgapprDetailsId: json["bldgapprDetailsId"],
|
bldgapprDetailsId: json["bldgapprDetailsId"],
|
||||||
|
assessedById: json["assessedById"],
|
||||||
|
assessedByName: json["assessedByName"],
|
||||||
|
dateCreated: json["dateCreated"],
|
||||||
|
dateModified: json["dateModified"],
|
||||||
actualUse: json["actualUse"],
|
actualUse: json["actualUse"],
|
||||||
marketValue: json["marketValue"],
|
marketValue: json["marketValue"],
|
||||||
assessmentLevel: json["assessmentLevel"],
|
assessmentLevel: json["assessmentLevel"],
|
||||||
|
@ -147,11 +200,20 @@ class PropertyAssessment {
|
||||||
dateReceived: json["dateReceived"],
|
dateReceived: json["dateReceived"],
|
||||||
entryDateAssessment: json["entryDateAssessment"],
|
entryDateAssessment: json["entryDateAssessment"],
|
||||||
entryDateBy: json["entryDateBy"],
|
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() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
"bldgappr_details_id": bldgapprDetailsId,
|
"bldgappr_details_id": bldgapprDetailsId,
|
||||||
|
"assessed_by_id": assessedById,
|
||||||
|
"assessed_by_name": assessedByName,
|
||||||
|
"date_created": dateCreated,
|
||||||
|
"date_modified": dateModified,
|
||||||
"actual_use": actualUse,
|
"actual_use": actualUse,
|
||||||
"market_value": marketValue,
|
"market_value": marketValue,
|
||||||
"assessment_level": assessmentLevel,
|
"assessment_level": assessmentLevel,
|
||||||
|
@ -169,5 +231,10 @@ class PropertyAssessment {
|
||||||
"swornstatement_no": swornstatementNo,
|
"swornstatement_no": swornstatementNo,
|
||||||
"date_received": dateReceived,
|
"date_received": dateReceived,
|
||||||
"entry_date_by": entryDateBy,
|
"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? transCode;
|
||||||
final String? tdn;
|
final String? tdn;
|
||||||
final String? pin;
|
final String? pin;
|
||||||
final String? owner;
|
final String? fname;
|
||||||
|
final String? mname;
|
||||||
|
final String? lname;
|
||||||
|
final String? bday;
|
||||||
final String? address;
|
final String? address;
|
||||||
final String? telno;
|
final String? telno;
|
||||||
final String? tin;
|
final String? tin;
|
||||||
|
@ -27,6 +30,7 @@ class PropertyInfo {
|
||||||
final String? adminTelno;
|
final String? adminTelno;
|
||||||
final String? adminTin;
|
final String? adminTin;
|
||||||
final String? faasType;
|
final String? faasType;
|
||||||
|
final String? genCode;
|
||||||
|
|
||||||
PropertyInfo({
|
PropertyInfo({
|
||||||
this.id,
|
this.id,
|
||||||
|
@ -37,7 +41,10 @@ class PropertyInfo {
|
||||||
this.transCode,
|
this.transCode,
|
||||||
this.tdn,
|
this.tdn,
|
||||||
this.pin,
|
this.pin,
|
||||||
this.owner,
|
this.fname,
|
||||||
|
this.mname,
|
||||||
|
this.lname,
|
||||||
|
this.bday,
|
||||||
this.address,
|
this.address,
|
||||||
this.telno,
|
this.telno,
|
||||||
this.tin,
|
this.tin,
|
||||||
|
@ -46,6 +53,7 @@ class PropertyInfo {
|
||||||
this.adminTelno,
|
this.adminTelno,
|
||||||
this.adminTin,
|
this.adminTin,
|
||||||
this.faasType,
|
this.faasType,
|
||||||
|
this.genCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
PropertyInfo copy({
|
PropertyInfo copy({
|
||||||
|
@ -66,6 +74,7 @@ class PropertyInfo {
|
||||||
String? adminTelno,
|
String? adminTelno,
|
||||||
String? adminTin,
|
String? adminTin,
|
||||||
String? faasType,
|
String? faasType,
|
||||||
|
String? genCode,
|
||||||
}) =>
|
}) =>
|
||||||
PropertyInfo(
|
PropertyInfo(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
|
@ -76,7 +85,10 @@ class PropertyInfo {
|
||||||
transCode: transCode ?? this.transCode,
|
transCode: transCode ?? this.transCode,
|
||||||
tdn: tdn ?? this.tdn,
|
tdn: tdn ?? this.tdn,
|
||||||
pin: pin ?? this.pin,
|
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,
|
address: address ?? this.address,
|
||||||
telno: telno ?? this.telno,
|
telno: telno ?? this.telno,
|
||||||
tin: tin ?? this.tin,
|
tin: tin ?? this.tin,
|
||||||
|
@ -85,6 +97,7 @@ class PropertyInfo {
|
||||||
adminTelno: adminTelno ?? this.adminTelno,
|
adminTelno: adminTelno ?? this.adminTelno,
|
||||||
adminTin: adminTin ?? this.adminTin,
|
adminTin: adminTin ?? this.adminTin,
|
||||||
faasType: faasType ?? this.faasType,
|
faasType: faasType ?? this.faasType,
|
||||||
|
genCode: genCode ?? this.genCode,
|
||||||
);
|
);
|
||||||
|
|
||||||
factory PropertyInfo.fromJson(Map<String, dynamic> json) => PropertyInfo(
|
factory PropertyInfo.fromJson(Map<String, dynamic> json) => PropertyInfo(
|
||||||
|
@ -100,7 +113,10 @@ class PropertyInfo {
|
||||||
transCode: json["trans_code"],
|
transCode: json["trans_code"],
|
||||||
tdn: json["tdn"],
|
tdn: json["tdn"],
|
||||||
pin: json["pin"],
|
pin: json["pin"],
|
||||||
owner: json["owner"],
|
fname: json["fname"],
|
||||||
|
mname: json["mname"],
|
||||||
|
lname: json["lname"],
|
||||||
|
bday: json["bday"],
|
||||||
address: json["address"],
|
address: json["address"],
|
||||||
telno: json["telno"],
|
telno: json["telno"],
|
||||||
tin: json["tin"],
|
tin: json["tin"],
|
||||||
|
@ -109,6 +125,7 @@ class PropertyInfo {
|
||||||
adminTelno: json["admin_telno"],
|
adminTelno: json["admin_telno"],
|
||||||
adminTin: json["admin_tin"],
|
adminTin: json["admin_tin"],
|
||||||
faasType: json["faas_type"],
|
faasType: json["faas_type"],
|
||||||
|
genCode: json["gen_code"],
|
||||||
);
|
);
|
||||||
|
|
||||||
factory PropertyInfo.fromJson2(Map<String, dynamic> json) => PropertyInfo(
|
factory PropertyInfo.fromJson2(Map<String, dynamic> json) => PropertyInfo(
|
||||||
|
@ -124,8 +141,12 @@ class PropertyInfo {
|
||||||
transCode: json["transCode"],
|
transCode: json["transCode"],
|
||||||
tdn: json["tdn"],
|
tdn: json["tdn"],
|
||||||
pin: json["pin"],
|
pin: json["pin"],
|
||||||
owner: json["owner"],
|
fname: json["fname"],
|
||||||
|
mname: json["mname"],
|
||||||
|
lname: json["lname"],
|
||||||
|
bday: json["bday"],
|
||||||
address: json["address"],
|
address: json["address"],
|
||||||
|
|
||||||
telno: json["telno"],
|
telno: json["telno"],
|
||||||
tin: json["tin"],
|
tin: json["tin"],
|
||||||
adminUser: json["adminUser"],
|
adminUser: json["adminUser"],
|
||||||
|
@ -133,6 +154,7 @@ class PropertyInfo {
|
||||||
adminTelno: json["adminTelno"],
|
adminTelno: json["adminTelno"],
|
||||||
adminTin: json["adminTin"],
|
adminTin: json["adminTin"],
|
||||||
faasType: json["faasType"],
|
faasType: json["faasType"],
|
||||||
|
genCode: json["genCode"],
|
||||||
);
|
);
|
||||||
|
|
||||||
factory PropertyInfo.fromMap(Map<String, dynamic> map) => PropertyInfo(
|
factory PropertyInfo.fromMap(Map<String, dynamic> map) => PropertyInfo(
|
||||||
|
@ -144,7 +166,10 @@ class PropertyInfo {
|
||||||
transCode: map["transCode"],
|
transCode: map["transCode"],
|
||||||
tdn: map["tdn"],
|
tdn: map["tdn"],
|
||||||
pin: map["pin"],
|
pin: map["pin"],
|
||||||
owner: map["owner"],
|
fname: map["fname"],
|
||||||
|
mname: map["mname"],
|
||||||
|
lname: map["lname"],
|
||||||
|
bday: map["bday"],
|
||||||
address: map["address"],
|
address: map["address"],
|
||||||
telno: map["telno"],
|
telno: map["telno"],
|
||||||
tin: map["tin"],
|
tin: map["tin"],
|
||||||
|
@ -153,7 +178,7 @@ class PropertyInfo {
|
||||||
adminTelno: map["adminTelno"],
|
adminTelno: map["adminTelno"],
|
||||||
adminTin: map["adminTin"],
|
adminTin: map["adminTin"],
|
||||||
faasType: map["faasType"],
|
faasType: map["faasType"],
|
||||||
);
|
genCode: map["genCode"]);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
|
@ -164,7 +189,10 @@ class PropertyInfo {
|
||||||
"trans_code": transCode,
|
"trans_code": transCode,
|
||||||
"tdn": tdn,
|
"tdn": tdn,
|
||||||
"pin": pin,
|
"pin": pin,
|
||||||
"owner": owner,
|
"fname": fname,
|
||||||
|
"mname": mname,
|
||||||
|
"lname": lname,
|
||||||
|
"bday": bday,
|
||||||
"address": address,
|
"address": address,
|
||||||
"telno": telno,
|
"telno": telno,
|
||||||
"tin": tin,
|
"tin": tin,
|
||||||
|
@ -173,5 +201,6 @@ class PropertyInfo {
|
||||||
"admin_telno": adminTelno,
|
"admin_telno": adminTelno,
|
||||||
"admin_tin": adminTin,
|
"admin_tin": adminTin,
|
||||||
"faas_type": faasType,
|
"faas_type": faasType,
|
||||||
|
"gen_code": genCode,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,9 @@ class Signatories {
|
||||||
final String firstname;
|
final String firstname;
|
||||||
final String middlename;
|
final String middlename;
|
||||||
final String lastname;
|
final String lastname;
|
||||||
|
final String designation;
|
||||||
|
// final String status;
|
||||||
|
// final String genCode;
|
||||||
|
|
||||||
Signatories({
|
Signatories({
|
||||||
this.id,
|
this.id,
|
||||||
|
@ -22,20 +25,31 @@ class Signatories {
|
||||||
required this.firstname,
|
required this.firstname,
|
||||||
required this.middlename,
|
required this.middlename,
|
||||||
required this.lastname,
|
required this.lastname,
|
||||||
|
required this.designation,
|
||||||
|
// required this.status
|
||||||
|
// required this.genCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
Signatories copy(
|
Signatories copy({
|
||||||
{int? id,
|
int? id,
|
||||||
int? signatoryId,
|
int? signatoryId,
|
||||||
String? firstname,
|
String? firstname,
|
||||||
String? middlename,
|
String? middlename,
|
||||||
String? lastname}) {
|
String? lastname,
|
||||||
|
String? designation,
|
||||||
|
// String? status
|
||||||
|
// String? genCode
|
||||||
|
}) {
|
||||||
return Signatories(
|
return Signatories(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
signatoryId: signatoryId ?? this.signatoryId,
|
signatoryId: signatoryId ?? this.signatoryId,
|
||||||
firstname: firstname ?? this.firstname,
|
firstname: firstname ?? this.firstname,
|
||||||
middlename: middlename ?? this.middlename,
|
middlename: middlename ?? this.middlename,
|
||||||
lastname: lastname ?? this.lastname);
|
lastname: lastname ?? this.lastname,
|
||||||
|
designation: designation ?? this.designation,
|
||||||
|
// status: status ?? this.status
|
||||||
|
// genCode: genCode ?? this.genCode
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Signatories.fromJson(Map<String, dynamic> json) => Signatories(
|
factory Signatories.fromJson(Map<String, dynamic> json) => Signatories(
|
||||||
|
@ -44,6 +58,9 @@ class Signatories {
|
||||||
firstname: json["firstname"],
|
firstname: json["firstname"],
|
||||||
middlename: json["middlename"],
|
middlename: json["middlename"],
|
||||||
lastname: json["lastname"],
|
lastname: json["lastname"],
|
||||||
|
designation: json["designation"],
|
||||||
|
// status: json["status"]
|
||||||
|
// genCode: json["gen_code"],
|
||||||
);
|
);
|
||||||
|
|
||||||
factory Signatories.fromJson2(Map<String, dynamic> json) => Signatories(
|
factory Signatories.fromJson2(Map<String, dynamic> json) => Signatories(
|
||||||
|
@ -52,6 +69,9 @@ class Signatories {
|
||||||
firstname: json["firstname"],
|
firstname: json["firstname"],
|
||||||
middlename: json["middlename"],
|
middlename: json["middlename"],
|
||||||
lastname: json["lastname"],
|
lastname: json["lastname"],
|
||||||
|
designation: json["designation"],
|
||||||
|
// status: json["status"]
|
||||||
|
// genCode: json["gen_code"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
|
@ -60,5 +80,8 @@ class Signatories {
|
||||||
"firstname": firstname,
|
"firstname": firstname,
|
||||||
"middlename": middlename,
|
"middlename": middlename,
|
||||||
"lastname": lastname,
|
"lastname": lastname,
|
||||||
|
"designation": designation,
|
||||||
|
// "status": status
|
||||||
|
// "gen_code": genCode
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,11 @@ class StructureMaterialsII {
|
||||||
final List<String>? flooring;
|
final List<String>? flooring;
|
||||||
final List<String>? walls;
|
final List<String>? walls;
|
||||||
final List<String>? others;
|
final List<String>? others;
|
||||||
|
final String? genCode;
|
||||||
|
final String? assessedById;
|
||||||
|
final String? assessedByName;
|
||||||
|
final String? dateCreated;
|
||||||
|
final String? dateModified;
|
||||||
|
|
||||||
StructureMaterialsII(
|
StructureMaterialsII(
|
||||||
{this.id,
|
{this.id,
|
||||||
|
@ -33,7 +38,12 @@ class StructureMaterialsII {
|
||||||
this.roof,
|
this.roof,
|
||||||
this.flooring,
|
this.flooring,
|
||||||
this.walls,
|
this.walls,
|
||||||
this.others});
|
this.others,
|
||||||
|
this.genCode,
|
||||||
|
this.assessedById,
|
||||||
|
this.assessedByName,
|
||||||
|
this.dateCreated,
|
||||||
|
this.dateModified});
|
||||||
|
|
||||||
factory StructureMaterialsII.fromJson(Map<String, dynamic> json) =>
|
factory StructureMaterialsII.fromJson(Map<String, dynamic> json) =>
|
||||||
StructureMaterialsII(
|
StructureMaterialsII(
|
||||||
|
@ -47,6 +57,11 @@ class StructureMaterialsII {
|
||||||
flooring: List<String>.from(json["flooring"].map((x) => x)),
|
flooring: List<String>.from(json["flooring"].map((x) => x)),
|
||||||
walls: List<String>.from(json["walls"].map((x) => x)),
|
walls: List<String>.from(json["walls"].map((x) => x)),
|
||||||
others: List<String>.from(json["others"].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) =>
|
factory StructureMaterialsII.fromJson2(Map<String, dynamic> json) =>
|
||||||
|
@ -61,10 +76,15 @@ class StructureMaterialsII {
|
||||||
flooring: List<String>.from(json["flooring"].map((x) => x)),
|
flooring: List<String>.from(json["flooring"].map((x) => x)),
|
||||||
walls: List<String>.from(json["walls"].map((x) => x)),
|
walls: List<String>.from(json["walls"].map((x) => x)),
|
||||||
others: List<String>.from(json["others"].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(
|
StructureMaterialsII copy({
|
||||||
{int? id,
|
int? id,
|
||||||
int? bldgapprDetailsId,
|
int? bldgapprDetailsId,
|
||||||
List<String>? foundation,
|
List<String>? foundation,
|
||||||
List<String>? columns,
|
List<String>? columns,
|
||||||
|
@ -73,7 +93,13 @@ class StructureMaterialsII {
|
||||||
List<String>? roof,
|
List<String>? roof,
|
||||||
List<String>? flooring,
|
List<String>? flooring,
|
||||||
List<String>? walls,
|
List<String>? walls,
|
||||||
List<String>? others}) =>
|
List<String>? others,
|
||||||
|
String? genCode,
|
||||||
|
String? assessedById,
|
||||||
|
String? assessedByName,
|
||||||
|
String? dateCreated,
|
||||||
|
String? dateModified,
|
||||||
|
}) =>
|
||||||
StructureMaterialsII(
|
StructureMaterialsII(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||||
|
@ -84,7 +110,13 @@ class StructureMaterialsII {
|
||||||
roof: roof ?? this.roof,
|
roof: roof ?? this.roof,
|
||||||
flooring: flooring ?? this.flooring,
|
flooring: flooring ?? this.flooring,
|
||||||
walls: walls ?? this.walls,
|
walls: walls ?? this.walls,
|
||||||
others: others ?? this.others);
|
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() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
|
@ -97,5 +129,10 @@ class StructureMaterialsII {
|
||||||
"flooring": List<dynamic>.from(flooring!.map((x) => x)),
|
"flooring": List<dynamic>.from(flooring!.map((x) => x)),
|
||||||
"walls": List<dynamic>.from(walls!.map((x) => x)),
|
"walls": List<dynamic>.from(walls!.map((x) => x)),
|
||||||
"others": List<dynamic>.from(others!.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? flooring;
|
||||||
final String? walls;
|
final String? walls;
|
||||||
final String? others;
|
final String? others;
|
||||||
|
final String? genCode;
|
||||||
|
|
||||||
StructureMaterials(
|
StructureMaterials(
|
||||||
{this.id,
|
{this.id,
|
||||||
|
@ -33,7 +34,8 @@ class StructureMaterials {
|
||||||
this.roof,
|
this.roof,
|
||||||
this.flooring,
|
this.flooring,
|
||||||
this.walls,
|
this.walls,
|
||||||
this.others});
|
this.others,
|
||||||
|
this.genCode});
|
||||||
|
|
||||||
StructureMaterials copy(
|
StructureMaterials copy(
|
||||||
{int? id,
|
{int? id,
|
||||||
|
@ -45,7 +47,8 @@ class StructureMaterials {
|
||||||
String? roof,
|
String? roof,
|
||||||
String? flooring,
|
String? flooring,
|
||||||
String? walls,
|
String? walls,
|
||||||
String? others}) =>
|
String? others,
|
||||||
|
String? genCode}) =>
|
||||||
StructureMaterials(
|
StructureMaterials(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId,
|
||||||
|
@ -56,7 +59,8 @@ class StructureMaterials {
|
||||||
roof: roof ?? this.roof,
|
roof: roof ?? this.roof,
|
||||||
flooring: flooring ?? this.flooring,
|
flooring: flooring ?? this.flooring,
|
||||||
walls: walls ?? this.walls,
|
walls: walls ?? this.walls,
|
||||||
others: others ?? this.others);
|
others: others ?? this.others,
|
||||||
|
genCode: genCode ?? this.genCode);
|
||||||
|
|
||||||
factory StructureMaterials.fromJson(Map<String, dynamic> json) =>
|
factory StructureMaterials.fromJson(Map<String, dynamic> json) =>
|
||||||
StructureMaterials(
|
StructureMaterials(
|
||||||
|
@ -69,7 +73,8 @@ class StructureMaterials {
|
||||||
roof: json["roof"],
|
roof: json["roof"],
|
||||||
flooring: json["flooring"],
|
flooring: json["flooring"],
|
||||||
walls: json["walls"],
|
walls: json["walls"],
|
||||||
others: json["others"]);
|
others: json["others"],
|
||||||
|
genCode: json["gen_code"]);
|
||||||
|
|
||||||
factory StructureMaterials.fromJson2(Map<String, dynamic> json) =>
|
factory StructureMaterials.fromJson2(Map<String, dynamic> json) =>
|
||||||
StructureMaterials(
|
StructureMaterials(
|
||||||
|
@ -82,7 +87,8 @@ class StructureMaterials {
|
||||||
roof: json["roof"],
|
roof: json["roof"],
|
||||||
flooring: json["flooring"],
|
flooring: json["flooring"],
|
||||||
walls: json["walls"],
|
walls: json["walls"],
|
||||||
others: json["others"]);
|
others: json["others"],
|
||||||
|
genCode: json["gen_code"]);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
|
@ -94,6 +100,7 @@ class StructureMaterials {
|
||||||
"roof": roof,
|
"roof": roof,
|
||||||
"flooring": flooring,
|
"flooring": flooring,
|
||||||
"walls": walls,
|
"walls": walls,
|
||||||
"others": others
|
"others": others,
|
||||||
|
"gen_code": genCode,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,12 +14,14 @@ class UnitConstruct {
|
||||||
final String bldgType;
|
final String bldgType;
|
||||||
final String building;
|
final String building;
|
||||||
final String unitValue;
|
final String unitValue;
|
||||||
|
final String genCode;
|
||||||
|
|
||||||
UnitConstruct({
|
UnitConstruct({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.bldgType,
|
required this.bldgType,
|
||||||
required this.building,
|
required this.building,
|
||||||
required this.unitValue,
|
required this.unitValue,
|
||||||
|
required this.genCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
UnitConstruct copy({
|
UnitConstruct copy({
|
||||||
|
@ -27,12 +29,15 @@ class UnitConstruct {
|
||||||
String? bldgType,
|
String? bldgType,
|
||||||
String? building,
|
String? building,
|
||||||
String? unitValue,
|
String? unitValue,
|
||||||
|
String? genCode,
|
||||||
}) {
|
}) {
|
||||||
return UnitConstruct(
|
return UnitConstruct(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
bldgType: bldgType ?? this.bldgType,
|
bldgType: bldgType ?? this.bldgType,
|
||||||
building: building ?? this.building,
|
building: building ?? this.building,
|
||||||
unitValue: unitValue ?? this.unitValue);
|
unitValue: unitValue ?? this.unitValue,
|
||||||
|
genCode: genCode ?? this.genCode,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory UnitConstruct.fromJson2(Map<String, dynamic> json) => UnitConstruct(
|
factory UnitConstruct.fromJson2(Map<String, dynamic> json) => UnitConstruct(
|
||||||
|
@ -40,6 +45,7 @@ class UnitConstruct {
|
||||||
bldgType: json["bldgType"],
|
bldgType: json["bldgType"],
|
||||||
building: json["building"],
|
building: json["building"],
|
||||||
unitValue: json["unitValue"],
|
unitValue: json["unitValue"],
|
||||||
|
genCode: json["gen_code"],
|
||||||
);
|
);
|
||||||
|
|
||||||
factory UnitConstruct.fromJson(Map<String, dynamic> json) => UnitConstruct(
|
factory UnitConstruct.fromJson(Map<String, dynamic> json) => UnitConstruct(
|
||||||
|
@ -47,6 +53,7 @@ class UnitConstruct {
|
||||||
bldgType: json["bldg_type"],
|
bldgType: json["bldg_type"],
|
||||||
building: json["building"],
|
building: json["building"],
|
||||||
unitValue: json["unit_value"],
|
unitValue: json["unit_value"],
|
||||||
|
genCode: json["gen_code"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
|
@ -54,5 +61,6 @@ class UnitConstruct {
|
||||||
"bldg_type": bldgType,
|
"bldg_type": bldgType,
|
||||||
"building": building,
|
"building": building,
|
||||||
"unit_value": unitValue,
|
"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/bloc/offline/offline_bloc/offline_bloc.dart';
|
||||||
import 'package:unit2/model/offline/offlane_modules.dart';
|
import 'package:unit2/model/offline/offlane_modules.dart';
|
||||||
import 'package:unit2/screens/offline/passo/passo_offline_dashboard.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/screens/unit2/homepage.dart/components/dashboard/shared_card_label.dart';
|
||||||
import 'package:unit2/theme-data.dart/colors.dart';
|
import 'package:unit2/theme-data.dart/colors.dart';
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.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';
|
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/class_components_api_services.dart';
|
||||||
import 'package:unit2/sevices/offline/offline_passo/admin/api_services/municipalities_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:unit2/theme-data.dart/colors.dart';
|
||||||
|
import 'package:http/http.dart';
|
||||||
import '../../../../model/passo/city.dart';
|
import '../../../../model/passo/city.dart';
|
||||||
import '../../../../sevices/offline/offline_passo/admin/sql_services/sql_services.dart';
|
import '../../../../sevices/offline/offline_passo/admin/sql_services/sql_services.dart';
|
||||||
|
import '../../../../utils/urls.dart';
|
||||||
|
|
||||||
class ClassComponentsAdminPage extends StatefulWidget {
|
class ClassComponentsAdminPage extends StatefulWidget {
|
||||||
const ClassComponentsAdminPage();
|
const ClassComponentsAdminPage();
|
||||||
|
@ -34,10 +37,15 @@ class _ClassComponentsAdminPage extends State<ClassComponentsAdminPage> {
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
try {
|
try {
|
||||||
final result =
|
Response response = await get(Uri.parse(
|
||||||
await ClassComponentAdminApiServices.instance.fetch();
|
'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();
|
||||||
|
|
||||||
// Assuming result is a List of JSON objects, convert them to City objects.
|
|
||||||
final classes = result
|
final classes = result
|
||||||
.map((json) => ClassComponents.fromJson(json))
|
.map((json) => ClassComponents.fromJson(json))
|
||||||
.toList();
|
.toList();
|
||||||
|
@ -63,6 +71,9 @@ class _ClassComponentsAdminPage extends State<ClassComponentsAdminPage> {
|
||||||
highFinish: classs.highFinish,
|
highFinish: classs.highFinish,
|
||||||
withoutBucc: classs.withoutBucc == true ? 1 : 0));
|
withoutBucc: classs.withoutBucc == true ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Assuming result is a List of JSON objects, convert them to City objects.
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Handle any errors that might occur during the API call or database insertion.
|
// Handle any errors that might occur during the API call or database insertion.
|
||||||
print("Error: $e");
|
print("Error: $e");
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:unit2/bloc/offline/offline_passo/admin/barangay_admin/barangay_admin_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 '../../../../sevices/offline/offline_passo/admin/sql_services/sql_services.dart';
|
||||||
import '../../../../theme-data.dart/colors.dart';
|
import '../../../../theme-data.dart/colors.dart';
|
||||||
|
import '../../../../utils/urls.dart';
|
||||||
|
import 'package:http/http.dart';
|
||||||
|
|
||||||
class MemorandaAdminPage extends StatefulWidget {
|
class MemorandaAdminPage extends StatefulWidget {
|
||||||
const MemorandaAdminPage();
|
const MemorandaAdminPage();
|
||||||
|
@ -33,16 +37,28 @@ class _MemorandaAdminPage extends State<MemorandaAdminPage> {
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
try {
|
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.
|
// // Assuming result is a List of JSON objects, convert them to City objects.
|
||||||
final memos =
|
// final memos =
|
||||||
result.map((json) => Memoranda.fromJson(json)).toList();
|
// result.map((json) => Memoranda.fromJson(json)).toList();
|
||||||
|
|
||||||
// Loop through the list of City objects and insert them into the local database.
|
// Loop through the list of City objects and insert them into the local database.
|
||||||
|
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) {
|
for (Memoranda memo in memos) {
|
||||||
await SQLServices.instance.createMemoranda(memo);
|
await SQLServices.instance.createMemoranda(memo);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Handle any errors that might occur during the API call or database insertion.
|
// Handle any errors that might occur during the API call or database insertion.
|
||||||
print("Error: $e");
|
print("Error: $e");
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:unit2/bloc/offline/offline_passo/admin/barangay_admin/barangay_admin_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 '../../../../sevices/offline/offline_passo/admin/sql_services/sql_services.dart';
|
||||||
import '../../../../theme-data.dart/colors.dart';
|
import '../../../../theme-data.dart/colors.dart';
|
||||||
|
import 'package:http/http.dart';
|
||||||
|
|
||||||
|
import '../../../../utils/urls.dart';
|
||||||
|
|
||||||
class SignatoriesAdminPage extends StatefulWidget {
|
class SignatoriesAdminPage extends StatefulWidget {
|
||||||
const SignatoriesAdminPage();
|
const SignatoriesAdminPage();
|
||||||
|
@ -33,17 +38,22 @@ class _SignatoriesAdminPage extends State<SignatoriesAdminPage> {
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
try {
|
try {
|
||||||
final result =
|
Response response = await get(Uri.parse(
|
||||||
await SignatoriesAdminApiServices.instance.fetch();
|
'http://${Url.instance.host()}/api/rptass_app/signatories/'));
|
||||||
|
|
||||||
|
print(response.body);
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
final List result = jsonDecode(response.body)['data'];
|
||||||
|
|
||||||
|
result.map(((e) => Signatories.fromJson(e))).toList();
|
||||||
|
|
||||||
// Assuming result is a List of JSON objects, convert them to City objects.
|
|
||||||
final signatories =
|
final signatories =
|
||||||
result.map((json) => Signatories.fromJson(json)).toList();
|
result.map((json) => Signatories.fromJson(json)).toList();
|
||||||
|
|
||||||
// Loop through the list of City objects and insert them into the local database.
|
// Loop through the list of City objects and insert them into the local database.
|
||||||
for (Signatories signatory in signatories) {
|
for (Signatories signatory in signatories) {
|
||||||
await SQLServices.instance.createSignatories(signatory);
|
await SQLServices.instance.createSignatories(signatory);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Handle any errors that might occur during the API call or database insertion.
|
// Handle any errors that might occur during the API call or database insertion.
|
||||||
print("Error: $e");
|
print("Error: $e");
|
||||||
|
@ -83,6 +93,12 @@ class _SignatoriesAdminPage extends State<SignatoriesAdminPage> {
|
||||||
const DataColumn(
|
const DataColumn(
|
||||||
label: Text('Last Name'),
|
label: Text('Last Name'),
|
||||||
),
|
),
|
||||||
|
const DataColumn(
|
||||||
|
label: Text('Designation'),
|
||||||
|
),
|
||||||
|
// const DataColumn(
|
||||||
|
// label: Text('Status'),
|
||||||
|
// ),
|
||||||
],
|
],
|
||||||
rows: state.signatories.map((dataRow) {
|
rows: state.signatories.map((dataRow) {
|
||||||
return DataRow(
|
return DataRow(
|
||||||
|
@ -93,6 +109,8 @@ class _SignatoriesAdminPage extends State<SignatoriesAdminPage> {
|
||||||
'N/A')), // Use a default value if cityDescription is null
|
'N/A')), // Use a default value if cityDescription is null
|
||||||
DataCell(Text(dataRow.middlename ?? 'N/A')),
|
DataCell(Text(dataRow.middlename ?? 'N/A')),
|
||||||
DataCell(Text(dataRow.lastname ?? 'N/A')),
|
DataCell(Text(dataRow.lastname ?? 'N/A')),
|
||||||
|
DataCell(Text(dataRow.designation ?? 'N/A')),
|
||||||
|
// DataCell(Text(dataRow.status ?? 'N/A')),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:unit2/bloc/offline/offline_passo/admin/barangay_admin/barangay_admin_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 '../../../../sevices/offline/offline_passo/admin/sql_services/sql_services.dart';
|
||||||
import '../../../../theme-data.dart/colors.dart';
|
import '../../../../theme-data.dart/colors.dart';
|
||||||
|
import 'package:http/http.dart';
|
||||||
|
|
||||||
class UnitConstructionAdminPage extends StatefulWidget {
|
class UnitConstructionAdminPage extends StatefulWidget {
|
||||||
const UnitConstructionAdminPage();
|
const UnitConstructionAdminPage();
|
||||||
|
@ -33,17 +36,31 @@ class _UnitConstructionAdminPage extends State<UnitConstructionAdminPage> {
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
try {
|
try {
|
||||||
final result =
|
// final result =
|
||||||
await UnitConstructionAdminApiServices.instance.fetch();
|
// await UnitConstructionAdminApiServices.instance.fetch();
|
||||||
|
|
||||||
// Assuming result is a List of JSON objects, convert them to City objects.
|
// // Assuming result is a List of JSON objects, convert them to City objects.
|
||||||
final units =
|
// final units =
|
||||||
result.map((json) => UnitConstruct.fromJson(json)).toList();
|
// result.map((json) => UnitConstruct.fromJson(json)).toList();
|
||||||
|
|
||||||
// Loop through the list of City objects and insert them into the local database.
|
// Loop through the list of City objects and insert them into the local database.
|
||||||
|
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) {
|
for (UnitConstruct unit in units) {
|
||||||
await SQLServices.instance.createUnitConstruction(unit);
|
await SQLServices.instance.createUnitConstruction(unit);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Handle any errors that might occur during the API call or database insertion.
|
// Handle any errors that might occur during the API call or database insertion.
|
||||||
print("Error: $e");
|
print("Error: $e");
|
||||||
|
|
|
@ -84,10 +84,6 @@ class _AddBuildingAndStructureOffline
|
||||||
formKey.currentState?.save();
|
formKey.currentState?.save();
|
||||||
},
|
},
|
||||||
autovalidateMode: AutovalidateMode.disabled,
|
autovalidateMode: AutovalidateMode.disabled,
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(0.0),
|
|
||||||
child: Container(
|
|
||||||
height: 800,
|
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(2.0),
|
padding: const EdgeInsets.all(2.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -110,8 +106,7 @@ class _AddBuildingAndStructureOffline
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
'${unit.bldgType} - ${unit.building!.toUpperCase()}',
|
'${unit.bldgType} - ${unit.building!.toUpperCase()}',
|
||||||
overflow:
|
overflow: TextOverflow.ellipsis,
|
||||||
TextOverflow.ellipsis,
|
|
||||||
),
|
),
|
||||||
)))
|
)))
|
||||||
.toList(),
|
.toList(),
|
||||||
|
@ -119,11 +114,11 @@ class _AddBuildingAndStructureOffline
|
||||||
validator: FormBuilderValidators.required(
|
validator: FormBuilderValidators.required(
|
||||||
errorText: "This field is required"),
|
errorText: "This field is required"),
|
||||||
|
|
||||||
searchInputDecoration:
|
searchInputDecoration: normalTextFieldStyle(
|
||||||
normalTextFieldStyle("Structure Type", "")
|
"Structure Type", "")
|
||||||
.copyWith(
|
.copyWith(
|
||||||
suffixIcon: const Icon(
|
suffixIcon:
|
||||||
Icons.arrow_drop_down)),
|
const Icon(Icons.arrow_drop_down)),
|
||||||
////agency suggestion tap
|
////agency suggestion tap
|
||||||
focusNode: focus,
|
focusNode: focus,
|
||||||
suggestionState: Suggestion.expand,
|
suggestionState: Suggestion.expand,
|
||||||
|
@ -156,8 +151,7 @@ class _AddBuildingAndStructureOffline
|
||||||
Container(
|
Container(
|
||||||
child: FormBuilderTextField(
|
child: FormBuilderTextField(
|
||||||
name: 'unit_value',
|
name: 'unit_value',
|
||||||
decoration:
|
decoration: normalTextFieldStyle("Unit Value", ""),
|
||||||
normalTextFieldStyle("Unit Value", ""),
|
|
||||||
validator: FormBuilderValidators.compose([]),
|
validator: FormBuilderValidators.compose([]),
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
// setState(() {
|
// setState(() {
|
||||||
|
@ -176,8 +170,7 @@ class _AddBuildingAndStructureOffline
|
||||||
name: 'dep_rate',
|
name: 'dep_rate',
|
||||||
decoration: normalTextFieldStyle(
|
decoration: normalTextFieldStyle(
|
||||||
"Depreciation Rate", ""),
|
"Depreciation Rate", ""),
|
||||||
validator:
|
validator: FormBuilderValidators.compose([]),
|
||||||
FormBuilderValidators.compose([]),
|
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_depRate = double.parse(value!);
|
_depRate = double.parse(value!);
|
||||||
|
@ -191,10 +184,8 @@ class _AddBuildingAndStructureOffline
|
||||||
Expanded(
|
Expanded(
|
||||||
child: FormBuilderTextField(
|
child: FormBuilderTextField(
|
||||||
name: 'bldg_area',
|
name: 'bldg_area',
|
||||||
decoration:
|
decoration: normalTextFieldStyle("Area", ""),
|
||||||
normalTextFieldStyle("Area", ""),
|
validator: FormBuilderValidators.compose([]),
|
||||||
validator:
|
|
||||||
FormBuilderValidators.compose([]),
|
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_areaValue = double.parse(value!);
|
_areaValue = double.parse(value!);
|
||||||
|
@ -278,46 +269,45 @@ class _AddBuildingAndStructureOffline
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
try {
|
try {
|
||||||
final tempID = await SharedPreferences
|
final tempID =
|
||||||
.getInstance();
|
await SharedPreferences.getInstance();
|
||||||
var bldgStructure = BldgAndStructure(
|
var bldgStructure = BldgAndStructure(
|
||||||
id: 1,
|
id: 1,
|
||||||
bldgapprDetailsId: tempID.getInt(
|
bldgapprDetailsId: tempID.getInt(
|
||||||
'tempid')!,
|
'tempid')!,
|
||||||
assessedById: widget
|
// assessedById: widget
|
||||||
.offlineProfile.id
|
// .offlineProfile.id
|
||||||
.toString(),
|
// .toString(),
|
||||||
assessedByName: widget
|
// assessedByName: widget
|
||||||
.offlineProfile.firstName,
|
// .offlineProfile.firstName,
|
||||||
dateCreated: formatter,
|
// dateCreated: formatter,
|
||||||
dateModified: 'none',
|
// dateModified: 'none',
|
||||||
bldgType: _structureType,
|
bldgType: _structureType,
|
||||||
strucType: _structureType,
|
structType: _structureType,
|
||||||
description: 'None',
|
description: 'None',
|
||||||
actualUse: formKey.currentState
|
buccPercentage: '1',
|
||||||
?.value['actual_use'],
|
actualUse: formKey.currentState?.value[
|
||||||
|
'actual_use'] ??
|
||||||
|
"",
|
||||||
floorCount: '1',
|
floorCount: '1',
|
||||||
bldgArea: _areaValue.toString(),
|
bldgArea: _areaValue.toString(),
|
||||||
unitValue: _unitBase.toString(),
|
unitValue: _unitBase.toString(),
|
||||||
depRate: _depRate.toString(),
|
depRate: _depRate.toString(),
|
||||||
marketValue: _totalMarketValue(
|
marketValue: _totalMarketValue(
|
||||||
_unitBase,
|
_unitBase, _areaValue)
|
||||||
_areaValue)
|
|
||||||
.toString(),
|
.toString(),
|
||||||
depAmount: _amountofDepreciation(
|
depAmount: _amountofDepreciation(
|
||||||
_unitBase,
|
_unitBase, _areaValue, _depRate)
|
||||||
_areaValue,
|
|
||||||
_depRate)
|
|
||||||
.toString(),
|
.toString(),
|
||||||
adjustedMarketValue:
|
adjustedMarketValue:
|
||||||
_adjustedMarketValue(_unitBase,
|
_adjustedMarketValue(_unitBase,
|
||||||
_areaValue, _depRate)
|
_areaValue, _depRate)
|
||||||
.toString());
|
.toString(),
|
||||||
|
genCode: "5TH");
|
||||||
context
|
context
|
||||||
.read<BuildingAndStructureBloc>()
|
.read<BuildingAndStructureBloc>()
|
||||||
.add(AddBuildingAndStructure(
|
.add(AddBuildingAndStructure(
|
||||||
bldgAndStructure:
|
bldgAndStructure: bldgStructure));
|
||||||
bldgStructure));
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
}
|
}
|
||||||
|
@ -339,8 +329,7 @@ class _AddBuildingAndStructureOffline
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context
|
context
|
||||||
.read<BuildingAndStructureBloc>()
|
.read<BuildingAndStructureBloc>()
|
||||||
.add(
|
.add(const LoadBuildingAndStructure());
|
||||||
const LoadBuildingAndStructure());
|
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
primary: Colors.black,
|
primary: Colors.black,
|
||||||
|
@ -353,8 +342,6 @@ class _AddBuildingAndStructureOffline
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Container();
|
return Container();
|
||||||
|
|
|
@ -103,12 +103,8 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
formKey.currentState?.save();
|
formKey.currentState?.save();
|
||||||
},
|
},
|
||||||
autovalidateMode: AutovalidateMode.disabled,
|
autovalidateMode: AutovalidateMode.disabled,
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Container(
|
|
||||||
height: 800,
|
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(2.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
@ -116,10 +112,10 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(
|
margin: const EdgeInsets.only(
|
||||||
left: 0,
|
left: 0, top: 10, right: 0, bottom: 0),
|
||||||
top: 10,
|
child: SizedBox(
|
||||||
right: 0,
|
height: 45,
|
||||||
bottom: 0),
|
width: 300,
|
||||||
child: FormBuilderDropdown(
|
child: FormBuilderDropdown(
|
||||||
name: 'extra_item',
|
name: 'extra_item',
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
|
@ -139,8 +135,7 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
value.minBaseUnitvalPercent!);
|
value.minBaseUnitvalPercent!);
|
||||||
_className = value.componentName!;
|
_className = value.componentName!;
|
||||||
_classId = value.id!;
|
_classId = value.id!;
|
||||||
_withoutBUCC =
|
_withoutBUCC = value.withoutBucc == 1
|
||||||
value.withoutBucc == 1
|
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
});
|
});
|
||||||
|
@ -156,8 +151,7 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
value.maxBaseUnitvalPercent!);
|
value.maxBaseUnitvalPercent!);
|
||||||
_className = value.componentName!;
|
_className = value.componentName!;
|
||||||
_classId = value.id!;
|
_classId = value.id!;
|
||||||
_withoutBUCC =
|
_withoutBUCC = value.withoutBucc == 1
|
||||||
value.withoutBucc == 1
|
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
});
|
});
|
||||||
|
@ -166,118 +160,98 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
value.maxBaseUnitvalPercent
|
value.maxBaseUnitvalPercent
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (value.minUnitvalSqrmtr !=
|
if (value.minUnitvalSqrmtr != '0.00') {
|
||||||
'0.00') {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_unitValue = double.parse(
|
_unitValue = double.parse(
|
||||||
value.minUnitvalSqrmtr!);
|
value.minUnitvalSqrmtr!);
|
||||||
_className = value.componentName!;
|
_className = value.componentName!;
|
||||||
_classId = value.id!;
|
_classId = value.id!;
|
||||||
_withoutBUCC =
|
_withoutBUCC = value.withoutBucc == 1
|
||||||
value.withoutBucc == 1
|
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
});
|
});
|
||||||
formKey.currentState!.patchValue({
|
formKey.currentState!.patchValue({
|
||||||
'unitValue':
|
'unitValue': value.minUnitvalSqrmtr
|
||||||
value.minUnitvalSqrmtr
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (value.maxUnitvalSqrmtr !=
|
if (value.maxUnitvalSqrmtr != '0.00') {
|
||||||
'0.00') {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_unitValue = double.parse(
|
_unitValue = double.parse(
|
||||||
value.maxUnitvalSqrmtr!);
|
value.maxUnitvalSqrmtr!);
|
||||||
_className = value.componentName!;
|
_className = value.componentName!;
|
||||||
_classId = value.id!;
|
_classId = value.id!;
|
||||||
_withoutBUCC =
|
_withoutBUCC = value.withoutBucc == 1
|
||||||
value.withoutBucc == 1
|
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
});
|
});
|
||||||
formKey.currentState!.patchValue({
|
formKey.currentState!.patchValue({
|
||||||
'unitValue':
|
'unitValue': value.maxUnitvalSqrmtr
|
||||||
value.maxUnitvalSqrmtr
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (value.minAddBaseunitval !=
|
if (value.minAddBaseunitval != '0.00') {
|
||||||
'0.00') {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_unitValue = double.parse(
|
_unitValue = double.parse(
|
||||||
value.minAddBaseunitval!);
|
value.minAddBaseunitval!);
|
||||||
_className = value.componentName!;
|
_className = value.componentName!;
|
||||||
_classId = value.id!;
|
_classId = value.id!;
|
||||||
_withoutBUCC =
|
_withoutBUCC = value.withoutBucc == 1
|
||||||
value.withoutBucc == 1
|
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
});
|
});
|
||||||
formKey.currentState!.patchValue({
|
formKey.currentState!.patchValue({
|
||||||
'unitValue':
|
'unitValue': value.minAddBaseunitval
|
||||||
value.minAddBaseunitval
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (value.maxAddBaseunitval !=
|
if (value.maxAddBaseunitval != '0.00') {
|
||||||
'0.00') {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_unitValue = double.parse(
|
_unitValue = double.parse(
|
||||||
value.maxAddBaseunitval!);
|
value.maxAddBaseunitval!);
|
||||||
_className = value.componentName!;
|
_className = value.componentName!;
|
||||||
_classId = value.id!;
|
_classId = value.id!;
|
||||||
_withoutBUCC =
|
_withoutBUCC = value.withoutBucc == 1
|
||||||
value.withoutBucc == 1
|
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
});
|
});
|
||||||
formKey.currentState!.patchValue({
|
formKey.currentState!.patchValue({
|
||||||
'unitValue':
|
'unitValue': value.maxAddBaseunitval
|
||||||
value.maxAddBaseunitval
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (value.minDeductBaserate !=
|
if (value.minDeductBaserate != '0.00') {
|
||||||
'0.00') {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_unitValue = double.parse(
|
_unitValue = double.parse(
|
||||||
value.minDeductBaserate!);
|
value.minDeductBaserate!);
|
||||||
_className = value.componentName!;
|
_className = value.componentName!;
|
||||||
_classId = value.id!;
|
_classId = value.id!;
|
||||||
_withoutBUCC =
|
_withoutBUCC = value.withoutBucc == 1
|
||||||
value.withoutBucc == 1
|
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
});
|
});
|
||||||
formKey.currentState!.patchValue({
|
formKey.currentState!.patchValue({
|
||||||
'unitValue':
|
'unitValue': value.minDeductBaserate
|
||||||
value.minDeductBaserate
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (value.maxDeductBaserate !=
|
if (value.maxDeductBaserate != '0.00') {
|
||||||
'0.00') {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_unitValue = double.parse(
|
_unitValue = double.parse(
|
||||||
value.maxDeductBaserate!);
|
value.maxDeductBaserate!);
|
||||||
_className = value.componentName!;
|
_className = value.componentName!;
|
||||||
_classId = value.id!;
|
_classId = value.id!;
|
||||||
_withoutBUCC =
|
_withoutBUCC = value.withoutBucc == 1
|
||||||
value.withoutBucc == 1
|
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
});
|
});
|
||||||
formKey.currentState!.patchValue({
|
formKey.currentState!.patchValue({
|
||||||
'unitValue':
|
'unitValue': value.maxDeductBaserate
|
||||||
value.maxDeductBaserate
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(
|
margin: const EdgeInsets.only(
|
||||||
left: 0,
|
left: 0, top: 10, right: 0, bottom: 0),
|
||||||
top: 10,
|
|
||||||
right: 0,
|
|
||||||
bottom: 0),
|
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 45,
|
height: 45,
|
||||||
child: SearchField(
|
child: SearchField(
|
||||||
|
@ -290,24 +264,20 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
'${unit.bldgType} - ${unit.building!.toUpperCase()}',
|
'${unit.bldgType} - ${unit.building!.toUpperCase()}',
|
||||||
overflow: TextOverflow
|
overflow:
|
||||||
.ellipsis,
|
TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
)))
|
)))
|
||||||
.toList(),
|
.toList(),
|
||||||
|
|
||||||
validator:
|
validator: FormBuilderValidators.required(
|
||||||
FormBuilderValidators.required(
|
errorText: "This field is required"),
|
||||||
errorText:
|
|
||||||
"This field is required"),
|
|
||||||
|
|
||||||
searchInputDecoration:
|
searchInputDecoration: normalTextFieldStyle(
|
||||||
normalTextFieldStyle(
|
|
||||||
"Structure Type", "")
|
"Structure Type", "")
|
||||||
.copyWith(
|
.copyWith(
|
||||||
suffixIcon: const Icon(
|
suffixIcon: const Icon(
|
||||||
Icons
|
Icons.arrow_drop_down)),
|
||||||
.arrow_drop_down)),
|
|
||||||
////agency suggestion tap
|
////agency suggestion tap
|
||||||
focusNode: focus,
|
focusNode: focus,
|
||||||
suggestionState: Suggestion.expand,
|
suggestionState: Suggestion.expand,
|
||||||
|
@ -323,10 +293,8 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
unit.item!.unitValue);
|
unit.item!.unitValue);
|
||||||
_structureType =
|
_structureType =
|
||||||
'${unit.item!.bldgType} - ${unit.item!.building}';
|
'${unit.item!.bldgType} - ${unit.item!.building}';
|
||||||
formKey.currentState!
|
formKey.currentState!.patchValue({
|
||||||
.patchValue({
|
'unitValue': unit.item!.unitValue
|
||||||
'unitValue':
|
|
||||||
unit.item!.unitValue
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -369,8 +337,7 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
decoration: normalTextFieldStyle(
|
decoration: normalTextFieldStyle(
|
||||||
"Unit Value", ""),
|
"Unit Value", ""),
|
||||||
validator:
|
validator:
|
||||||
FormBuilderValidators.compose(
|
FormBuilderValidators.compose([]),
|
||||||
[]),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
|
@ -378,15 +345,13 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: FormBuilderTextField(
|
child: FormBuilderTextField(
|
||||||
name: 'areaValue',
|
name: 'areaValue',
|
||||||
decoration: normalTextFieldStyle(
|
decoration:
|
||||||
"Area", ""),
|
normalTextFieldStyle("Area", ""),
|
||||||
validator:
|
validator:
|
||||||
FormBuilderValidators.compose(
|
FormBuilderValidators.compose([]),
|
||||||
[]),
|
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_areaValue =
|
_areaValue = double.parse(value!);
|
||||||
double.parse(value!);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -448,8 +413,7 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
const Text(
|
const Text('Building is not painted?'),
|
||||||
'Building is not painted?'),
|
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Container(
|
Container(
|
||||||
child: Row(
|
child: Row(
|
||||||
|
@ -478,12 +442,10 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(
|
BorderRadius.circular(5.0),
|
||||||
5.0),
|
|
||||||
),
|
),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment:
|
alignment: Alignment.center,
|
||||||
Alignment.center,
|
|
||||||
child: Text(' - ' +
|
child: Text(' - ' +
|
||||||
_notPaintedUnitVal
|
_notPaintedUnitVal
|
||||||
.toString() +
|
.toString() +
|
||||||
|
@ -493,8 +455,7 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
const Text(
|
const Text('Uses second hand materials?'),
|
||||||
'Uses second hand materials?'),
|
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
Container(
|
Container(
|
||||||
child: Row(
|
child: Row(
|
||||||
|
@ -504,8 +465,7 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
onChanged: (bool? value) {
|
onChanged: (bool? value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
isSecondHand = value!;
|
isSecondHand = value!;
|
||||||
if (isSecondHand ==
|
if (isSecondHand == false) {
|
||||||
false) {
|
|
||||||
_secondHandUnitVal = 0;
|
_secondHandUnitVal = 0;
|
||||||
formKey.currentState!
|
formKey.currentState!
|
||||||
.patchValue({
|
.patchValue({
|
||||||
|
@ -527,28 +487,23 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
width: 100,
|
width: 100,
|
||||||
child:
|
child: FormBuilderTextField(
|
||||||
FormBuilderTextField(
|
|
||||||
enabled: isSecondHand,
|
enabled: isSecondHand,
|
||||||
name: 'secondHandMat',
|
name: 'secondHandMat',
|
||||||
textAlign:
|
textAlign: TextAlign.center,
|
||||||
TextAlign.center,
|
|
||||||
decoration:
|
decoration:
|
||||||
normalTextFieldStyle(
|
normalTextFieldStyle(
|
||||||
"Unit Value",
|
"Unit Value", ""),
|
||||||
""),
|
|
||||||
validator:
|
validator:
|
||||||
FormBuilderValidators
|
FormBuilderValidators
|
||||||
.compose([]),
|
.compose([]),
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
// Check if the value is not null before parsing to double
|
// Check if the value is not null before parsing to double
|
||||||
if (value != null &&
|
if (value != null &&
|
||||||
value
|
value.isNotEmpty) {
|
||||||
.isNotEmpty) {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_secondHandUnitVal =
|
_secondHandUnitVal =
|
||||||
int.parse(
|
int.parse(value);
|
||||||
value);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Handle the case when the value is empty or null
|
// Handle the case when the value is empty or null
|
||||||
|
@ -566,8 +521,7 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
fontWeight:
|
fontWeight:
|
||||||
FontWeight
|
FontWeight.bold),
|
||||||
.bold),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -592,8 +546,7 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
width: 1.0,
|
width: 1.0,
|
||||||
),
|
),
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
BorderRadius.circular(5.0),
|
|
||||||
),
|
),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
|
@ -611,8 +564,10 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
_notPaintedUnitVal,
|
_notPaintedUnitVal,
|
||||||
_secondHandUnitVal)))),
|
_secondHandUnitVal)))),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 40),
|
||||||
Row(
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 120,
|
width: 120,
|
||||||
|
@ -621,40 +576,37 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
try {
|
try {
|
||||||
final tempID =
|
final tempID = await SharedPreferences
|
||||||
await SharedPreferences
|
|
||||||
.getInstance();
|
.getInstance();
|
||||||
|
|
||||||
context.read<AdditionalItemsOfflineBloc>().add(
|
context
|
||||||
AddAdditionalItems(
|
.read<
|
||||||
|
AdditionalItemsOfflineBloc>()
|
||||||
|
.add(AddAdditionalItems(
|
||||||
id: 1,
|
id: 1,
|
||||||
bldgapprDetailsId: tempID
|
bldgapprDetailsId: tempID.getInt(
|
||||||
.getInt('tempid')!,
|
'tempid')!,
|
||||||
classId: _classId,
|
classId: _classId,
|
||||||
assessedById: widget
|
assessedById: widget
|
||||||
.offlineProfile.id
|
.offlineProfile.id
|
||||||
.toString(),
|
.toString(),
|
||||||
assessedByName: widget
|
assessedByName:
|
||||||
.offlineProfile
|
widget
|
||||||
.firstName!,
|
.offlineProfile.firstName!,
|
||||||
dateCreated: formatter,
|
dateCreated: formatter,
|
||||||
dateModified: 'None',
|
dateModified: 'None',
|
||||||
className: _className,
|
className: _className,
|
||||||
structType:
|
structType: _structureType,
|
||||||
_structureType,
|
unitValue: _withoutBUCC ==
|
||||||
unitValue:
|
true
|
||||||
_withoutBUCC == true
|
|
||||||
? 0
|
? 0
|
||||||
: _unitValue,
|
: _unitValue,
|
||||||
baseUnitValue:
|
baseUnitValue: _unitBase,
|
||||||
_unitBase,
|
|
||||||
area: _areaValue,
|
area: _areaValue,
|
||||||
marketValue:
|
marketValue: (_unitValue *
|
||||||
(_unitValue *
|
|
||||||
_unitBase) *
|
_unitBase) *
|
||||||
_areaValue,
|
_areaValue,
|
||||||
depreciationRate:
|
depreciationRate: _depValue,
|
||||||
_depValue,
|
|
||||||
adjustedMarketVal:
|
adjustedMarketVal:
|
||||||
_totalMarketValue(
|
_totalMarketValue(
|
||||||
_unitValue,
|
_unitValue,
|
||||||
|
@ -678,8 +630,8 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
painted: true,
|
painted: true,
|
||||||
secondhand: true,
|
secondhand: true,
|
||||||
paintedUnitval: '1',
|
paintedUnitval: '1',
|
||||||
secondhandUnitval:
|
secondhandUnitval: '1',
|
||||||
'1'));
|
genCode: "5th"));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Fluttertoast.showToast(
|
Fluttertoast.showToast(
|
||||||
msg:
|
msg:
|
||||||
|
@ -703,10 +655,8 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context
|
context
|
||||||
.read<
|
.read<AdditionalItemsOfflineBloc>()
|
||||||
AdditionalItemsOfflineBloc>()
|
.add(const LoadAdditionalItems());
|
||||||
.add(
|
|
||||||
const LoadAdditionalItems());
|
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
primary: Colors.black,
|
primary: Colors.black,
|
||||||
|
@ -718,8 +668,7 @@ class _AddExtraItemsOffline extends State<AddExtraItemsOffline> {
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
));
|
||||||
)));
|
|
||||||
}
|
}
|
||||||
return Container();
|
return Container();
|
||||||
},
|
},
|
||||||
|
|
|
@ -150,6 +150,9 @@ class _AdditionalItemOfflinePage extends State<AdditionalItemOfflinePage> {
|
||||||
const DataColumn(
|
const DataColumn(
|
||||||
label: Text('Unit Value'),
|
label: Text('Unit Value'),
|
||||||
),
|
),
|
||||||
|
const DataColumn(
|
||||||
|
label: Text('Area'),
|
||||||
|
),
|
||||||
const DataColumn(
|
const DataColumn(
|
||||||
label: Text('% of BUCC'),
|
label: Text('% of BUCC'),
|
||||||
),
|
),
|
||||||
|
@ -168,6 +171,7 @@ class _AdditionalItemOfflinePage extends State<AdditionalItemOfflinePage> {
|
||||||
locale: 'en-PH',
|
locale: 'en-PH',
|
||||||
symbol: "₱",
|
symbol: "₱",
|
||||||
).format(dataRow.baseUnitValue).toString())),
|
).format(dataRow.baseUnitValue).toString())),
|
||||||
|
DataCell(Text(dataRow.area.toString())),
|
||||||
DataCell(Text(dataRow.unitValue.toString())),
|
DataCell(Text(dataRow.unitValue.toString())),
|
||||||
DataCell(Text(NumberFormat.currency(
|
DataCell(Text(NumberFormat.currency(
|
||||||
locale: 'en-PH',
|
locale: 'en-PH',
|
||||||
|
@ -276,29 +280,31 @@ class _AdditionalItemOfflinePage extends State<AdditionalItemOfflinePage> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (state is ShowAddItemsScreen) {
|
if (state is ShowAddItemsScreen) {
|
||||||
return ConstrainedBox(
|
return showDialog(context);
|
||||||
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 Container();
|
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) {
|
if (state is ShowBldgAndStructuresScreen) {
|
||||||
return ConstrainedBox(
|
return showDialog(
|
||||||
constraints: BoxConstraints(maxHeight: 1000.0),
|
context); // Placeholder return; replace with your desired widget
|
||||||
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();
|
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_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.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: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/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/bloc/offline/offline_passo/building/general_description/general_description_bloc.dart';
|
||||||
import 'package:unit2/model/offline/offline_profile.dart';
|
import 'package:unit2/model/offline/offline_profile.dart';
|
||||||
import 'package:unit2/screens/offline/passo/building/add/add_building.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/general_description.dart';
|
||||||
|
import '../../../../../model/passo/unit_construct.dart';
|
||||||
import '../../../../../theme-data.dart/form-style.dart';
|
import '../../../../../theme-data.dart/form-style.dart';
|
||||||
import '../../../../../widgets/passo/custom_button.dart';
|
import '../../../../../widgets/passo/custom_button.dart';
|
||||||
import '../../../../../widgets/passo/custom_formBuilder_fields.dart';
|
import '../../../../../widgets/passo/custom_formBuilder_fields.dart';
|
||||||
|
@ -31,6 +33,8 @@ class GeneralDescriptionOfflinePage extends StatefulWidget {
|
||||||
|
|
||||||
class _GeneralDescriptionOfflinePage
|
class _GeneralDescriptionOfflinePage
|
||||||
extends State<GeneralDescriptionOfflinePage> {
|
extends State<GeneralDescriptionOfflinePage> {
|
||||||
|
final focus = FocusNode();
|
||||||
|
|
||||||
final actual_use = [
|
final actual_use = [
|
||||||
"Residential",
|
"Residential",
|
||||||
"Agricultural",
|
"Agricultural",
|
||||||
|
@ -47,6 +51,10 @@ class _GeneralDescriptionOfflinePage
|
||||||
: now = DateTime.now(),
|
: now = DateTime.now(),
|
||||||
formatter = DateFormat.yMMMMd('en_US').format(DateTime.now());
|
formatter = DateFormat.yMMMMd('en_US').format(DateTime.now());
|
||||||
|
|
||||||
|
late String bldgType;
|
||||||
|
late String bldgKind;
|
||||||
|
late String unitValue;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return BlocConsumer<UnitConstructionAdminBloc, UnitConstructionAdminState>(
|
return BlocConsumer<UnitConstructionAdminBloc, UnitConstructionAdminState>(
|
||||||
|
@ -71,16 +79,46 @@ class _GeneralDescriptionOfflinePage
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(
|
margin: const EdgeInsets.only(
|
||||||
left: 0, top: 10, right: 0, bottom: 0),
|
left: 0, top: 10, right: 0, bottom: 0),
|
||||||
child: FormBuilderDropdown(
|
child: SizedBox(
|
||||||
name: 'bldg_type',
|
height: 45,
|
||||||
autofocus: false,
|
child: SearchField(
|
||||||
decoration: normalTextFieldStyle("Kind of Building", ""),
|
itemHeight: 70,
|
||||||
items: state.unit
|
suggestions: state.unit
|
||||||
.map((e) => DropdownMenuItem(
|
.map((UnitConstruct unit) => SearchFieldListItem(
|
||||||
value: e,
|
'${unit.bldgType} - ${unit.building}',
|
||||||
child: Text('${e.bldgType}-${e.building}'),
|
item: unit,
|
||||||
))
|
child: ListTile(
|
||||||
|
title: Text(
|
||||||
|
'${unit.bldgType} - ${unit.building!.toUpperCase()}',
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
)))
|
||||||
.toList(),
|
.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(
|
customDropDownField(
|
||||||
|
@ -221,37 +259,37 @@ class _GeneralDescriptionOfflinePage
|
||||||
widget.offlineProfile.firstName!,
|
widget.offlineProfile.firstName!,
|
||||||
dateCreated: formatter,
|
dateCreated: formatter,
|
||||||
dateModified: 'None',
|
dateModified: 'None',
|
||||||
bldgKind: offlineBldgKey
|
bldgKind: bldgKind ?? "",
|
||||||
.currentState?.value['bldg_type'].building,
|
strucType: bldgType ?? "",
|
||||||
strucType: offlineBldgKey
|
|
||||||
.currentState?.value['bldg_type'].bldgType,
|
|
||||||
bldgPermit: offlineBldgKey
|
bldgPermit: offlineBldgKey
|
||||||
.currentState?.value['bldg_permit'],
|
.currentState?.value['bldg_permit'] ??
|
||||||
dateIssued: offlineBldgKey.currentState!.value['coc_issued']
|
"",
|
||||||
.toString(),
|
dateIssued: offlineBldgKey
|
||||||
|
.currentState!.value['date_issued']
|
||||||
|
.toString() ??
|
||||||
|
"",
|
||||||
cct: 'None',
|
cct: 'None',
|
||||||
certCompletionIssued: offlineBldgKey
|
certCompletionIssued: offlineBldgKey
|
||||||
.currentState!.value['coc_issued']
|
.currentState!.value['coc_issued']
|
||||||
.toString(),
|
.toString() ??
|
||||||
|
"",
|
||||||
certOccupancyIssued: offlineBldgKey
|
certOccupancyIssued: offlineBldgKey
|
||||||
.currentState!.value['coo_issued']
|
.currentState!.value['coo_issued']
|
||||||
.toString(),
|
.toString() ??
|
||||||
dateCompleted: offlineBldgKey
|
"",
|
||||||
.currentState!.value['date_cnstructed']
|
dateCompleted: offlineBldgKey.currentState!.value['date_cnstructed'].toString() ?? "",
|
||||||
.toString(),
|
dateOccupied: offlineBldgKey.currentState!.value['date_occupied'].toString() ?? "",
|
||||||
dateOccupied: offlineBldgKey
|
bldgAge: offlineBldgKey.currentState!.value['bldg_age'] ?? "",
|
||||||
.currentState!.value['date_occupied']
|
noStoreys: offlineBldgKey.currentState!.value['no_of_storeys'] ?? "",
|
||||||
.toString(),
|
area1Stfloor: offlineBldgKey.currentState!.value['area_of_1stFl'] ?? "",
|
||||||
bldgAge: offlineBldgKey.currentState!.value['bldg_age'],
|
area2Ndfloor: offlineBldgKey.currentState!.value['area_of_2ndFl'] ?? "",
|
||||||
noStoreys: offlineBldgKey.currentState!.value['no_of_storeys'],
|
area3Rdfloor: offlineBldgKey.currentState!.value['area_of_3rdFl'] ?? "",
|
||||||
area1Stfloor: '0',
|
area4Thfloor: offlineBldgKey.currentState!.value['area_of_4thFl'] ?? "",
|
||||||
area2Ndfloor: '0',
|
totalFloorArea: offlineBldgKey.currentState?.value['total_area'] ?? "",
|
||||||
area3Rdfloor: '0',
|
|
||||||
area4Thfloor: '0',
|
|
||||||
totalFloorArea: offlineBldgKey.currentState?.value['total_area'],
|
|
||||||
floorSketch: null,
|
floorSketch: null,
|
||||||
actualUse: offlineBldgKey.currentState?.value['actual_use'],
|
actualUse: offlineBldgKey.currentState?.value['actual_use'] ?? "",
|
||||||
unitValue: offlineBldgKey.currentState?.value['bldg_type'].unitValue));
|
unitValue: unitValue ?? "",
|
||||||
|
genCode: '5th'));
|
||||||
widget.onPutGeneralDescription();
|
widget.onPutGeneralDescription();
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
|
@ -288,18 +288,20 @@ class _LandRefLocationOfflinePage extends State<LandRefLocationOfflinePage> {
|
||||||
dateCreated: 'None',
|
dateCreated: 'None',
|
||||||
dateModified: 'NOne',
|
dateModified: 'NOne',
|
||||||
street: offlineBldgKey
|
street: offlineBldgKey
|
||||||
.currentState?.value['street'],
|
.currentState?.value['street'] ??
|
||||||
|
"",
|
||||||
barangay: offlineBldgKey
|
barangay: offlineBldgKey
|
||||||
.currentState?.value['brgy'],
|
.currentState?.value['brgy'] ??
|
||||||
|
"",
|
||||||
municipality: offlineBldgKey
|
municipality: offlineBldgKey
|
||||||
.currentState
|
.currentState
|
||||||
?.value['municipality']
|
?.value['municipality']
|
||||||
.cityDescription,
|
.cityDescription ??
|
||||||
province: "Agusan Del Norte"));
|
"",
|
||||||
|
province: "Agusan Del Norte",
|
||||||
|
genCode: "5th"));
|
||||||
|
|
||||||
context
|
context.read<LandrefLocationBloc>().add(AddLandRef(
|
||||||
.read<LandrefLocationBloc>()
|
|
||||||
.add(AddLandRef(
|
|
||||||
id: 1,
|
id: 1,
|
||||||
bldgapprDetailsId:
|
bldgapprDetailsId:
|
||||||
tempID.getInt('tempid')!,
|
tempID.getInt('tempid')!,
|
||||||
|
@ -310,20 +312,22 @@ class _LandRefLocationOfflinePage extends State<LandRefLocationOfflinePage> {
|
||||||
dateCreated: 'None',
|
dateCreated: 'None',
|
||||||
dateModified: 'None',
|
dateModified: 'None',
|
||||||
owner: offlineBldgKey
|
owner: offlineBldgKey
|
||||||
.currentState?.value['l_owner'],
|
.currentState?.value['l_owner'] ??
|
||||||
|
"",
|
||||||
cloaNo: offlineBldgKey.currentState
|
cloaNo: offlineBldgKey.currentState
|
||||||
?.value['oct_tct_cloa'],
|
?.value['oct_tct_cloa'] ??
|
||||||
|
"",
|
||||||
lotNo: offlineBldgKey
|
lotNo: offlineBldgKey
|
||||||
.currentState?.value['lot_no'],
|
.currentState?.value['lot_no'] ??
|
||||||
tdn: offlineBldgKey
|
"",
|
||||||
.currentState?.value['l_td_arp'],
|
tdn: offlineBldgKey.currentState
|
||||||
area: offlineBldgKey
|
?.value['l_td_arp'] ??
|
||||||
.currentState?.value['area'],
|
"",
|
||||||
surveyNo: offlineBldgKey
|
area:
|
||||||
.currentState?.value['survey_no'],
|
offlineBldgKey.currentState?.value['area'] ?? "",
|
||||||
blkNo: offlineBldgKey
|
surveyNo: offlineBldgKey.currentState?.value['survey_no'] ?? "",
|
||||||
.currentState?.value['blk_no'],
|
blkNo: offlineBldgKey.currentState?.value['blk_no'] ?? "",
|
||||||
));
|
genCode: '5th'));
|
||||||
|
|
||||||
widget.NextBtn();
|
widget.NextBtn();
|
||||||
},
|
},
|
||||||
|
|
|
@ -549,12 +549,14 @@ class _PropertyAppraisalOfflinePage
|
||||||
textAlign: TextAlign.left),
|
textAlign: TextAlign.left),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(
|
margin: const EdgeInsets.only(
|
||||||
|
@ -569,6 +571,8 @@ class _PropertyAppraisalOfflinePage
|
||||||
textAlign: TextAlign.left),
|
textAlign: TextAlign.left),
|
||||||
),
|
),
|
||||||
DataTable(
|
DataTable(
|
||||||
|
columnSpacing:
|
||||||
|
MediaQuery.of(context).size.width / 3,
|
||||||
columns: [
|
columns: [
|
||||||
const DataColumn(
|
const DataColumn(
|
||||||
label: Text('Building Core'),
|
label: Text('Building Core'),
|
||||||
|
@ -643,7 +647,11 @@ class _PropertyAppraisalOfflinePage
|
||||||
fontSize: 15),
|
fontSize: 15),
|
||||||
textAlign: TextAlign.left),
|
textAlign: TextAlign.left),
|
||||||
),
|
),
|
||||||
DataTable(columns: [
|
DataTable(
|
||||||
|
columnSpacing:
|
||||||
|
MediaQuery.of(context).size.width /
|
||||||
|
3,
|
||||||
|
columns: [
|
||||||
const DataColumn(
|
const DataColumn(
|
||||||
label: Text('Additional Item'),
|
label: Text('Additional Item'),
|
||||||
),
|
),
|
||||||
|
@ -653,10 +661,12 @@ class _PropertyAppraisalOfflinePage
|
||||||
const DataColumn(
|
const DataColumn(
|
||||||
label: Text('Market Value'),
|
label: Text('Market Value'),
|
||||||
),
|
),
|
||||||
], rows: [
|
],
|
||||||
|
rows: [
|
||||||
...addItem.map((dataRow) {
|
...addItem.map((dataRow) {
|
||||||
return DataRow(cells: [
|
return DataRow(cells: [
|
||||||
DataCell(Text(dataRow.className!)),
|
DataCell(
|
||||||
|
Text(dataRow.className!)),
|
||||||
DataCell(Text('')),
|
DataCell(Text('')),
|
||||||
DataCell(Text(
|
DataCell(Text(
|
||||||
NumberFormat.currency(
|
NumberFormat.currency(
|
||||||
|
@ -678,7 +688,8 @@ class _PropertyAppraisalOfflinePage
|
||||||
cells: [
|
cells: [
|
||||||
DataCell(Text('Total',
|
DataCell(Text('Total',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight:
|
||||||
|
FontWeight.bold,
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
color: Colors.red))),
|
color: Colors.red))),
|
||||||
DataCell(Text('')),
|
DataCell(Text('')),
|
||||||
|
@ -687,7 +698,8 @@ class _PropertyAppraisalOfflinePage
|
||||||
NumberFormat.currency(
|
NumberFormat.currency(
|
||||||
locale: 'en-PH',
|
locale: 'en-PH',
|
||||||
symbol: "₱",
|
symbol: "₱",
|
||||||
).format(_totalMarketValue(
|
).format(
|
||||||
|
_totalMarketValue(
|
||||||
addItem)),
|
addItem)),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight:
|
fontWeight:
|
||||||
|
@ -722,7 +734,11 @@ class _PropertyAppraisalOfflinePage
|
||||||
fontSize: 15),
|
fontSize: 15),
|
||||||
textAlign: TextAlign.left),
|
textAlign: TextAlign.left),
|
||||||
),
|
),
|
||||||
DataTable(columns: const [
|
DataTable(
|
||||||
|
columnSpacing:
|
||||||
|
MediaQuery.of(context).size.width /
|
||||||
|
6,
|
||||||
|
columns: const [
|
||||||
DataColumn(
|
DataColumn(
|
||||||
label: Text('Actual Use'),
|
label: Text('Actual Use'),
|
||||||
),
|
),
|
||||||
|
@ -735,24 +751,33 @@ class _PropertyAppraisalOfflinePage
|
||||||
DataColumn(
|
DataColumn(
|
||||||
label: Text('Ass. Value'),
|
label: Text('Ass. Value'),
|
||||||
),
|
),
|
||||||
], rows: <DataRow>[
|
],
|
||||||
|
rows: <DataRow>[
|
||||||
DataRow(
|
DataRow(
|
||||||
cells: <DataCell>[
|
cells: <DataCell>[
|
||||||
DataCell(Text(offlineBldgKey
|
DataCell(Text(offlineBldgKey
|
||||||
.currentState
|
.currentState
|
||||||
?.value['actual_use'])),
|
?.value['actual_use'] ??
|
||||||
DataCell(Text(NumberFormat.currency(
|
"")),
|
||||||
locale: 'en-PH', symbol: "₱")
|
DataCell(Text(NumberFormat
|
||||||
|
.currency(
|
||||||
|
locale: 'en-PH',
|
||||||
|
symbol: "₱")
|
||||||
.format(_calculateMarketValue(
|
.format(_calculateMarketValue(
|
||||||
addItem,
|
addItem,
|
||||||
state.bldgAndStructure)))),
|
state
|
||||||
|
.bldgAndStructure)))),
|
||||||
DataCell(
|
DataCell(
|
||||||
Text(
|
Text(
|
||||||
assessmentLevel(
|
assessmentLevel(
|
||||||
_calculateMarketValue(addItem,
|
_calculateMarketValue(
|
||||||
state.bldgAndStructure),
|
addItem,
|
||||||
offlineBldgKey.currentState
|
state
|
||||||
?.value['actual_use']),
|
.bldgAndStructure),
|
||||||
|
offlineBldgKey
|
||||||
|
.currentState
|
||||||
|
?.value[
|
||||||
|
'actual_use']),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
|
|
|
@ -10,6 +10,7 @@ import 'package:unit2/model/offline/offline_profile.dart';
|
||||||
import 'package:unit2/screens/offline/passo/building/add/add_building.dart';
|
import 'package:unit2/screens/offline/passo/building/add/add_building.dart';
|
||||||
import 'package:accordion/accordion.dart';
|
import 'package:accordion/accordion.dart';
|
||||||
import 'package:accordion/controllers.dart';
|
import 'package:accordion/controllers.dart';
|
||||||
|
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||||
|
|
||||||
import '../../../../../bloc/offline/offline_passo/building/assessment_offline/bldg_assessment_offline_bloc.dart';
|
import '../../../../../bloc/offline/offline_passo/building/assessment_offline/bldg_assessment_offline_bloc.dart';
|
||||||
import '../../../../../model/passo/memoranda.dart';
|
import '../../../../../model/passo/memoranda.dart';
|
||||||
|
@ -36,18 +37,26 @@ class _PropertyAssessmentOfflinePage
|
||||||
bool isExempt = false;
|
bool isExempt = false;
|
||||||
String _memoranda = "";
|
String _memoranda = "";
|
||||||
String _notes = "";
|
String _notes = "";
|
||||||
|
String appraised_by = "";
|
||||||
|
String rec_by = "";
|
||||||
|
String approved_by = "";
|
||||||
|
String appraised_by_designation = "";
|
||||||
|
String rec_by_designation = "";
|
||||||
|
String approved_by_designation = "";
|
||||||
final focus = FocusNode();
|
final focus = FocusNode();
|
||||||
final focuss = FocusNode();
|
final focuss = FocusNode();
|
||||||
final appraisedByFocus = FocusNode();
|
final appraisedByFocus = FocusNode();
|
||||||
final recByFocus = FocusNode();
|
final recByFocus = FocusNode();
|
||||||
final apprvdByFocus = FocusNode();
|
final apprvdByFocus = FocusNode();
|
||||||
|
|
||||||
|
final quarter = ['1st', '2nd', '3rd', '4th'];
|
||||||
|
|
||||||
TextEditingController memorandaController = TextEditingController();
|
TextEditingController memorandaController = TextEditingController();
|
||||||
TextEditingController noteController = TextEditingController();
|
TextEditingController noteController = TextEditingController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var width = MediaQuery.of(context).size.width;
|
||||||
return BlocConsumer<MemorandaAdminBloc, MemorandaAdminState>(
|
return BlocConsumer<MemorandaAdminBloc, MemorandaAdminState>(
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
// TODO: implement listener
|
// TODO: implement listener
|
||||||
|
@ -124,7 +133,7 @@ class _PropertyAssessmentOfflinePage
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
const Text(
|
const Text(
|
||||||
'EFFECTIVITY OF ASSESSMENT / REASSESSMENT :',
|
'EFFECTIVITY OF ASSESSMENT / REASSESSMENT / SWORN STATEMENT:',
|
||||||
style: TextStyle(fontWeight: FontWeight.bold),
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
|
@ -134,32 +143,61 @@ class _PropertyAssessmentOfflinePage
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceAround,
|
MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
const Text('Qtr.'),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 70,
|
width: width / 3 - 20,
|
||||||
height: 25,
|
height: 50,
|
||||||
child: FormBuilderTextField(
|
child: customDropDownField(
|
||||||
name: 'qtr',
|
'Qtr', '', 'qtr', quarter)),
|
||||||
validator:
|
SizedBox(
|
||||||
FormBuilderValidators.compose([]),
|
width: width / 3 - 20,
|
||||||
|
height: 50,
|
||||||
|
child: customTextField(
|
||||||
|
'Sworn Statement No.',
|
||||||
|
'',
|
||||||
|
'sworn_statement')),
|
||||||
|
SizedBox(
|
||||||
|
width: width / 3 - 20,
|
||||||
|
height: 50,
|
||||||
|
child:
|
||||||
|
customTextField('Year', '', 'yr')),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 30,
|
||||||
|
),
|
||||||
|
const Divider(
|
||||||
|
thickness: 2,
|
||||||
|
),
|
||||||
|
SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: Expanded(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
const SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: width / 2 - 100,
|
||||||
|
height: 50,
|
||||||
|
child: customDatTimePicker(
|
||||||
|
'Date Received',
|
||||||
|
'',
|
||||||
|
'date_received')),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 20,
|
width: 20,
|
||||||
),
|
),
|
||||||
const Text('Yr.'),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 70,
|
width: width / 2 - 100,
|
||||||
height: 25,
|
height: 50,
|
||||||
child: FormBuilderTextField(
|
child: customDatTimePicker(
|
||||||
name: 'yr',
|
'Date of Entry',
|
||||||
validator:
|
'',
|
||||||
FormBuilderValidators.compose([]),
|
'date_of_entry'))
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
|
@ -175,125 +213,117 @@ class _PropertyAssessmentOfflinePage
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
height: 15,
|
||||||
),
|
),
|
||||||
|
SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: Row(children: [
|
||||||
Column(
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SearchField(
|
const Text('Name'),
|
||||||
itemHeight: 70,
|
Container(
|
||||||
|
padding: EdgeInsets.fromLTRB(20, 0, 0, 0),
|
||||||
|
margin: const EdgeInsets.fromLTRB(
|
||||||
|
0, 10, 0, 0),
|
||||||
|
width: 250,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors
|
||||||
|
.grey, // You can set the color here
|
||||||
|
width:
|
||||||
|
0.9, // You can set the width here
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
5), // Set the border radius here
|
||||||
|
),
|
||||||
|
child: SearchField(
|
||||||
|
itemHeight: 65,
|
||||||
|
|
||||||
suggestions: state.signatories
|
suggestions: state.signatories
|
||||||
.map((Signatories signatories) =>
|
.map((Signatories signatories) =>
|
||||||
SearchFieldListItem(
|
SearchFieldListItem(
|
||||||
'${signatories.firstname} ${signatories.lastname}',
|
'${signatories.firstname} ${signatories.middlename} ${signatories.lastname}',
|
||||||
item: signatories,
|
item: signatories,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
'${signatories.firstname} ${signatories.lastname!}',
|
'${signatories.firstname} ${signatories.middlename} ${signatories.lastname!}',
|
||||||
overflow:
|
overflow: TextOverflow
|
||||||
TextOverflow.ellipsis,
|
.ellipsis,
|
||||||
textAlign: TextAlign.center,
|
textAlign:
|
||||||
|
TextAlign.center,
|
||||||
),
|
),
|
||||||
)))
|
)))
|
||||||
.toList(),
|
.toList(),
|
||||||
|
|
||||||
validator: FormBuilderValidators.required(
|
validator:
|
||||||
errorText: "This field is required"),
|
FormBuilderValidators.required(
|
||||||
|
errorText:
|
||||||
|
"This field is required"),
|
||||||
|
searchStyle: TextStyle(),
|
||||||
|
|
||||||
// searchInputDecoration:
|
|
||||||
// normalTextFieldStyle("Appraised by", "")
|
|
||||||
// .copyWith(
|
|
||||||
// suffixIcon: const Icon(
|
|
||||||
// Icons.arrow_drop_down)),
|
|
||||||
////agency suggestion tap
|
////agency suggestion tap
|
||||||
focusNode: appraisedByFocus,
|
focusNode: appraisedByFocus,
|
||||||
suggestionState: Suggestion.expand,
|
suggestionState: Suggestion.expand,
|
||||||
onSuggestionTap: (unit) {
|
onSuggestionTap: (appraised) {
|
||||||
setState(() {});
|
setState(() {
|
||||||
|
appraised_by =
|
||||||
|
"${appraised.item?.firstname} ${appraised.item?.middlename} ${appraised.item?.lastname}";
|
||||||
|
appraised_by_designation =
|
||||||
|
appraised.item!.designation;
|
||||||
|
});
|
||||||
appraisedByFocus.unfocus();
|
appraisedByFocus.unfocus();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Text(
|
),
|
||||||
'Name',
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14),
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
width: 10,
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
Text('Designation'),
|
||||||
width: 200,
|
Container(
|
||||||
child: FormBuilderDateTimePicker(
|
padding:
|
||||||
name: 'app_date',
|
EdgeInsets.fromLTRB(10, 15, 10, 10),
|
||||||
initialEntryMode:
|
margin: const EdgeInsets.fromLTRB(
|
||||||
DatePickerEntryMode.calendarOnly,
|
0, 10, 0, 0),
|
||||||
initialValue: DateTime.now(),
|
width: 250,
|
||||||
inputType: InputType.date,
|
height: 50,
|
||||||
format: DateFormat('MMMM dd, yyyy'),
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors
|
||||||
|
.grey, // You can set the color here
|
||||||
|
width:
|
||||||
|
0.9, // You can set the width here
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
5), // Set the border radius here
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
appraised_by_designation
|
||||||
|
.toUpperCase(),
|
||||||
|
style: TextStyle(fontSize: 15),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
|
)),
|
||||||
initialTime:
|
|
||||||
const TimeOfDay(hour: 8, minute: 0),
|
|
||||||
// locale: const Locale.fromSubtags(languageCode: 'fr'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Text(
|
|
||||||
'Date',
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// Row(
|
const SizedBox(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
width: 10,
|
||||||
// children: [
|
),
|
||||||
// Column(
|
Column(
|
||||||
// children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
// SizedBox(
|
children: [
|
||||||
// width: 200,
|
Text('Date'),
|
||||||
// child: FormBuilderDropdown<Signatories>(
|
Container(
|
||||||
// name: 'appraised_by',
|
width: 100,
|
||||||
// autofocus: false,
|
child: customDatTimePicker(
|
||||||
// items: state.signatories
|
'', '', 'app_date')),
|
||||||
// .map((signatories) =>
|
],
|
||||||
// DropdownMenuItem(
|
),
|
||||||
// value: signatories,
|
]),
|
||||||
// child: Text(
|
),
|
||||||
// '${signatories.firstname} ${signatories.middlename} ${signatories.lastname}'),
|
|
||||||
// ))
|
|
||||||
// .toList()),
|
|
||||||
// ),
|
|
||||||
// const 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'),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const Text('Date'),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
),
|
),
|
||||||
|
@ -306,104 +336,116 @@ class _PropertyAssessmentOfflinePage
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
height: 15,
|
||||||
),
|
),
|
||||||
|
SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: Row(children: [
|
||||||
Column(
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SearchField(
|
const Text('Name'),
|
||||||
itemHeight: 70,
|
Container(
|
||||||
|
padding: EdgeInsets.fromLTRB(20, 0, 0, 0),
|
||||||
|
margin: const EdgeInsets.fromLTRB(
|
||||||
|
0, 10, 0, 0),
|
||||||
|
width: 250,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors
|
||||||
|
.grey, // You can set the color here
|
||||||
|
width:
|
||||||
|
0.9, // You can set the width here
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
5), // Set the border radius here
|
||||||
|
),
|
||||||
|
child: SearchField(
|
||||||
|
itemHeight: 65,
|
||||||
|
|
||||||
suggestions: state.signatories
|
suggestions: state.signatories
|
||||||
.map((Signatories signatories) =>
|
.map((Signatories signatories) =>
|
||||||
SearchFieldListItem(
|
SearchFieldListItem(
|
||||||
'${signatories.firstname} ${signatories.lastname}',
|
'${signatories.firstname} ${signatories.middlename} ${signatories.lastname}',
|
||||||
item: signatories,
|
item: signatories,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
'${signatories.firstname} ${signatories.lastname!}',
|
'${signatories.firstname} ${signatories.middlename} ${signatories.lastname!}',
|
||||||
overflow:
|
overflow: TextOverflow
|
||||||
TextOverflow.ellipsis,
|
.ellipsis,
|
||||||
textAlign: TextAlign.center,
|
textAlign:
|
||||||
|
TextAlign.center,
|
||||||
),
|
),
|
||||||
)))
|
)))
|
||||||
.toList(),
|
.toList(),
|
||||||
|
|
||||||
validator: FormBuilderValidators.required(
|
validator:
|
||||||
errorText: "This field is required"),
|
FormBuilderValidators.required(
|
||||||
|
errorText:
|
||||||
|
"This field is required"),
|
||||||
|
searchStyle: TextStyle(),
|
||||||
|
|
||||||
// searchInputDecoration:
|
|
||||||
// normalTextFieldStyle("Appraised by", "")
|
|
||||||
// .copyWith(
|
|
||||||
// suffixIcon: const Icon(
|
|
||||||
// Icons.arrow_drop_down)),
|
|
||||||
////agency suggestion tap
|
////agency suggestion tap
|
||||||
focusNode: recByFocus,
|
focusNode: recByFocus,
|
||||||
suggestionState: Suggestion.expand,
|
suggestionState: Suggestion.expand,
|
||||||
onSuggestionTap: (unit) {
|
onSuggestionTap: (appraised) {
|
||||||
setState(() {});
|
setState(() {
|
||||||
|
rec_by =
|
||||||
|
"${appraised.item?.firstname} ${appraised.item?.middlename} ${appraised.item?.lastname}";
|
||||||
|
rec_by_designation =
|
||||||
|
appraised.item!.designation;
|
||||||
|
});
|
||||||
recByFocus.unfocus();
|
recByFocus.unfocus();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Text(
|
),
|
||||||
'Name',
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14),
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
Column(
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
Text('Designation'),
|
||||||
width: 200,
|
Container(
|
||||||
child: FormBuilderDateTimePicker(
|
padding:
|
||||||
name: 'rec_date',
|
EdgeInsets.fromLTRB(10, 15, 10, 10),
|
||||||
initialEntryMode:
|
margin: const EdgeInsets.fromLTRB(
|
||||||
DatePickerEntryMode.calendarOnly,
|
0, 10, 0, 0),
|
||||||
initialValue: DateTime.now(),
|
width: 250,
|
||||||
inputType: InputType.date,
|
height: 50,
|
||||||
format: DateFormat('MMMM dd, yyyy'),
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors
|
||||||
|
.grey, // You can set the color here
|
||||||
|
width:
|
||||||
|
0.9, // You can set the width here
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
5), // Set the border radius here
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
rec_by_designation.toUpperCase(),
|
||||||
|
style: TextStyle(fontSize: 15),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
|
)),
|
||||||
initialTime:
|
|
||||||
const TimeOfDay(hour: 8, minute: 0),
|
|
||||||
// locale: const Locale.fromSubtags(languageCode: 'fr'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Text(
|
|
||||||
'Date',
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// Row(
|
const SizedBox(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
width: 10,
|
||||||
// children: [
|
),
|
||||||
// Column(
|
Column(
|
||||||
// children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
// SizedBox(
|
children: [
|
||||||
// width: 200,
|
Text('Date'),
|
||||||
// child: FormBuilderDropdown<Signatories>(
|
Container(
|
||||||
// name: 'rec_approval',
|
width: 100,
|
||||||
// autofocus: false,
|
child: customDatTimePicker(
|
||||||
// items: state.signatories
|
'', '', 'rec_date')),
|
||||||
// .map((signatories) =>
|
],
|
||||||
// DropdownMenuItem(
|
),
|
||||||
// value: signatories,
|
]),
|
||||||
// child: Text(
|
),
|
||||||
// '${signatories.firstname} ${signatories.middlename} ${signatories.lastname}'),
|
|
||||||
// ))
|
|
||||||
// .toList()),
|
|
||||||
// ),
|
|
||||||
// const Text('Name'),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// const SizedBox(
|
|
||||||
// width: 15,
|
|
||||||
// ),
|
|
||||||
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
),
|
),
|
||||||
|
@ -415,50 +457,105 @@ class _PropertyAssessmentOfflinePage
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
|
const SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: Row(children: [
|
||||||
Column(
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Center(
|
const Text('Name'),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.fromLTRB(20, 0, 0, 0),
|
||||||
|
margin: const EdgeInsets.fromLTRB(
|
||||||
|
0, 10, 0, 0),
|
||||||
|
width: 250,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors
|
||||||
|
.grey, // You can set the color here
|
||||||
|
width:
|
||||||
|
0.9, // You can set the width here
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
5), // Set the border radius here
|
||||||
|
),
|
||||||
child: SearchField(
|
child: SearchField(
|
||||||
itemHeight: 70,
|
itemHeight: 65,
|
||||||
|
|
||||||
suggestions: state.signatories
|
suggestions: state.signatories
|
||||||
.map(
|
.map((Signatories signatories) =>
|
||||||
(Signatories signatories) =>
|
|
||||||
SearchFieldListItem(
|
SearchFieldListItem(
|
||||||
'${signatories.firstname} ${signatories.lastname}',
|
'${signatories.firstname} ${signatories.middlename} ${signatories.lastname}',
|
||||||
item: signatories,
|
item: signatories,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Padding(
|
title: Text(
|
||||||
padding:
|
'${signatories.firstname} ${signatories.middlename} ${signatories.lastname!}',
|
||||||
const EdgeInsets.all(8.0),
|
overflow: TextOverflow
|
||||||
child: Text(
|
.ellipsis,
|
||||||
'${signatories.firstname} ${signatories.lastname!}',
|
textAlign:
|
||||||
overflow:
|
TextAlign.center,
|
||||||
TextOverflow.ellipsis,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
),
|
||||||
),
|
)))
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.toList(),
|
.toList(),
|
||||||
validator: FormBuilderValidators.required(
|
|
||||||
errorText: "This field is required"),
|
validator:
|
||||||
|
FormBuilderValidators.required(
|
||||||
|
errorText:
|
||||||
|
"This field is required"),
|
||||||
|
searchStyle: TextStyle(),
|
||||||
|
|
||||||
|
////agency suggestion tap
|
||||||
focusNode: apprvdByFocus,
|
focusNode: apprvdByFocus,
|
||||||
suggestionState: Suggestion.expand,
|
suggestionState: Suggestion.expand,
|
||||||
onSuggestionTap: (unit) {
|
onSuggestionTap: (appraised) {
|
||||||
setState(() {});
|
setState(() {
|
||||||
|
approved_by =
|
||||||
|
"${appraised.item?.firstname} ${appraised.item?.middlename} ${appraised.item?.lastname}";
|
||||||
|
approved_by_designation =
|
||||||
|
appraised.item!.designation;
|
||||||
|
});
|
||||||
apprvdByFocus.unfocus();
|
apprvdByFocus.unfocus();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
|
||||||
'Name',
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text('Designation'),
|
||||||
|
Container(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.fromLTRB(10, 15, 10, 10),
|
||||||
|
margin: const EdgeInsets.fromLTRB(
|
||||||
|
0, 10, 0, 0),
|
||||||
|
width: 250,
|
||||||
|
height: 50,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors
|
||||||
|
.grey, // You can set the color here
|
||||||
|
width:
|
||||||
|
0.9, // You can set the width here
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
5), // Set the border radius here
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
approved_by_designation.toUpperCase(),
|
||||||
|
style: TextStyle(fontSize: 15),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 50,
|
height: 50,
|
||||||
|
@ -525,7 +622,7 @@ class _PropertyAssessmentOfflinePage
|
||||||
setState(() {
|
setState(() {
|
||||||
_memoranda = memorandaController.text;
|
_memoranda = memorandaController.text;
|
||||||
});
|
});
|
||||||
focus.unfocus();
|
focuss.unfocus();
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
Container(
|
Container(
|
||||||
|
@ -607,7 +704,7 @@ class _PropertyAssessmentOfflinePage
|
||||||
suggestionDirection: SuggestionDirection.up,
|
suggestionDirection: SuggestionDirection.up,
|
||||||
onSuggestionTap: (memoranda) {
|
onSuggestionTap: (memoranda) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_memoranda = memorandaController.text;
|
_notes = noteController.text;
|
||||||
});
|
});
|
||||||
focus.unfocus();
|
focus.unfocus();
|
||||||
},
|
},
|
||||||
|
@ -683,93 +780,6 @@ class _PropertyAssessmentOfflinePage
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
|
|
||||||
const SizedBox(
|
|
||||||
height: 30,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const Text('Sworn Statement No. :'),
|
|
||||||
SizedBox(
|
|
||||||
width: 150,
|
|
||||||
height: 20,
|
|
||||||
child: FormBuilderTextField(
|
|
||||||
name: 'sworn_statement',
|
|
||||||
decoration: const InputDecoration(),
|
|
||||||
validator:
|
|
||||||
FormBuilderValidators.compose([]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 30,
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const 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: [
|
|
||||||
const Text('By:'),
|
|
||||||
SizedBox(
|
|
||||||
width: 150,
|
|
||||||
height: 20,
|
|
||||||
child: FormBuilderTextField(
|
|
||||||
name: 'by',
|
|
||||||
decoration: const InputDecoration(),
|
|
||||||
validator:
|
|
||||||
FormBuilderValidators.compose([]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
),
|
),
|
||||||
|
@ -782,11 +792,22 @@ class _PropertyAssessmentOfflinePage
|
||||||
// propertyAssessments = [];
|
// propertyAssessments = [];
|
||||||
DateTime? appDate = offlineBldgKey
|
DateTime? appDate = offlineBldgKey
|
||||||
.currentState!.value['app_date'];
|
.currentState!.value['app_date'];
|
||||||
|
DateTime? recDate = offlineBldgKey
|
||||||
|
.currentState!.value['rec_date'];
|
||||||
|
DateTime? dateReceived = offlineBldgKey
|
||||||
|
.currentState!.value['date_received'];
|
||||||
|
DateTime? entryDate = offlineBldgKey
|
||||||
|
.currentState!.value['date_of_entry'];
|
||||||
String appDateString =
|
String appDateString =
|
||||||
appDate != null ? appDate.toString() : '';
|
appDate != null ? appDate.toString() : '';
|
||||||
context
|
String recDateString =
|
||||||
.read<BldgAssessmentOfflineBloc>()
|
recDate != null ? recDate.toString() : '';
|
||||||
.add(AddBldgAssessment(
|
String receivedDateString =
|
||||||
|
recDate != null ? recDate.toString() : '';
|
||||||
|
String entryDateString =
|
||||||
|
recDate != null ? recDate.toString() : '';
|
||||||
|
context.read<BldgAssessmentOfflineBloc>().add(
|
||||||
|
AddBldgAssessment(
|
||||||
id: 1,
|
id: 1,
|
||||||
bldgapprDetailsId:
|
bldgapprDetailsId:
|
||||||
tempID.getInt('tempid')!,
|
tempID.getInt('tempid')!,
|
||||||
|
@ -804,84 +825,38 @@ class _PropertyAssessmentOfflinePage
|
||||||
assessedValue: '0.00',
|
assessedValue: '0.00',
|
||||||
taxable: isTaxable == true ? '1' : '0',
|
taxable: isTaxable == true ? '1' : '0',
|
||||||
exempt: isExempt == true ? '1' : '0',
|
exempt: isExempt == true ? '1' : '0',
|
||||||
qtr: int.parse(offlineBldgKey
|
qtr: offlineBldgKey
|
||||||
.currentState!.value['qtr'] ??
|
.currentState!.value['qtr'] ??
|
||||||
|
'0', // Replace null with '0'
|
||||||
|
yr: int.parse(
|
||||||
|
offlineBldgKey.currentState!.value['yr'] ??
|
||||||
'0'), // Replace null with '0'
|
'0'), // Replace null with '0'
|
||||||
yr: int.parse(offlineBldgKey
|
appraisedbyName: appraised_by,
|
||||||
.currentState!.value['yr'] ??
|
|
||||||
'0'), // Replace null with '0'
|
|
||||||
appraisedbyName: (offlineBldgKey
|
|
||||||
.currentState!
|
|
||||||
.value['appraised_by']
|
|
||||||
?.firstname ??
|
|
||||||
'') +
|
|
||||||
' ' +
|
|
||||||
(offlineBldgKey
|
|
||||||
.currentState!
|
|
||||||
.value['appraised_by']
|
|
||||||
?.middlename ??
|
|
||||||
'') +
|
|
||||||
' ' +
|
|
||||||
(offlineBldgKey
|
|
||||||
.currentState!
|
|
||||||
.value['appraised_by']
|
|
||||||
?.lastname ??
|
|
||||||
''),
|
|
||||||
appraisedbyDate:
|
appraisedbyDate:
|
||||||
appDateString, // Replace null with current date
|
appDateString, // Replace null with current date
|
||||||
recommendapprName: (offlineBldgKey
|
recommendapprName: rec_by,
|
||||||
.currentState!
|
recommendapprDate:
|
||||||
.value['rec_approval']
|
recDateString, // Replace null with current date
|
||||||
?.firstname ??
|
approvedbyName: approved_by,
|
||||||
'') +
|
|
||||||
' ' +
|
|
||||||
(offlineBldgKey
|
|
||||||
.currentState!
|
|
||||||
.value['rec_approval']
|
|
||||||
?.middlename ??
|
|
||||||
'') +
|
|
||||||
' ' +
|
|
||||||
(offlineBldgKey
|
|
||||||
.currentState!
|
|
||||||
.value['rec_approval']
|
|
||||||
?.lastname ??
|
|
||||||
''),
|
|
||||||
recommendapprDate: offlineBldgKey
|
|
||||||
.currentState!.value['rec_date']
|
|
||||||
.toString(), // Replace null with current date
|
|
||||||
approvedbyName: (offlineBldgKey
|
|
||||||
.currentState!
|
|
||||||
.value['apprvd_by']
|
|
||||||
?.firstname ??
|
|
||||||
'') +
|
|
||||||
' ' +
|
|
||||||
(offlineBldgKey
|
|
||||||
.currentState!
|
|
||||||
.value['apprvd_by']
|
|
||||||
?.middlename ??
|
|
||||||
'') +
|
|
||||||
' ' +
|
|
||||||
(offlineBldgKey
|
|
||||||
.currentState!
|
|
||||||
.value['apprvd_by']
|
|
||||||
?.lastname ??
|
|
||||||
''),
|
|
||||||
memoranda: _memoranda,
|
memoranda: _memoranda,
|
||||||
|
note: _notes,
|
||||||
swornstatementNo: offlineBldgKey
|
swornstatementNo: offlineBldgKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['sworn_statement'] ??
|
.value['sworn_statement'] ??
|
||||||
'', // Replace null with an empty string
|
'', // Replace null with an empty string
|
||||||
dateReceived: offlineBldgKey
|
dateReceived: receivedDateString,
|
||||||
.currentState!.value['date_received']
|
|
||||||
.toString(),
|
|
||||||
// Replace null with current date
|
// Replace null with current date
|
||||||
entryDateAssessment: offlineBldgKey
|
entryDateAssessment: entryDateString,
|
||||||
.currentState!.value['date_of_entry']
|
|
||||||
.toString(),
|
|
||||||
// Replace null with current date
|
// Replace null with current date
|
||||||
entryDateBy: offlineBldgKey
|
entryDateBy:
|
||||||
.currentState!.value['by'] ??
|
widget.offlineProfile.firstName!,
|
||||||
'', // Replace null with an empty string
|
genCode: '5th',
|
||||||
|
appraisedbyDesignation:
|
||||||
|
appraised_by_designation,
|
||||||
|
approvedbyDesignation:
|
||||||
|
approved_by_designation,
|
||||||
|
recommendapprDesignation: rec_by_designation
|
||||||
|
// Replace null with an empty string
|
||||||
));
|
));
|
||||||
|
|
||||||
widget.function();
|
widget.function();
|
||||||
|
@ -889,9 +864,9 @@ class _PropertyAssessmentOfflinePage
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: primary,
|
backgroundColor: primary,
|
||||||
foregroundColor: Colors.red),
|
foregroundColor: Colors.red),
|
||||||
child: const SizedBox(
|
child: const Expanded(
|
||||||
width: 200,
|
child: Padding(
|
||||||
height: 50,
|
padding: EdgeInsets.all(15.0),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -904,6 +879,7 @@ class _PropertyAssessmentOfflinePage
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
),
|
),
|
||||||
|
|
|
@ -60,7 +60,27 @@ class _PropertyInfoPage extends State<PropertyInfoOfflinePage> {
|
||||||
child: customTextField("Pin", "", 'pin')),
|
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'),
|
customTextField("Address", "", 'address'),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
@ -121,7 +141,14 @@ class _PropertyInfoPage extends State<PropertyInfoOfflinePage> {
|
||||||
'',
|
'',
|
||||||
pin:
|
pin:
|
||||||
offlineBldgKey.currentState!.value['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:
|
address:
|
||||||
offlineBldgKey.currentState!.value['address'] ??
|
offlineBldgKey.currentState!.value['address'] ??
|
||||||
|
@ -130,19 +157,17 @@ class _PropertyInfoPage extends State<PropertyInfoOfflinePage> {
|
||||||
'',
|
'',
|
||||||
tin:
|
tin:
|
||||||
offlineBldgKey.currentState!.value['tin'] ?? '',
|
offlineBldgKey.currentState!.value['tin'] ?? '',
|
||||||
adminUser: offlineBldgKey
|
adminUser:
|
||||||
.currentState!.value['benificiary'] ??
|
offlineBldgKey.currentState!.value['benificiary'] ?? '',
|
||||||
'',
|
adminAddress: offlineBldgKey.currentState!.value['benificiary_address'] ?? '',
|
||||||
adminAddress: offlineBldgKey.currentState!
|
|
||||||
.value['benificiary_address'] ??
|
|
||||||
'',
|
|
||||||
adminTin: offlineBldgKey.currentState!.value['benificiary_tin'] ?? '',
|
adminTin: offlineBldgKey.currentState!.value['benificiary_tin'] ?? '',
|
||||||
adminTelno: offlineBldgKey.currentState!.value['benificiary_telno'] ?? '',
|
adminTelno: offlineBldgKey.currentState!.value['benificiary_telno'] ?? '',
|
||||||
faasType: "BUILDING",
|
faasType: "BUILDING",
|
||||||
assessedById: widget.offlineProfile.id.toString(),
|
assessedById: widget.offlineProfile.id.toString(),
|
||||||
assessedByName: widget.offlineProfile.firstName!,
|
assessedByName: widget.offlineProfile.firstName!,
|
||||||
dateCreated: formatter,
|
dateCreated: formatter,
|
||||||
dateModified: ''),
|
dateModified: '',
|
||||||
|
genCode: '5th'),
|
||||||
);
|
);
|
||||||
widget.handleButtonPress();
|
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/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||||
import 'package:unit2/model/passo/structural_materials_ii.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/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_button.dart';
|
||||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||||
|
|
||||||
|
@ -408,7 +407,8 @@ class _StructuralMaterialsOfflinePage
|
||||||
|
|
||||||
context
|
context
|
||||||
.read<StructuralMaterialOfflineBloc>()
|
.read<StructuralMaterialOfflineBloc>()
|
||||||
.add(AddStructuralMaterial(
|
.add(
|
||||||
|
AddStructuralMaterial(
|
||||||
id: 1,
|
id: 1,
|
||||||
bldgapprDetailsId: tempID.getInt('tempid')!,
|
bldgapprDetailsId: tempID.getInt('tempid')!,
|
||||||
assessedById: '',
|
assessedById: '',
|
||||||
|
@ -417,14 +417,14 @@ class _StructuralMaterialsOfflinePage
|
||||||
dateModified: '',
|
dateModified: '',
|
||||||
foundation: foundationOthers
|
foundation: foundationOthers
|
||||||
? [
|
? [
|
||||||
offlineBldgKey
|
offlineBldgKey.currentState!
|
||||||
.currentState!.value['other_foundation']
|
.value['other_foundation']
|
||||||
]
|
]
|
||||||
: widget.foundation,
|
: widget.foundation,
|
||||||
columns: columOthers
|
columns: columOthers
|
||||||
? [
|
? [
|
||||||
offlineBldgKey
|
offlineBldgKey.currentState!
|
||||||
.currentState!.value['other_column']
|
.value['other_column']
|
||||||
]
|
]
|
||||||
: widget.column,
|
: widget.column,
|
||||||
beams: beamsOthers
|
beams: beamsOthers
|
||||||
|
@ -447,8 +447,8 @@ class _StructuralMaterialsOfflinePage
|
||||||
: widget.roof,
|
: widget.roof,
|
||||||
flooring: flooringOthers
|
flooring: flooringOthers
|
||||||
? [
|
? [
|
||||||
offlineBldgKey
|
offlineBldgKey.currentState!
|
||||||
.currentState!.value['other_flooring']
|
.value['other_flooring']
|
||||||
]
|
]
|
||||||
: widget.flooring,
|
: widget.flooring,
|
||||||
walls: wpOthers
|
walls: wpOthers
|
||||||
|
@ -458,7 +458,7 @@ class _StructuralMaterialsOfflinePage
|
||||||
]
|
]
|
||||||
: widget.walls,
|
: widget.walls,
|
||||||
others: const ["Others"],
|
others: const ["Others"],
|
||||||
));
|
genCode: '5th'));
|
||||||
widget.NextBtn();
|
widget.NextBtn();
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
|
@ -570,7 +570,8 @@ class _AddExtraItemsEditOffline extends State<AddExtraItemsEditOffline> {
|
||||||
painted: true,
|
painted: true,
|
||||||
secondhand: true,
|
secondhand: true,
|
||||||
paintedUnitval: '1',
|
paintedUnitval: '1',
|
||||||
secondhandUnitval: '1'));
|
secondhandUnitval: '1',
|
||||||
|
genCode: "5th"));
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
primary: Colors.black,
|
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 '../../../../../model/passo/unit_construct.dart';
|
||||||
import '../../../../../utils/alerts.dart';
|
import '../../../../../utils/alerts.dart';
|
||||||
import '../../../../../widgets/passo/custom_button.dart';
|
import '../../../../../widgets/passo/custom_button.dart';
|
||||||
import '../../../../passo/Building/edit_building/AddExtraItems.dart';
|
|
||||||
|
|
||||||
class AdditionalItemEditPageOffline extends StatefulWidget {
|
class AdditionalItemEditPageOffline extends StatefulWidget {
|
||||||
final List<UnitConstruct> unit;
|
final List<UnitConstruct> unit;
|
||||||
|
@ -45,6 +44,14 @@ class _AdditionalItemEditPageOffline
|
||||||
// return total;
|
// return total;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
double _totalMarketValue(items) {
|
||||||
|
double total = 0;
|
||||||
|
items.forEach((row) {
|
||||||
|
total += double.parse(row.adjustedMarketVal);
|
||||||
|
});
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
@ -88,14 +95,14 @@ class _AdditionalItemEditPageOffline
|
||||||
.read<AdditionalItemsOfflineBloc>()
|
.read<AdditionalItemsOfflineBloc>()
|
||||||
.add(ShowAdditionalItems());
|
.add(ShowAdditionalItems());
|
||||||
},
|
},
|
||||||
child: Row(
|
child: const Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
const Text('ADD ITEM'), // <-- Text
|
Text('ADD ITEM'), // <-- Text
|
||||||
const SizedBox(
|
SizedBox(
|
||||||
width: 5,
|
width: 5,
|
||||||
),
|
),
|
||||||
const Icon(
|
Icon(
|
||||||
// <-- Icon
|
// <-- Icon
|
||||||
Icons.add,
|
Icons.add,
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
|
@ -147,11 +154,11 @@ class _AdditionalItemEditPageOffline
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 30,
|
height: 30,
|
||||||
width: 30,
|
width: 30,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: const Icon(
|
||||||
Icons.delete,
|
Icons.delete,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
size: 20.0,
|
size: 20.0,
|
||||||
|
@ -167,18 +174,18 @@ class _AdditionalItemEditPageOffline
|
||||||
"Are you sure you want to delete this item?");
|
"Are you sure you want to delete this item?");
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
const SizedBox(
|
||||||
width: 10,
|
width: 10,
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 30,
|
height: 30,
|
||||||
width: 30,
|
width: 30,
|
||||||
decoration: BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: const Icon(
|
||||||
Icons.edit,
|
Icons.edit,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
size: 20.0,
|
size: 20.0,
|
||||||
|
@ -199,25 +206,25 @@ class _AdditionalItemEditPageOffline
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Padding(
|
Padding(
|
||||||
// padding: const EdgeInsets.only(left: 20.0, right: 20.0),
|
padding: const EdgeInsets.only(left: 20.0, right: 20.0),
|
||||||
// child: Row(
|
child: Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
// children: [
|
children: [
|
||||||
// Text(
|
const Text(
|
||||||
// 'Total',
|
'Total Market Value',
|
||||||
// style:
|
style: TextStyle(
|
||||||
// TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
fontWeight: FontWeight.bold, fontSize: 17),
|
||||||
// ),
|
),
|
||||||
// Text(
|
Text(
|
||||||
// NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
||||||
// .format(_totalMarketValue(state.items)),
|
.format(_totalMarketValue(state.addItem)),
|
||||||
// style:
|
style: TextStyle(
|
||||||
// TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
fontWeight: FontWeight.bold, fontSize: 17),
|
||||||
// )
|
)
|
||||||
// ],
|
],
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(15.0),
|
padding: const EdgeInsets.all(15.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
@ -230,7 +237,6 @@ class _AdditionalItemEditPageOffline
|
||||||
{
|
{
|
||||||
widget.PrevBtn();
|
widget.PrevBtn();
|
||||||
}
|
}
|
||||||
;
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
CustomButton(
|
CustomButton(
|
||||||
|
@ -240,7 +246,6 @@ class _AdditionalItemEditPageOffline
|
||||||
{
|
{
|
||||||
widget.NextBtn();
|
widget.NextBtn();
|
||||||
}
|
}
|
||||||
;
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
@ -265,13 +270,13 @@ class _AdditionalItemEditPageOffline
|
||||||
}
|
}
|
||||||
if (state is ShowAddItemsScreen) {
|
if (state is ShowAddItemsScreen) {
|
||||||
return ConstrainedBox(
|
return ConstrainedBox(
|
||||||
constraints: BoxConstraints(maxHeight: 1000.0),
|
constraints: const BoxConstraints(maxHeight: 1000.0),
|
||||||
child: AlertDialog(
|
child: AlertDialog(
|
||||||
insetPadding: EdgeInsets.symmetric(
|
insetPadding: const EdgeInsets.symmetric(
|
||||||
horizontal: 20.0,
|
horizontal: 20.0,
|
||||||
vertical: 10.0,
|
vertical: 10.0,
|
||||||
),
|
),
|
||||||
title: Text(
|
title: const Text(
|
||||||
'ADD EXTRA ITEMS',
|
'ADD EXTRA ITEMS',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
|
@ -306,14 +311,14 @@ class _AdditionalItemEditPageOffline
|
||||||
.read<AdditionalItemsOfflineBloc>()
|
.read<AdditionalItemsOfflineBloc>()
|
||||||
.add(ShowAdditionalItems());
|
.add(ShowAdditionalItems());
|
||||||
},
|
},
|
||||||
child: Row(
|
child: const Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
const Text('ADD ITEM'), // <-- Text
|
Text('ADD ITEM'), // <-- Text
|
||||||
const SizedBox(
|
SizedBox(
|
||||||
width: 5,
|
width: 5,
|
||||||
),
|
),
|
||||||
const Icon(
|
Icon(
|
||||||
// <-- Icon
|
// <-- Icon
|
||||||
Icons.add,
|
Icons.add,
|
||||||
size: 24.0,
|
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: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/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/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/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/general_description_edit.dart';
|
||||||
import 'package:unit2/screens/offline/passo/building/edit/landref_location_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';
|
import 'package:unit2/screens/offline/passo/building/edit/property_appraisal_edit.dart';
|
||||||
|
@ -23,12 +25,14 @@ class EditBuildingOffline extends StatefulWidget {
|
||||||
final int index;
|
final int index;
|
||||||
final PropertyInfo faas;
|
final PropertyInfo faas;
|
||||||
final String title;
|
final String title;
|
||||||
|
final OfflineProfile offlineProfile;
|
||||||
|
|
||||||
const EditBuildingOffline(
|
const EditBuildingOffline(
|
||||||
{super.key,
|
{super.key,
|
||||||
required this.title,
|
required this.title,
|
||||||
required this.index,
|
required this.index,
|
||||||
required this.faas});
|
required this.faas,
|
||||||
|
required this.offlineProfile});
|
||||||
@override
|
@override
|
||||||
_EditBuildingOffline createState() => _EditBuildingOffline();
|
_EditBuildingOffline createState() => _EditBuildingOffline();
|
||||||
}
|
}
|
||||||
|
@ -37,7 +41,7 @@ class _EditBuildingOffline extends State<EditBuildingOffline> {
|
||||||
// THE FOLLOWING TWO VARIABLES ARE REQUIRED TO CONTROL THE STEPPER.
|
// THE FOLLOWING TWO VARIABLES ARE REQUIRED TO CONTROL THE STEPPER.
|
||||||
int activeStep = 0; // Initial step set to 5.
|
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() {
|
void PrevBtn() {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
@ -61,7 +65,7 @@ class _EditBuildingOffline extends State<EditBuildingOffline> {
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
backgroundColor: primary,
|
backgroundColor: primary,
|
||||||
title: Text('Building FAAS Edit'),
|
title: const Text('Building FAAS Edit'),
|
||||||
),
|
),
|
||||||
body: ProgressHUD(
|
body: ProgressHUD(
|
||||||
padding: const EdgeInsets.all(24),
|
padding: const EdgeInsets.all(24),
|
||||||
|
@ -85,9 +89,9 @@ class _EditBuildingOffline extends State<EditBuildingOffline> {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
NumberStepper(
|
NumberStepper(
|
||||||
numbers: [1, 2, 3, 4, 5, 6, 7],
|
numbers: const [1, 2, 3, 4, 5, 6, 7, 8],
|
||||||
activeStepColor: primary,
|
activeStepColor: primary,
|
||||||
numberStyle: TextStyle(color: Colors.white),
|
numberStyle: const TextStyle(color: Colors.white),
|
||||||
lineColor: primary,
|
lineColor: primary,
|
||||||
// activeStep property set to activeStep variable defined above.
|
// activeStep property set to activeStep variable defined above.
|
||||||
activeStep: activeStep,
|
activeStep: activeStep,
|
||||||
|
@ -140,18 +144,22 @@ class _EditBuildingOffline extends State<EditBuildingOffline> {
|
||||||
return GeneralDescriptionEditOffline(widget.faas.id!, NextBtn, PrevBtn);
|
return GeneralDescriptionEditOffline(widget.faas.id!, NextBtn, PrevBtn);
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
|
return BuildingAndStructureOfflinePage(
|
||||||
|
PrevBtn, NextBtn, widget.offlineProfile);
|
||||||
|
|
||||||
|
case 4:
|
||||||
return StructuralMaterialsPageEditOffline(
|
return StructuralMaterialsPageEditOffline(
|
||||||
widget.faas.id!, NextBtn, PrevBtn);
|
widget.faas.id!, NextBtn, PrevBtn);
|
||||||
|
|
||||||
case 4:
|
case 5:
|
||||||
return AdditionalItemEditPageOffline(
|
return AdditionalItemEditPageOffline(
|
||||||
unit, classes, widget.faas.id!, NextBtn, PrevBtn);
|
unit, classes, widget.faas.id!, NextBtn, PrevBtn);
|
||||||
|
|
||||||
case 5:
|
case 6:
|
||||||
return PropertyAppraisalEditPageOffline(
|
return PropertyAppraisalEditPageOffline(
|
||||||
widget.faas.id!, NextBtn, PrevBtn);
|
widget.faas.id!, NextBtn, PrevBtn);
|
||||||
|
|
||||||
case 6:
|
case 7:
|
||||||
return PropertyAssessmentEditOfflinePage(widget.faas.id!, onSAveAll);
|
return PropertyAssessmentEditOfflinePage(widget.faas.id!, onSAveAll);
|
||||||
|
|
||||||
default:
|
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,
|
'transaction_code': widget.faas.transCode,
|
||||||
'arp_td': widget.faas.tdn,
|
'arp_td': widget.faas.tdn,
|
||||||
'pin': widget.faas.pin,
|
'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,
|
'address': widget.faas.address,
|
||||||
'tel_no': widget.faas.telno,
|
'tel_no': widget.faas.telno,
|
||||||
'tin': widget.faas.tin,
|
'tin': widget.faas.tin,
|
||||||
|
@ -110,7 +113,31 @@ class _PropertyOwnerInfoEditOffline
|
||||||
child: customTextField("Pin", "", 'pin')),
|
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'),
|
customTextField("Address", "", 'address'),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
|
@ -181,12 +208,13 @@ class _PropertyOwnerInfoEditOffline
|
||||||
widget.faas.tdn,
|
widget.faas.tdn,
|
||||||
pin: offlineBldgEditKey.currentState!.value['pin'] ??
|
pin: offlineBldgEditKey.currentState!.value['pin'] ??
|
||||||
widget.faas.pin,
|
widget.faas.pin,
|
||||||
owner: offlineBldgEditKey
|
fname: offlineBldgEditKey
|
||||||
.currentState!.value['owner'] ??
|
.currentState!.value['fname'] ??
|
||||||
widget.faas.owner,
|
widget.faas.fname,
|
||||||
address: offlineBldgEditKey
|
mname: offlineBldgEditKey
|
||||||
.currentState!.value['address'] ??
|
.currentState!.value['mname'] ??
|
||||||
widget.faas.address,
|
widget.faas.mname,
|
||||||
|
address: offlineBldgEditKey.currentState!.value['address'] ?? widget.faas.address,
|
||||||
telno: offlineBldgEditKey.currentState!.value['tel_no'] ?? widget.faas.telno,
|
telno: offlineBldgEditKey.currentState!.value['tel_no'] ?? widget.faas.telno,
|
||||||
tin: offlineBldgEditKey.currentState!.value['tin'] ?? widget.faas.tin,
|
tin: offlineBldgEditKey.currentState!.value['tin'] ?? widget.faas.tin,
|
||||||
adminUser: offlineBldgEditKey.currentState!.value['benificiary'] ?? widget.faas.adminUser,
|
adminUser: offlineBldgEditKey.currentState!.value['benificiary'] ?? widget.faas.adminUser,
|
||||||
|
|
|
@ -47,13 +47,13 @@ class _StructuralMaterialsPageEditOffline
|
||||||
StructuralMaterialOfflineState>(listener: (context, state) {
|
StructuralMaterialOfflineState>(listener: (context, state) {
|
||||||
if (state is SpecificStructuralMaterialLoaded) {
|
if (state is SpecificStructuralMaterialLoaded) {
|
||||||
setState(() {
|
setState(() {
|
||||||
foundation = state.materials.foundation?.split(', ') ?? [];
|
// foundation = state.materials.foundation?.split(', ') ?? [];
|
||||||
column = state.materials.columns?.split(', ') ?? [];
|
// column = state.materials.columns?.split(', ') ?? [];
|
||||||
beam = state.materials.beams?.split(', ') ?? [];
|
// beam = state.materials.beams?.split(', ') ?? [];
|
||||||
truss_framing = state.materials.trussFraming?.split(', ') ?? [];
|
// truss_framing = state.materials.trussFraming?.split(', ') ?? [];
|
||||||
roof = state.materials.roof?.split(', ') ?? [];
|
// roof = state.materials.roof?.split(', ') ?? [];
|
||||||
flooring = state.materials.flooring?.split(', ') ?? [];
|
// flooring = state.materials.flooring?.split(', ') ?? [];
|
||||||
walls = state.materials.walls?.split(', ') ?? [];
|
// walls = state.materials.walls?.split(', ') ?? [];
|
||||||
// Update other local state variables here if needed
|
// Update other local state variables here if needed
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ class _StructuralMaterialsPageEditOffline
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'STRUCTURAL MATERIALS',
|
'STRUCTURAL MATERIALS',
|
||||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
|
@ -114,7 +114,8 @@ class _StructuralMaterialsPageEditOffline
|
||||||
},
|
},
|
||||||
options: const ['Reinforced Concrete', 'Plain Concrete'],
|
options: const ['Reinforced Concrete', 'Plain Concrete'],
|
||||||
selectedValues: foundation,
|
selectedValues: foundation,
|
||||||
whenEmpty: 'Select Foundations',
|
whenEmpty:
|
||||||
|
state.materials.foundation ?? 'Select Foundations',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -155,7 +156,7 @@ class _StructuralMaterialsPageEditOffline
|
||||||
},
|
},
|
||||||
options: const ['Steel', 'Reinforced Concrete', 'Wood'],
|
options: const ['Steel', 'Reinforced Concrete', 'Wood'],
|
||||||
selectedValues: column,
|
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'],
|
options: const ['Steel', 'Reinforced Concrete', 'Wood'],
|
||||||
selectedValues: beam,
|
selectedValues: beam,
|
||||||
whenEmpty: 'Select Beam/s',
|
whenEmpty: state.materials.beams ?? 'Select Beam/s',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -237,7 +238,8 @@ class _StructuralMaterialsPageEditOffline
|
||||||
},
|
},
|
||||||
options: const ['Steel', 'Wood'],
|
options: const ['Steel', 'Wood'],
|
||||||
selectedValues: truss_framing,
|
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'
|
'Nipa/Anahaw/Cogon'
|
||||||
],
|
],
|
||||||
selectedValues: roof,
|
selectedValues: roof,
|
||||||
whenEmpty: 'Select Roof/s',
|
whenEmpty: state.materials.roof ?? 'Select Roof/s',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -334,7 +336,8 @@ class _StructuralMaterialsPageEditOffline
|
||||||
'Tiles'
|
'Tiles'
|
||||||
],
|
],
|
||||||
selectedValues: flooring,
|
selectedValues: flooring,
|
||||||
whenEmpty: 'Select Flooring/s',
|
whenEmpty:
|
||||||
|
state.materials.flooring ?? 'Select Flooring/s',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -384,7 +387,8 @@ class _StructuralMaterialsPageEditOffline
|
||||||
'Bamboo'
|
'Bamboo'
|
||||||
],
|
],
|
||||||
selectedValues: walls,
|
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/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||||
import 'package:flutter_spinkit/flutter_spinkit.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/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/class_components_admin.dart/class_components_admin_bloc.dart';
|
||||||
import 'package:unit2/bloc/offline/offline_passo/admin/memoranda/memoranda_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/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/offline/offline_profile.dart';
|
||||||
import 'package:unit2/model/passo/additional_items.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_appraisal.dart';
|
||||||
|
import 'package:unit2/model/passo/property_assessment.dart';
|
||||||
import 'package:unit2/model/passo/property_info.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/add/add_building.dart';
|
||||||
import 'package:unit2/screens/offline/passo/building/edit/edit_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/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/other_improvements/other_improvements_bloc.dart';
|
||||||
import '../../../bloc/offline/offline_passo/land/value_adjustment/value_adjustment_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 '../../../utils/alerts.dart';
|
||||||
|
import 'package:http/http.dart';
|
||||||
|
import 'package:date_format/date_format.dart';
|
||||||
|
|
||||||
|
import '../../../utils/urls.dart';
|
||||||
|
|
||||||
class BuildingHomeOffline extends StatelessWidget {
|
class BuildingHomeOffline extends StatelessWidget {
|
||||||
final OfflineProfile offlineProfile;
|
final OfflineProfile offlineProfile;
|
||||||
|
@ -63,6 +79,267 @@ class BuildingHomeOffline extends StatelessWidget {
|
||||||
myBloc.add(LoadLandPropertyOwner());
|
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(
|
return Scaffold(
|
||||||
body: ProgressHUD(
|
body: ProgressHUD(
|
||||||
backgroundColor: Colors.black87,
|
backgroundColor: Colors.black87,
|
||||||
|
@ -85,7 +362,8 @@ class BuildingHomeOffline extends StatelessWidget {
|
||||||
context,
|
context,
|
||||||
index,
|
index,
|
||||||
deleteItem,
|
deleteItem,
|
||||||
state.propertyInfos.length);
|
state.propertyInfos.length,
|
||||||
|
offlineProfile);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -260,15 +538,17 @@ class BuildingHomeOffline extends StatelessWidget {
|
||||||
color: primary,
|
color: primary,
|
||||||
),
|
),
|
||||||
label: 'Upload/Sync',
|
label: 'Upload/Sync',
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
uploadBldg();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Card _listCard(
|
Card _listCard(PropertyInfo property_info, context, index, deleteItem,
|
||||||
PropertyInfo property_info, context, index, deleteItem, bldgLength) {
|
bldgLength, offlineProfile) {
|
||||||
return Card(
|
return Card(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
@ -338,12 +618,17 @@ Card _listCard(
|
||||||
..add(LoadAdditionalItemsEdit(
|
..add(LoadAdditionalItemsEdit(
|
||||||
items: const <AdditionalItems>[],
|
items: const <AdditionalItems>[],
|
||||||
id: property_info.id!))),
|
id: property_info.id!))),
|
||||||
|
BlocProvider(
|
||||||
|
create: (context) => BuildingAndStructureBloc()
|
||||||
|
..add(LoadBuildingAndStructureEdit(
|
||||||
|
bldgAndStructure: const <BldgAndStructure>[],
|
||||||
|
id: property_info.id!))),
|
||||||
],
|
],
|
||||||
child: EditBuildingOffline(
|
child: EditBuildingOffline(
|
||||||
index: index,
|
index: index,
|
||||||
faas: property_info,
|
faas: property_info,
|
||||||
title: 'Bldg & Structure Edit',
|
title: 'Bldg & Structure Edit',
|
||||||
),
|
offlineProfile: offlineProfile),
|
||||||
);
|
);
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
@ -373,7 +658,7 @@ Card _listCard(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'${property_info.owner}',
|
'${property_info.fname} ${property_info.mname} ${property_info.lname}',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.bold,
|
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/bloc/passo/land/land_appraisal/land_appraisal_bloc.dart';
|
||||||
import 'package:unit2/model/passo/land_appr.dart';
|
import 'package:unit2/model/passo/land_appr.dart';
|
||||||
import 'package:unit2/screens/offline/passo/land/add/AddLandAppraisal.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/alerts.dart';
|
||||||
import 'package:unit2/utils/text_container.dart';
|
import 'package:unit2/utils/text_container.dart';
|
||||||
import 'package:unit2/widgets/error_state.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:flutter_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:unit2/screens/offline/passo/land/add/AddOtherImprovementModal.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/utils/alerts.dart';
|
||||||
import 'package:unit2/widgets/passo/custom_button.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