Added edit feature on land faas
parent
42bd0312a4
commit
5e408f5085
|
@ -27,6 +27,8 @@ class AdditionalItemBloc
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
on<AddAdditionalItems>((event, emit) async {
|
on<AddAdditionalItems>((event, emit) async {
|
||||||
|
emit(AdditionalItemsLoading());
|
||||||
|
try {
|
||||||
http.Response response =
|
http.Response response =
|
||||||
(await AdditionalItemsServices.instance.add(event.items))!;
|
(await AdditionalItemsServices.instance.add(event.items))!;
|
||||||
print(response.body);
|
print(response.body);
|
||||||
|
@ -40,6 +42,9 @@ class AdditionalItemBloc
|
||||||
|
|
||||||
emit(AdditionalItemsLoaded(globalAdditionalItems));
|
emit(AdditionalItemsLoaded(globalAdditionalItems));
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
emit(AdditionalItemsErrorState(e.toString()));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
on<DeleteAdditionalItems>((event, emit) async {
|
on<DeleteAdditionalItems>((event, emit) async {
|
||||||
print(event.id);
|
print(event.id);
|
||||||
|
|
|
@ -26,19 +26,16 @@ class PropertyAppraisalBloc
|
||||||
});
|
});
|
||||||
on<AddPropertyAppraisal>((event, emit) async {
|
on<AddPropertyAppraisal>((event, emit) async {
|
||||||
final tempID = await SharedPreferences.getInstance();
|
final tempID = await SharedPreferences.getInstance();
|
||||||
|
emit(PropertyAppraisalLoading());
|
||||||
|
try {
|
||||||
http.Response response = (await PropertyAppraisalServices.instance
|
http.Response response = (await PropertyAppraisalServices.instance
|
||||||
.update(event.appraisal, tempID.getInt('tempid')! - 1))!;
|
.update(event.appraisal, tempID.getInt('tempid')! - 1))!;
|
||||||
|
|
||||||
if (response.statusCode == 201) {
|
if (response.statusCode == 200) {
|
||||||
var jsonResponse = jsonDecode(response.body);
|
emit(ShowPropertyAppraisalSuccessAlertState());
|
||||||
PropertyAppraisal newAppraisal =
|
}
|
||||||
PropertyAppraisal.fromJson(jsonResponse['data']);
|
} catch (e) {
|
||||||
print("PA");
|
emit(ShowPropertyAppraisalErrorAlertState());
|
||||||
print(newAppraisal);
|
|
||||||
print(response.statusCode);
|
|
||||||
|
|
||||||
emit(PropertyAppraisalLoaded(newAppraisal));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,3 +26,7 @@ class PropertyAppraisalErrorState extends PropertyAppraisalState {
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [error];
|
List<Object> get props => [error];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ShowPropertyAppraisalErrorAlertState extends PropertyAppraisalState {}
|
||||||
|
|
||||||
|
class ShowPropertyAppraisalSuccessAlertState extends PropertyAppraisalState {}
|
||||||
|
|
|
@ -48,6 +48,7 @@ class PropertyInfoBloc extends Bloc<PropertyInfoEvent, PropertyInfoState> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
on<UpdatPropertyInfo>(((event, emit) async {
|
on<UpdatPropertyInfo>(((event, emit) async {
|
||||||
|
emit(PropertyInfoLoading());
|
||||||
final state = this.state;
|
final state = this.state;
|
||||||
try {
|
try {
|
||||||
http.Response response = (await PropertyInfoService.instance
|
http.Response response = (await PropertyInfoService.instance
|
||||||
|
@ -60,6 +61,7 @@ class PropertyInfoBloc extends Bloc<PropertyInfoEvent, PropertyInfoState> {
|
||||||
}));
|
}));
|
||||||
on<UpdateBldgLoc>(((event, emit) async {
|
on<UpdateBldgLoc>(((event, emit) async {
|
||||||
final state = this.state;
|
final state = this.state;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
http.Response response = (await PropertyInfoService.instance
|
http.Response response = (await PropertyInfoService.instance
|
||||||
.updateBldg(event.bldg_loc, event.bldg_loc.id))!;
|
.updateBldg(event.bldg_loc, event.bldg_loc.id))!;
|
||||||
|
@ -77,6 +79,7 @@ class PropertyInfoBloc extends Bloc<PropertyInfoEvent, PropertyInfoState> {
|
||||||
on<UpdateLandRef>(
|
on<UpdateLandRef>(
|
||||||
(event, emit) async {
|
(event, emit) async {
|
||||||
final state = this.state;
|
final state = this.state;
|
||||||
|
emit(PropertyInfoLoading());
|
||||||
try {
|
try {
|
||||||
http.Response response = (await PropertyInfoService.instance
|
http.Response response = (await PropertyInfoService.instance
|
||||||
.updateLandRef(event.land_ref, event.land_ref.id))!;
|
.updateLandRef(event.land_ref, event.land_ref.id))!;
|
||||||
|
@ -95,6 +98,7 @@ class PropertyInfoBloc extends Bloc<PropertyInfoEvent, PropertyInfoState> {
|
||||||
|
|
||||||
on<UpdateGeneralDesc>((event, emit) async {
|
on<UpdateGeneralDesc>((event, emit) async {
|
||||||
final state = this.state;
|
final state = this.state;
|
||||||
|
emit(PropertyInfoLoading());
|
||||||
try {
|
try {
|
||||||
http.Response response = (await PropertyInfoService.instance
|
http.Response response = (await PropertyInfoService.instance
|
||||||
.updateGenDesc(event.gen_desc, event.gen_desc.id))!;
|
.updateGenDesc(event.gen_desc, event.gen_desc.id))!;
|
||||||
|
@ -112,6 +116,7 @@ class PropertyInfoBloc extends Bloc<PropertyInfoEvent, PropertyInfoState> {
|
||||||
|
|
||||||
on<UpdateStrucMaterials>((event, emit) async {
|
on<UpdateStrucMaterials>((event, emit) async {
|
||||||
final state = this.state;
|
final state = this.state;
|
||||||
|
emit(PropertyInfoLoading());
|
||||||
try {
|
try {
|
||||||
final tempID = await SharedPreferences.getInstance();
|
final tempID = await SharedPreferences.getInstance();
|
||||||
print(tempID.getInt('tempid')! - 1);
|
print(tempID.getInt('tempid')! - 1);
|
||||||
|
@ -131,6 +136,7 @@ class PropertyInfoBloc extends Bloc<PropertyInfoEvent, PropertyInfoState> {
|
||||||
|
|
||||||
on<DeleteBuildingFaas>((event, emit) async {
|
on<DeleteBuildingFaas>((event, emit) async {
|
||||||
print(event.id);
|
print(event.id);
|
||||||
|
emit(PropertyInfoLoading());
|
||||||
http.Response response =
|
http.Response response =
|
||||||
(await PropertyInfoService.instance.remove(event.id));
|
(await PropertyInfoService.instance.remove(event.id));
|
||||||
print(response.statusCode);
|
print(response.statusCode);
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
import 'package:bloc/bloc.dart';
|
||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
import 'package:unit2/model/passo/land_property_boundaries.dart';
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:unit2/sevices/passo/land/land_boundaries.dart';
|
||||||
|
part 'land_boundaries_edit_event.dart';
|
||||||
|
part 'land_boundaries_edit_state.dart';
|
||||||
|
|
||||||
|
class LandBoundariesEditBloc
|
||||||
|
extends Bloc<LandBoundariesEditEvent, LandBoundariesEditState> {
|
||||||
|
LandBoundariesEditBloc() : super(LandBoundariesEditInitial()) {
|
||||||
|
on<LoadLandBoundariesEdit>((event, emit) async {
|
||||||
|
emit(LandBoundariesEditLoading());
|
||||||
|
try {
|
||||||
|
final tempID = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
|
final assessments =
|
||||||
|
await LandBoundariesService.instance.fetchEdit(event.id);
|
||||||
|
|
||||||
|
emit(LandBoundariesEditLoaded(assessments));
|
||||||
|
} catch (e) {
|
||||||
|
emit(LandBoundariesEditErrorState(e.toString()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// on<AddLandLocationEdit>((event, emit) async {
|
||||||
|
// http.Response response = (await LandLocationService.instance
|
||||||
|
// .addEdit(event.land_loc_edit))!;
|
||||||
|
// print('Assessment');
|
||||||
|
// print(response.statusCode);
|
||||||
|
// print(response.body);
|
||||||
|
// if (response.statusCode == 201) {
|
||||||
|
// var jsonResponse = jsonDecode(response.body);
|
||||||
|
// LandPropertyLoc newAssessment =
|
||||||
|
// LandPropertyLoc.fromJson(jsonResponse['data']);
|
||||||
|
|
||||||
|
// globalLandLocationEdit = newAssessment;
|
||||||
|
|
||||||
|
// emit(LandLocationEditLoaded(globalLandBoundariesEdit));
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
on<UpdateLandBoundariesEdit>((event, emit) async {
|
||||||
|
http.Response response = (await LandBoundariesService.instance
|
||||||
|
.updateEdit(event.land_boundaries_edit, event.id))!;
|
||||||
|
print('landloc edit');
|
||||||
|
print(response.statusCode);
|
||||||
|
print(response.body);
|
||||||
|
// if (response.statusCode == 201) {
|
||||||
|
// final faas = await PropertyInfoRepository.getUsers();
|
||||||
|
// emit(FaasLoaded(faas));
|
||||||
|
// }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
part of 'land_boundaries_edit_bloc.dart';
|
||||||
|
|
||||||
|
class LandBoundariesEditEvent extends Equatable {
|
||||||
|
const LandBoundariesEditEvent();
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
class LoadLandBoundariesEdit extends LandBoundariesEditEvent {
|
||||||
|
final LandPropertyBoundaries land_boundaries_edit;
|
||||||
|
final int? id;
|
||||||
|
|
||||||
|
const LoadLandBoundariesEdit(
|
||||||
|
{required this.land_boundaries_edit, required this.id});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [land_boundaries_edit];
|
||||||
|
}
|
||||||
|
|
||||||
|
class AddLandBoundariesEdit extends LandBoundariesEditEvent {
|
||||||
|
final LandPropertyBoundaries land_boundaries_edit;
|
||||||
|
|
||||||
|
const AddLandBoundariesEdit({required this.land_boundaries_edit});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [land_boundaries_edit];
|
||||||
|
}
|
||||||
|
|
||||||
|
class UpdateLandBoundariesEdit extends LandBoundariesEditEvent {
|
||||||
|
// ignore: non_constant_identifier_names
|
||||||
|
final LandPropertyBoundaries land_boundaries_edit;
|
||||||
|
final int id;
|
||||||
|
|
||||||
|
// ignore: non_constant_identifier_names
|
||||||
|
const UpdateLandBoundariesEdit(
|
||||||
|
{required this.land_boundaries_edit, required this.id});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [land_boundaries_edit];
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
part of 'land_boundaries_edit_bloc.dart';
|
||||||
|
|
||||||
|
class LandBoundariesEditState extends Equatable {
|
||||||
|
const LandBoundariesEditState();
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
class LandBoundariesEditInitial extends LandBoundariesEditState {}
|
||||||
|
|
||||||
|
class LandBoundariesEditLoading extends LandBoundariesEditState {}
|
||||||
|
|
||||||
|
class LandBoundariesEditLoaded extends LandBoundariesEditState {
|
||||||
|
LandBoundariesEditLoaded(this.land_boundaries_edit);
|
||||||
|
final LandPropertyBoundaries land_boundaries_edit;
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [land_boundaries_edit];
|
||||||
|
}
|
||||||
|
|
||||||
|
class LandBoundariesEditErrorState extends LandBoundariesEditState {
|
||||||
|
LandBoundariesEditErrorState(this.error);
|
||||||
|
final String error;
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [error];
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:bloc/bloc.dart';
|
||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
import 'package:unit2/model/passo/land_property_loc.dart';
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:unit2/sevices/passo/land/land_location.dart';
|
||||||
|
part 'land_location_edit_event.dart';
|
||||||
|
part 'land_location_edit_state.dart';
|
||||||
|
|
||||||
|
class LandLocationEditBloc
|
||||||
|
extends Bloc<LandLocationEditEvent, LandLocationEditState> {
|
||||||
|
LandPropertyLoc globalLandLocationEdit;
|
||||||
|
LandLocationEditBloc()
|
||||||
|
: globalLandLocationEdit = LandPropertyLoc(),
|
||||||
|
super(LandLocationEditInitial()) {
|
||||||
|
on<LoadLandLocationEdit>((event, emit) async {
|
||||||
|
emit(LandLocationEditLoading());
|
||||||
|
try {
|
||||||
|
final tempID = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
|
final assessments =
|
||||||
|
await LandLocationService.instance.fetchEdit(event.id);
|
||||||
|
|
||||||
|
emit(LandLocationEditLoaded(assessments));
|
||||||
|
} catch (e) {
|
||||||
|
emit(LandLocationEditErrorState(e.toString()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// on<AddLandLocationEdit>((event, emit) async {
|
||||||
|
// http.Response response = (await LandLocationService.instance
|
||||||
|
// .addEdit(event.land_loc_edit))!;
|
||||||
|
// print('Assessment');
|
||||||
|
// print(response.statusCode);
|
||||||
|
// print(response.body);
|
||||||
|
// if (response.statusCode == 201) {
|
||||||
|
// var jsonResponse = jsonDecode(response.body);
|
||||||
|
// LandPropertyLoc newAssessment =
|
||||||
|
// LandPropertyLoc.fromJson(jsonResponse['data']);
|
||||||
|
|
||||||
|
// globalLandLocationEdit = newAssessment;
|
||||||
|
|
||||||
|
// emit(LandLocationEditLoaded(globalLandLocationEdit));
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
on<UpdateLandLocationEdit>((event, emit) async {
|
||||||
|
http.Response response = (await LandLocationService.instance
|
||||||
|
.updateEdit(event.land_loc_edit, event.id))!;
|
||||||
|
print('landloc edit');
|
||||||
|
print(response.statusCode);
|
||||||
|
print(response.body);
|
||||||
|
// if (response.statusCode == 201) {
|
||||||
|
// final faas = await PropertyInfoRepository.getUsers();
|
||||||
|
// emit(FaasLoaded(faas));
|
||||||
|
// }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
part of 'land_location_edit_bloc.dart';
|
||||||
|
|
||||||
|
class LandLocationEditEvent extends Equatable {
|
||||||
|
const LandLocationEditEvent();
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
class LoadLandLocationEdit extends LandLocationEditEvent {
|
||||||
|
final LandPropertyLoc land_loc_edit;
|
||||||
|
final int? id;
|
||||||
|
|
||||||
|
const LoadLandLocationEdit({required this.land_loc_edit, required this.id});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [land_loc_edit];
|
||||||
|
}
|
||||||
|
|
||||||
|
class AddLandLocationEdit extends LandLocationEditEvent {
|
||||||
|
final LandPropertyLoc land_loc_edit;
|
||||||
|
|
||||||
|
const AddLandLocationEdit({required this.land_loc_edit});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [land_loc_edit];
|
||||||
|
}
|
||||||
|
|
||||||
|
class UpdateLandLocationEdit extends LandLocationEditEvent {
|
||||||
|
// ignore: non_constant_identifier_names
|
||||||
|
final LandPropertyLoc land_loc_edit;
|
||||||
|
final int id;
|
||||||
|
|
||||||
|
// ignore: non_constant_identifier_names
|
||||||
|
const UpdateLandLocationEdit({required this.land_loc_edit, required this.id});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [land_loc_edit];
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
part of 'land_location_edit_bloc.dart';
|
||||||
|
|
||||||
|
class LandLocationEditState extends Equatable {
|
||||||
|
const LandLocationEditState();
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [];
|
||||||
|
}
|
||||||
|
|
||||||
|
class LandLocationEditInitial extends LandLocationEditState {}
|
||||||
|
|
||||||
|
class LandLocationEditLoading extends LandLocationEditState {}
|
||||||
|
|
||||||
|
class LandLocationEditLoaded extends LandLocationEditState {
|
||||||
|
LandLocationEditLoaded(this.land_loc_edit);
|
||||||
|
final LandPropertyLoc land_loc_edit;
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [land_loc_edit];
|
||||||
|
}
|
||||||
|
|
||||||
|
class LandLocationEditErrorState extends LandLocationEditState {
|
||||||
|
LandLocationEditErrorState(this.error);
|
||||||
|
final String error;
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [error];
|
||||||
|
}
|
|
@ -10,6 +10,7 @@ import 'package:unit2/sevices/passo/land/land_boundaries.dart';
|
||||||
import 'package:unit2/sevices/passo/land/land_location.dart';
|
import 'package:unit2/sevices/passo/land/land_location.dart';
|
||||||
import 'package:unit2/sevices/passo/land/land_property_owner.dart';
|
import 'package:unit2/sevices/passo/land/land_property_owner.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:unit2/utils/text_container.dart';
|
||||||
part 'land_property_owner_info_event.dart';
|
part 'land_property_owner_info_event.dart';
|
||||||
part 'land_property_owner_info_state.dart';
|
part 'land_property_owner_info_state.dart';
|
||||||
|
|
||||||
|
@ -25,33 +26,39 @@ class LandPropertyOwnerInfoBloc
|
||||||
emit(LandErrorState(e.toString()));
|
emit(LandErrorState(e.toString()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
on<AddPropertyOwnerLand>((event, emit) async {
|
on<AddPropertyOwnerLand>((event, emit) async {
|
||||||
http.Response response = (await LandServices.instance.add(event.land))!;
|
http.Response response = (await LandServices.instance.add(event.land))!;
|
||||||
|
|
||||||
if (response.statusCode == 201) {
|
if (response.statusCode == 201) {
|
||||||
var jsonResponse = jsonDecode(response.body);
|
var jsonResponse = jsonDecode(response.body);
|
||||||
var details = jsonResponse['data']['details'];
|
var details = jsonResponse['data'];
|
||||||
|
print(jsonResponse);
|
||||||
|
|
||||||
if (details != null) {
|
|
||||||
var id = details['id'];
|
var id = details['id'];
|
||||||
final tempID = await SharedPreferences.getInstance();
|
final tempID = await SharedPreferences.getInstance();
|
||||||
print(id);
|
print(id);
|
||||||
await tempID.setInt('landid', id + 1);
|
await tempID.setInt('landid', id + 1);
|
||||||
final faas = await LandServices.instance.fetch();
|
final faas = await LandServices.instance.fetch();
|
||||||
emit(LandLoaded(faas));
|
emit(LandLoaded(faas));
|
||||||
} else {
|
|
||||||
print("No 'details' object found in the response.");
|
|
||||||
// Handle the case when 'details' is missing
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
on<UpdateLandPropertyOwner>((event, emit) async {
|
||||||
|
final state = this.state;
|
||||||
|
http.Response response = (await LandServices.instance
|
||||||
|
.update(event.land_edit, event.land_edit.id))!;
|
||||||
|
print('Land LOc');
|
||||||
|
print(response.body);
|
||||||
|
});
|
||||||
|
|
||||||
on<UpdateLandLoc>((event, emit) async {
|
on<UpdateLandLoc>((event, emit) async {
|
||||||
final state = this.state;
|
final state = this.state;
|
||||||
http.Response response = (await LandLocationService.instance
|
http.Response response = (await LandLocationService.instance
|
||||||
.update(event.land_loc, event.land_loc.id))!;
|
.update(event.land_loc, event.land_loc.id))!;
|
||||||
|
print(event.land_loc.id!);
|
||||||
print('Land LOc');
|
print('Land LOc');
|
||||||
print(response.body);
|
print(response.statusCode);
|
||||||
});
|
});
|
||||||
|
|
||||||
on<UpdateLandBoundaries>((event, emit) async {
|
on<UpdateLandBoundaries>((event, emit) async {
|
||||||
|
|
|
@ -25,6 +25,18 @@ class AddPropertyOwnerLand extends LandPropertyOwnerInfoEvent {
|
||||||
List<Object> get props => [land];
|
List<Object> get props => [land];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class UpdateLandPropertyOwner extends LandPropertyOwnerInfoEvent {
|
||||||
|
// ignore: non_constant_identifier_names
|
||||||
|
final LandPropertyOwner land_edit;
|
||||||
|
final int id;
|
||||||
|
|
||||||
|
// ignore: non_constant_identifier_names
|
||||||
|
const UpdateLandPropertyOwner({required this.land_edit, required this.id});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object> get props => [land_edit];
|
||||||
|
}
|
||||||
|
|
||||||
class UpdateLandLoc extends LandPropertyOwnerInfoEvent {
|
class UpdateLandLoc extends LandPropertyOwnerInfoEvent {
|
||||||
// ignore: non_constant_identifier_names
|
// ignore: non_constant_identifier_names
|
||||||
final LandPropertyLoc land_loc;
|
final LandPropertyLoc land_loc;
|
||||||
|
|
|
@ -17,14 +17,6 @@ class LandLoaded extends LandPropertyOwnerInfoState {
|
||||||
List<Object> get props => [land];
|
List<Object> get props => [land];
|
||||||
}
|
}
|
||||||
|
|
||||||
// class PropertyAppraisalLoaded extends AssessorsState {
|
|
||||||
// PropertyAppraisalLoaded(this.appraisal);
|
|
||||||
// final List<PropertyAppraisal> appraisal;
|
|
||||||
|
|
||||||
// @override
|
|
||||||
// List<Object> get props => [appraisal];
|
|
||||||
// }
|
|
||||||
|
|
||||||
class LandErrorState extends LandPropertyOwnerInfoState {
|
class LandErrorState extends LandPropertyOwnerInfoState {
|
||||||
const LandErrorState(this.error);
|
const LandErrorState(this.error);
|
||||||
final String error;
|
final String error;
|
||||||
|
|
|
@ -121,20 +121,24 @@ class _AddBuilding extends State<AddBuilding> {
|
||||||
final progress = ProgressHUD.of(context);
|
final progress = ProgressHUD.of(context);
|
||||||
progress?.dismiss();
|
progress?.dismiss();
|
||||||
}
|
}
|
||||||
if (state is ShowBldgLocErrorAlertState ||
|
if (state is ShowGenDescErrorAlertState ||
|
||||||
state is ShowGenDescErrorAlertState ||
|
|
||||||
state is ShowLandRefErrorAlertState ||
|
state is ShowLandRefErrorAlertState ||
|
||||||
state is ShowStrucMatErrorAlertState) {
|
state is ShowStrucMatErrorAlertState) {
|
||||||
|
final progress = ProgressHUD.of(context);
|
||||||
|
progress?.dismiss();
|
||||||
Fluttertoast.showToast(
|
Fluttertoast.showToast(
|
||||||
msg: "Slow internet connection, please try again!");
|
msg: "Slow internet connection, please try again!");
|
||||||
}
|
}
|
||||||
if (state is ShowLandRefSuccessAlertState ||
|
if (state is ShowLandRefSuccessAlertState ||
|
||||||
state is ShowGenDescSuccessAlertState ||
|
state is ShowGenDescSuccessAlertState ||
|
||||||
state is ShowStrucMatSuccessAlertState) {
|
state is ShowStrucMatSuccessAlertState) {
|
||||||
|
final progress = ProgressHUD.of(context);
|
||||||
|
progress?.dismiss();
|
||||||
NextBtn();
|
NextBtn();
|
||||||
}
|
}
|
||||||
}, builder: (context, state) {
|
}, builder: (context, state) {
|
||||||
if (state is PropertyInfoLoaded ||
|
if (state is PropertyInfoLoading ||
|
||||||
|
state is PropertyInfoLoaded ||
|
||||||
state is PropertyInfoErrorState ||
|
state is PropertyInfoErrorState ||
|
||||||
state is ShowBldgLocErrorAlertState ||
|
state is ShowBldgLocErrorAlertState ||
|
||||||
state is ShowGenDescErrorAlertState ||
|
state is ShowGenDescErrorAlertState ||
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
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_form_builder/flutter_form_builder.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:form_builder_validators/form_builder_validators.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:searchfield/searchfield.dart';
|
import 'package:searchfield/searchfield.dart';
|
||||||
|
@ -500,6 +501,7 @@ class _AddExtraItems extends State<AddExtraItems> {
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
try {
|
||||||
final tempID =
|
final tempID =
|
||||||
await SharedPreferences.getInstance();
|
await SharedPreferences.getInstance();
|
||||||
var itemss = AdditionalItems(
|
var itemss = AdditionalItems(
|
||||||
|
@ -509,12 +511,13 @@ class _AddExtraItems extends State<AddExtraItems> {
|
||||||
classId: _classId,
|
classId: _classId,
|
||||||
className: _className,
|
className: _className,
|
||||||
structType: _structureType,
|
structType: _structureType,
|
||||||
unitValue:
|
unitValue: _withoutBUCC == true
|
||||||
_withoutBUCC == true ? 0 : _unitValue,
|
? 0
|
||||||
|
: _unitValue,
|
||||||
baseUnitValue: _unitBase,
|
baseUnitValue: _unitBase,
|
||||||
area: _areaValue,
|
area: _areaValue,
|
||||||
marketValue:
|
marketValue: (_unitValue * _unitBase) *
|
||||||
(_unitValue * _unitBase) * _areaValue,
|
_areaValue,
|
||||||
depreciationRate: _depValue,
|
depreciationRate: _depValue,
|
||||||
adjustedMarketVal: _totalMarketValue(
|
adjustedMarketVal: _totalMarketValue(
|
||||||
_unitValue,
|
_unitValue,
|
||||||
|
@ -542,6 +545,12 @@ class _AddExtraItems extends State<AddExtraItems> {
|
||||||
context
|
context
|
||||||
.read<AdditionalItemBloc>()
|
.read<AdditionalItemBloc>()
|
||||||
.add(AddAdditionalItems(items: itemss));
|
.add(AddAdditionalItems(items: itemss));
|
||||||
|
} catch (e) {
|
||||||
|
Fluttertoast.showToast(
|
||||||
|
msg:
|
||||||
|
"Slow internet connection, please try again!",
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
primary: Colors.black,
|
primary: Colors.black,
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
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_spinkit/flutter_spinkit.dart';
|
||||||
import 'package:intl/intl.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_item/additional_item_bloc.dart';
|
||||||
import 'package:unit2/model/passo/class_components.dart';
|
import 'package:unit2/model/passo/class_components.dart';
|
||||||
import 'package:unit2/model/passo/unit_construct.dart';
|
import 'package:unit2/model/passo/unit_construct.dart';
|
||||||
import 'package:unit2/screens/passo/Building/add_building_components/AddExtraItems.dart';
|
import 'package:unit2/screens/passo/Building/add_building_components/AddExtraItems.dart';
|
||||||
import 'package:unit2/utils/alerts.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_button.dart';
|
||||||
|
|
||||||
class AdditionalItemPage extends StatefulWidget {
|
class AdditionalItemPage extends StatefulWidget {
|
||||||
|
@ -37,9 +41,25 @@ class _AdditionalItemPage extends State<AdditionalItemPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return BlocConsumer<AdditionalItemBloc, AdditionalItemState>(
|
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) {
|
listener: (context, state) {
|
||||||
// TODO: implement listener
|
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) {
|
builder: (context, state) {
|
||||||
final state = context.watch<AdditionalItemBloc>().state;
|
final state = context.watch<AdditionalItemBloc>().state;
|
||||||
|
@ -57,7 +77,8 @@ class _AdditionalItemPage extends State<AdditionalItemPage> {
|
||||||
left: 0, top: 20, right: 0, bottom: 10),
|
left: 0, top: 20, right: 0, bottom: 10),
|
||||||
child: const Text('ADDITIONAL ITEMS',
|
child: const Text('ADDITIONAL ITEMS',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold, fontSize: 18),
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 18),
|
||||||
textAlign: TextAlign.left),
|
textAlign: TextAlign.left),
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
|
@ -175,14 +196,14 @@ class _AdditionalItemPage extends State<AdditionalItemPage> {
|
||||||
children: [
|
children: [
|
||||||
const Text(
|
const Text(
|
||||||
'Total',
|
'Total',
|
||||||
style:
|
style: TextStyle(
|
||||||
TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
fontWeight: FontWeight.bold, fontSize: 15),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
NumberFormat.currency(locale: 'en-PH', symbol: "₱")
|
||||||
.format(_totalMarketValue(state.items)),
|
.format(_totalMarketValue(state.items)),
|
||||||
style:
|
style: TextStyle(
|
||||||
TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
fontWeight: FontWeight.bold, fontSize: 15),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -247,50 +268,25 @@ class _AdditionalItemPage extends State<AdditionalItemPage> {
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: AddExtraItems(widget.unit, widget.options))
|
Expanded(
|
||||||
|
child: AddExtraItems(widget.unit, widget.options))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Container(
|
if (state is AdditionalItemsErrorState) {
|
||||||
child: Column(
|
return SomethingWentWrong(
|
||||||
children: [
|
message: onError,
|
||||||
Container(
|
onpressed: () {
|
||||||
margin: const EdgeInsets.only(
|
context.read<AdditionalItemBloc>().add(LoadAdditionalItems());
|
||||||
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
|
|
||||||
SizedBox(
|
|
||||||
width: 5,
|
|
||||||
),
|
|
||||||
Icon(
|
|
||||||
// <-- Icon
|
|
||||||
Icons.add,
|
|
||||||
size: 24.0,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
return Container();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,7 @@ class _BldgLocationLandrefPage extends State<BldgLocationLandrefPage> {
|
||||||
.map((brgy) => brgy.barangayDescription)
|
.map((brgy) => brgy.barangayDescription)
|
||||||
.toList()
|
.toList()
|
||||||
.cast<String>();
|
.cast<String>();
|
||||||
|
return StatefulBuilder(builder: (context, locationState) {
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
|
@ -201,8 +202,8 @@ class _BldgLocationLandrefPage extends State<BldgLocationLandrefPage> {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: customTextField(
|
child: customTextField("OCT/TCT/CLOA No.",
|
||||||
"OCT/TCT/CLOA No.", "", 'oct_tct_cloa'),
|
"", 'oct_tct_cloa'),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10.0),
|
const SizedBox(width: 10.0),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
@ -247,7 +248,8 @@ class _BldgLocationLandrefPage extends State<BldgLocationLandrefPage> {
|
||||||
height: 50,
|
height: 50,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
CustomButton(
|
CustomButton(
|
||||||
icon: const Icon(Icons.chevron_left_rounded,
|
icon: const Icon(Icons.chevron_left_rounded,
|
||||||
|
@ -259,18 +261,90 @@ class _BldgLocationLandrefPage extends State<BldgLocationLandrefPage> {
|
||||||
;
|
;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
CustomButton(
|
// Builder(builder: (context) {
|
||||||
icon: const Icon(Icons.chevron_right_rounded,
|
// return CustomButton(
|
||||||
color: Colors.white),
|
// 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 {
|
onPressed: () async {
|
||||||
{
|
|
||||||
try {
|
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
|
final tempID = await SharedPreferences
|
||||||
.getInstance();
|
.getInstance();
|
||||||
var bldgLocData = BldgLoc(
|
var bldgLocData = BldgLoc(
|
||||||
id: tempID.getInt('tempid')! - 1,
|
id: tempID.getInt('tempid')! - 1,
|
||||||
street: formKey
|
street: formKey.currentState
|
||||||
.currentState?.value['street'],
|
?.value['street'],
|
||||||
barangay: formKey
|
barangay: formKey
|
||||||
.currentState?.value['brgy'],
|
.currentState?.value['brgy'],
|
||||||
municipality: formKey
|
municipality: formKey
|
||||||
|
@ -286,12 +360,12 @@ class _BldgLocationLandrefPage extends State<BldgLocationLandrefPage> {
|
||||||
?.value['oct_tct_cloa'],
|
?.value['oct_tct_cloa'],
|
||||||
lotNo: formKey
|
lotNo: formKey
|
||||||
.currentState?.value['lot_no'],
|
.currentState?.value['lot_no'],
|
||||||
tdn: formKey
|
tdn: formKey.currentState
|
||||||
.currentState?.value['l_td_arp'],
|
?.value['l_td_arp'],
|
||||||
area: formKey
|
area: formKey
|
||||||
.currentState?.value['area'],
|
.currentState?.value['area'],
|
||||||
surveyNo: formKey
|
surveyNo: formKey.currentState
|
||||||
.currentState?.value['survey_no'],
|
?.value['survey_no'],
|
||||||
blkNo: formKey
|
blkNo: formKey
|
||||||
.currentState?.value['blk_no'],
|
.currentState?.value['blk_no'],
|
||||||
);
|
);
|
||||||
|
@ -303,18 +377,19 @@ class _BldgLocationLandrefPage extends State<BldgLocationLandrefPage> {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Fluttertoast.showToast(
|
Fluttertoast.showToast(
|
||||||
msg:
|
msg:
|
||||||
"Slow internet connection, please try again!");
|
"Slow internet connection, please try again!",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
;
|
|
||||||
},
|
},
|
||||||
)
|
);
|
||||||
|
})
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (state is BarangayErrorState) {
|
if (state is BarangayErrorState) {
|
||||||
return SomethingWentWrong(
|
return SomethingWentWrong(
|
||||||
|
|
|
@ -1002,76 +1002,104 @@ class _PropertyAssessmentPage extends State<PropertyAssessmentPage> {
|
||||||
bldgapprDetailsId:
|
bldgapprDetailsId:
|
||||||
tempID.getInt('tempid')! - 1,
|
tempID.getInt('tempid')! - 1,
|
||||||
actualUse: formKey.currentState!
|
actualUse: formKey.currentState!
|
||||||
.value['actual_use'],
|
.value['actual_use'] ??
|
||||||
|
'', // Replace null with an empty string
|
||||||
marketValue: '0.00',
|
marketValue: '0.00',
|
||||||
assessmentLevel: '0.00',
|
assessmentLevel: '0.00',
|
||||||
assessedValue: '0.00',
|
assessedValue: '0.00',
|
||||||
taxable: isTaxable,
|
taxable: isTaxable,
|
||||||
exempt: isExempt,
|
exempt: isExempt,
|
||||||
qtr: int.parse(formKey
|
qtr: int.parse(formKey
|
||||||
.currentState!.value['qtr']),
|
.currentState!
|
||||||
|
.value['qtr'] ??
|
||||||
|
'0'), // Replace null with '0'
|
||||||
yr: int.parse(formKey
|
yr: int.parse(formKey
|
||||||
.currentState!.value['yr']),
|
.currentState!
|
||||||
appraisedbyName: formKey
|
.value['yr'] ??
|
||||||
|
'0'), // Replace null with '0'
|
||||||
|
appraisedbyName: (formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['appraised_by']
|
.value['appraised_by']
|
||||||
.firstname +
|
?.firstname ??
|
||||||
|
'') +
|
||||||
' ' +
|
' ' +
|
||||||
formKey
|
(formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['appraised_by']
|
.value['appraised_by']
|
||||||
.middlename +
|
?.middlename ??
|
||||||
|
'') +
|
||||||
' ' +
|
' ' +
|
||||||
formKey
|
(formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['appraised_by']
|
.value['appraised_by']
|
||||||
.lastname,
|
?.lastname ??
|
||||||
|
''),
|
||||||
appraisedbyDate: formKey
|
appraisedbyDate: formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['app_date'],
|
.value['app_date']
|
||||||
recommendapprName: formKey
|
as DateTime? ??
|
||||||
|
DateTime
|
||||||
|
.now(), // Replace null with current date
|
||||||
|
recommendapprName: (formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['rec_approval']
|
.value['rec_approval']
|
||||||
.firstname +
|
?.firstname ??
|
||||||
|
'') +
|
||||||
' ' +
|
' ' +
|
||||||
formKey
|
(formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['rec_approval']
|
.value['rec_approval']
|
||||||
.middlename +
|
?.middlename ??
|
||||||
|
'') +
|
||||||
' ' +
|
' ' +
|
||||||
formKey
|
(formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['rec_approval']
|
.value['rec_approval']
|
||||||
.lastname,
|
?.lastname ??
|
||||||
|
''),
|
||||||
recommendapprDate: formKey
|
recommendapprDate: formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['rec_date'],
|
.value['rec_date']
|
||||||
approvedbyName: formKey
|
as DateTime? ??
|
||||||
|
DateTime
|
||||||
|
.now(), // Replace null with current date
|
||||||
|
approvedbyName: (formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['apprvd_by']
|
.value['apprvd_by']
|
||||||
.firstname +
|
?.firstname ??
|
||||||
|
'') +
|
||||||
' ' +
|
' ' +
|
||||||
formKey
|
(formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['apprvd_by']
|
.value['apprvd_by']
|
||||||
.middlename +
|
?.middlename ??
|
||||||
|
'') +
|
||||||
' ' +
|
' ' +
|
||||||
formKey
|
(formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['apprvd_by']
|
.value['apprvd_by']
|
||||||
.lastname,
|
?.lastname ??
|
||||||
|
''),
|
||||||
memoranda: _memoranda,
|
memoranda: _memoranda,
|
||||||
swornstatementNo: formKey
|
swornstatementNo: formKey
|
||||||
.currentState!
|
.currentState!.value[
|
||||||
.value['sworn_statement'],
|
'sworn_statement'] ??
|
||||||
|
'', // Replace null with an empty string
|
||||||
dateReceived: formKey
|
dateReceived: formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['date_received'],
|
.value['date_received']
|
||||||
|
as DateTime? ??
|
||||||
|
DateTime
|
||||||
|
.now(), // Replace null with current date
|
||||||
entryDateAssessment: formKey
|
entryDateAssessment: formKey
|
||||||
.currentState!
|
.currentState!
|
||||||
.value['date_of_entry'],
|
.value['date_of_entry']
|
||||||
entryDateBy: formKey
|
as DateTime? ??
|
||||||
.currentState!.value['by'],
|
DateTime
|
||||||
|
.now(), // Replace null with current date
|
||||||
|
entryDateBy: formKey.currentState!
|
||||||
|
.value['by'] ??
|
||||||
|
'', // Replace null with an empty string
|
||||||
);
|
);
|
||||||
|
|
||||||
propertyAssessments.add(ass);
|
propertyAssessments.add(ass);
|
||||||
|
|
|
@ -52,6 +52,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
return StatefulBuilder(builder: (context, structuralState) {
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(30.0),
|
padding: const EdgeInsets.all(30.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -75,7 +76,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
checkColor: Colors.white,
|
checkColor: Colors.white,
|
||||||
value: foundationOthers,
|
value: foundationOthers,
|
||||||
onChanged: (bool? value) {
|
onChanged: (bool? value) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
foundationOthers = value!;
|
foundationOthers = value!;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -92,7 +93,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
replacement: DropDownMultiSelect(
|
replacement: DropDownMultiSelect(
|
||||||
selected_values_style: TextStyle(color: Colors.black),
|
selected_values_style: TextStyle(color: Colors.black),
|
||||||
onChanged: (List<String> x) {
|
onChanged: (List<String> x) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
foundation = x;
|
foundation = x;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -114,7 +115,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
checkColor: Colors.white,
|
checkColor: Colors.white,
|
||||||
value: columOthers,
|
value: columOthers,
|
||||||
onChanged: (bool? value) {
|
onChanged: (bool? value) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
columOthers = value!;
|
columOthers = value!;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -126,11 +127,12 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||||
child: Visibility(
|
child: Visibility(
|
||||||
visible: columOthers,
|
visible: columOthers,
|
||||||
child: customTextField("Enter other columns", "", "other_column"),
|
child:
|
||||||
|
customTextField("Enter other columns", "", "other_column"),
|
||||||
replacement: DropDownMultiSelect(
|
replacement: DropDownMultiSelect(
|
||||||
selected_values_style: TextStyle(color: Colors.black),
|
selected_values_style: TextStyle(color: Colors.black),
|
||||||
onChanged: (List<String> x) {
|
onChanged: (List<String> x) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
column = x;
|
column = x;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -152,7 +154,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
checkColor: Colors.white,
|
checkColor: Colors.white,
|
||||||
value: beamsOthers,
|
value: beamsOthers,
|
||||||
onChanged: (bool? value) {
|
onChanged: (bool? value) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
beamsOthers = value!;
|
beamsOthers = value!;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -168,7 +170,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
replacement: DropDownMultiSelect(
|
replacement: DropDownMultiSelect(
|
||||||
selected_values_style: TextStyle(color: Colors.black),
|
selected_values_style: TextStyle(color: Colors.black),
|
||||||
onChanged: (List<String> x) {
|
onChanged: (List<String> x) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
beam = x;
|
beam = x;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -190,7 +192,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
checkColor: Colors.white,
|
checkColor: Colors.white,
|
||||||
value: tfOthers,
|
value: tfOthers,
|
||||||
onChanged: (bool? value) {
|
onChanged: (bool? value) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
tfOthers = value!;
|
tfOthers = value!;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -207,7 +209,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
replacement: DropDownMultiSelect(
|
replacement: DropDownMultiSelect(
|
||||||
selected_values_style: TextStyle(color: Colors.black),
|
selected_values_style: TextStyle(color: Colors.black),
|
||||||
onChanged: (List<String> x) {
|
onChanged: (List<String> x) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
truss_framing = x;
|
truss_framing = x;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -229,7 +231,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
checkColor: Colors.white,
|
checkColor: Colors.white,
|
||||||
value: roofOthers,
|
value: roofOthers,
|
||||||
onChanged: (bool? value) {
|
onChanged: (bool? value) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
roofOthers = value!;
|
roofOthers = value!;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -245,7 +247,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
replacement: DropDownMultiSelect(
|
replacement: DropDownMultiSelect(
|
||||||
selected_values_style: TextStyle(color: Colors.black),
|
selected_values_style: TextStyle(color: Colors.black),
|
||||||
onChanged: (List<String> x) {
|
onChanged: (List<String> x) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
roof = x;
|
roof = x;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -276,7 +278,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
checkColor: Colors.white,
|
checkColor: Colors.white,
|
||||||
value: flooringOthers,
|
value: flooringOthers,
|
||||||
onChanged: (bool? value) {
|
onChanged: (bool? value) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
flooringOthers = value!;
|
flooringOthers = value!;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -293,7 +295,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
replacement: DropDownMultiSelect(
|
replacement: DropDownMultiSelect(
|
||||||
selected_values_style: TextStyle(color: Colors.black),
|
selected_values_style: TextStyle(color: Colors.black),
|
||||||
onChanged: (List<String> x) {
|
onChanged: (List<String> x) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
flooring = x;
|
flooring = x;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -321,7 +323,7 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
checkColor: Colors.white,
|
checkColor: Colors.white,
|
||||||
value: wpOthers,
|
value: wpOthers,
|
||||||
onChanged: (bool? value) {
|
onChanged: (bool? value) {
|
||||||
setState(() {
|
structuralState(() {
|
||||||
wpOthers = value!;
|
wpOthers = value!;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -361,8 +363,8 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
CustomButton(
|
CustomButton(
|
||||||
icon:
|
icon: const Icon(Icons.chevron_left_rounded,
|
||||||
const Icon(Icons.chevron_left_rounded, color: Colors.white),
|
color: Colors.white),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
{
|
{
|
||||||
widget.PrevBtn();
|
widget.PrevBtn();
|
||||||
|
@ -380,7 +382,8 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
var strucMaterials = StructureMaterialsII(
|
var strucMaterials = StructureMaterialsII(
|
||||||
id: tempID.getInt('tempid')! - 1,
|
id: tempID.getInt('tempid')! - 1,
|
||||||
foundation: foundationOthers
|
foundation: foundationOthers
|
||||||
? formKey.currentState!.value['other_foundation']
|
? formKey
|
||||||
|
.currentState!.value['other_foundation']
|
||||||
.split(',')
|
.split(',')
|
||||||
: foundation,
|
: foundation,
|
||||||
columns: columOthers
|
columns: columOthers
|
||||||
|
@ -423,5 +426,6 @@ class _StructuralMaterialsPage extends State<StructuralMaterialsPage> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ 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:flutter_progress_hud/flutter_progress_hud.dart';
|
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:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:unit2/bloc/passo/bulding/general_description/general_description_bloc.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/bloc/passo/bulding/property_info/property_info_bloc.dart';
|
||||||
import 'package:unit2/model/passo/general_description.dart';
|
import 'package:unit2/model/passo/general_description.dart';
|
||||||
|
@ -49,7 +50,7 @@ class _GeneralDescriptionEdit extends State<GeneralDescriptionEdit> {
|
||||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||||
child:
|
child:
|
||||||
BlocConsumer<GeneralDescriptionBloc, GeneralDescriptionState>(
|
BlocConsumer<GeneralDescriptionBloc, GeneralDescriptionState>(
|
||||||
listener: (context, state) {
|
listener: (context, state) async {
|
||||||
if (state is GenDescLoading) {
|
if (state is GenDescLoading) {
|
||||||
final progress = ProgressHUD.of(context);
|
final progress = ProgressHUD.of(context);
|
||||||
progress!.showWithText("Please wait...");
|
progress!.showWithText("Please wait...");
|
||||||
|
@ -57,6 +58,13 @@ class _GeneralDescriptionEdit extends State<GeneralDescriptionEdit> {
|
||||||
if (state is GenDescLoaded) {
|
if (state is GenDescLoaded) {
|
||||||
final progress = ProgressHUD.of(context);
|
final progress = ProgressHUD.of(context);
|
||||||
progress?.dismiss();
|
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) {
|
if (state is GenDescErrorState) {
|
||||||
final progress = ProgressHUD.of(context);
|
final progress = ProgressHUD.of(context);
|
||||||
|
|
|
@ -33,6 +33,24 @@ class PropertyAppraisalEditPage extends StatefulWidget {
|
||||||
|
|
||||||
class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
double depRate = 0;
|
double depRate = 0;
|
||||||
|
int totalAreas = 0;
|
||||||
|
String actualUse = "";
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_loadDataFromSharedPreferences(); // Call the method to load data
|
||||||
|
}
|
||||||
|
|
||||||
|
// Method to load data from SharedPreferences
|
||||||
|
_loadDataFromSharedPreferences() async {
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
setState(() {
|
||||||
|
actualUse = prefs.getString('actualUse') ?? '';
|
||||||
|
totalAreas = prefs.getInt('totalArea') ??
|
||||||
|
0; // Provide a default value if the key doesn't exist
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
calculateAdditionalItems(List<AdditionalItems> items) {
|
calculateAdditionalItems(List<AdditionalItems> items) {
|
||||||
double sum = 0;
|
double sum = 0;
|
||||||
|
@ -529,13 +547,8 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
}, builder: (context, state) {
|
}, builder: (context, state) {
|
||||||
if (state is AdditionalItemsEditLoaded) {
|
if (state is AdditionalItemsEditLoaded) {
|
||||||
final item = state.items;
|
final item = state.items;
|
||||||
return BlocConsumer<GeneralDescriptionBloc,
|
|
||||||
GeneralDescriptionState>(listener: (context, state) {
|
double totalArea = double.tryParse(totalAreas.toString() ??
|
||||||
// TODO: implement listener
|
|
||||||
}, builder: (context, state) {
|
|
||||||
if (state is GenDescLoaded) {
|
|
||||||
double totalArea = double.tryParse(
|
|
||||||
state.gendesc.totalFloorArea ??
|
|
||||||
appraisal.totalArea.toString()) ??
|
appraisal.totalArea.toString()) ??
|
||||||
0.0;
|
0.0;
|
||||||
|
|
||||||
|
@ -546,8 +559,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Container(
|
child: Container(
|
||||||
margin:
|
margin: const EdgeInsets.only(left: 20.0, right: 20.0),
|
||||||
const EdgeInsets.only(left: 20.0, right: 20.0),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
@ -555,13 +567,11 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
left: 0, top: 20, right: 0, bottom: 20),
|
left: 0, top: 20, right: 0, bottom: 20),
|
||||||
child: const Text('PROPERTY APPRAISAL',
|
child: const Text('PROPERTY APPRAISAL',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold, fontSize: 18),
|
||||||
fontSize: 18),
|
|
||||||
textAlign: TextAlign.left),
|
textAlign: TextAlign.left),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -582,8 +592,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -604,8 +613,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 40),
|
const SizedBox(height: 40),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -626,8 +634,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 40),
|
const SizedBox(height: 40),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -648,8 +655,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -670,8 +676,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -685,8 +690,8 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
calculateConstructionCost(
|
calculateConstructionCost(
|
||||||
double.parse(appraisal
|
double.parse(
|
||||||
.unitconstructSubtotal!),
|
appraisal.unitconstructSubtotal!),
|
||||||
double.parse(
|
double.parse(
|
||||||
appraisal.addItemsSubtotal!))
|
appraisal.addItemsSubtotal!))
|
||||||
.toString()!,
|
.toString()!,
|
||||||
|
@ -697,8 +702,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 40),
|
const SizedBox(height: 40),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -714,10 +718,8 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
height: 25,
|
height: 25,
|
||||||
child: FormBuilderTextField(
|
child: FormBuilderTextField(
|
||||||
name: 'depRate',
|
name: 'depRate',
|
||||||
decoration:
|
decoration: normalTextFieldStyle("0.00", ""),
|
||||||
normalTextFieldStyle("0.00", ""),
|
validator: FormBuilderValidators.compose([]),
|
||||||
validator:
|
|
||||||
FormBuilderValidators.compose([]),
|
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
depRate = double.parse(value!);
|
depRate = double.parse(value!);
|
||||||
|
@ -729,8 +731,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -757,8 +758,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -779,8 +779,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -836,13 +835,10 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 100,
|
width: 100,
|
||||||
margin:
|
margin: const EdgeInsets.only(
|
||||||
const EdgeInsets.only(
|
top: 15, left: 15),
|
||||||
top: 15,
|
|
||||||
left: 15),
|
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.all(
|
const EdgeInsets.all(5.0),
|
||||||
5.0),
|
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'Actual Use',
|
'Actual Use',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
@ -850,19 +846,15 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
FontWeight.bold,
|
FontWeight.bold,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
textAlign:
|
textAlign: TextAlign.center,
|
||||||
TextAlign.center,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
width: 150,
|
width: 150,
|
||||||
margin:
|
margin: const EdgeInsets.only(
|
||||||
const EdgeInsets.only(
|
top: 15, left: 15),
|
||||||
top: 15,
|
|
||||||
left: 15),
|
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.all(
|
const EdgeInsets.all(5.0),
|
||||||
5.0),
|
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'Market Value',
|
'Market Value',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
@ -870,19 +862,15 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
FontWeight.bold,
|
FontWeight.bold,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
textAlign:
|
textAlign: TextAlign.center,
|
||||||
TextAlign.center,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
width: 100,
|
width: 100,
|
||||||
margin:
|
margin: const EdgeInsets.only(
|
||||||
const EdgeInsets.only(
|
top: 15, left: 15),
|
||||||
top: 15,
|
|
||||||
left: 15),
|
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.all(
|
const EdgeInsets.all(5.0),
|
||||||
5.0),
|
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'Ass. Level',
|
'Ass. Level',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
@ -890,19 +878,15 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
FontWeight.bold,
|
FontWeight.bold,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
textAlign:
|
textAlign: TextAlign.center,
|
||||||
TextAlign.center,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
width: 150,
|
width: 150,
|
||||||
margin:
|
margin: const EdgeInsets.only(
|
||||||
const EdgeInsets.only(
|
top: 15, left: 15),
|
||||||
top: 15,
|
|
||||||
left: 15),
|
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.all(
|
const EdgeInsets.all(5.0),
|
||||||
5.0),
|
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'Ass. Value',
|
'Ass. Value',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
@ -910,8 +894,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
FontWeight.bold,
|
FontWeight.bold,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
textAlign:
|
textAlign: TextAlign.center,
|
||||||
TextAlign.center,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -937,18 +920,14 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
const EdgeInsets
|
const EdgeInsets
|
||||||
.all(5.0),
|
.all(5.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
state.gendesc
|
actualUse ?? "",
|
||||||
.actualUse ??
|
style: TextStyle(
|
||||||
"",
|
|
||||||
style:
|
|
||||||
TextStyle(
|
|
||||||
fontWeight:
|
fontWeight:
|
||||||
FontWeight
|
FontWeight
|
||||||
.bold,
|
.bold,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
textAlign:
|
textAlign: TextAlign
|
||||||
TextAlign
|
|
||||||
.center,
|
.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -965,8 +944,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
child: Text(
|
child: Text(
|
||||||
NumberFormat
|
NumberFormat
|
||||||
.currency(
|
.currency(
|
||||||
locale:
|
locale: 'en-PH',
|
||||||
'en-PH',
|
|
||||||
symbol: "₱",
|
symbol: "₱",
|
||||||
).format(
|
).format(
|
||||||
calculateMarketValue(
|
calculateMarketValue(
|
||||||
|
@ -975,18 +953,18 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
item,
|
item,
|
||||||
double.parse(keys
|
double.parse(keys
|
||||||
.currentState
|
.currentState
|
||||||
?.value['depRate'] ??
|
?.value[
|
||||||
appraisal.depreciationRate)),
|
'depRate'] ??
|
||||||
|
appraisal
|
||||||
|
.depreciationRate)),
|
||||||
),
|
),
|
||||||
style:
|
style: TextStyle(
|
||||||
TextStyle(
|
|
||||||
fontWeight:
|
fontWeight:
|
||||||
FontWeight
|
FontWeight
|
||||||
.bold,
|
.bold,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
textAlign:
|
textAlign: TextAlign
|
||||||
TextAlign
|
|
||||||
.center,
|
.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1002,21 +980,22 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
.all(5.0),
|
.all(5.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
assessmentLevel(
|
assessmentLevel(
|
||||||
calculateMarketValue((totalArea * bldgUnitValue), item, double.parse(keys.currentState?.value['depRate'] ?? appraisal.depreciationRate))
|
calculateMarketValue(
|
||||||
|
(totalArea *
|
||||||
|
bldgUnitValue),
|
||||||
|
item,
|
||||||
|
double.parse(keys.currentState?.value['depRate'] ??
|
||||||
|
appraisal.depreciationRate))
|
||||||
.toString(),
|
.toString(),
|
||||||
state
|
actualUse) +
|
||||||
.gendesc
|
|
||||||
.actualUse) +
|
|
||||||
'%',
|
'%',
|
||||||
style:
|
style: TextStyle(
|
||||||
TextStyle(
|
|
||||||
fontWeight:
|
fontWeight:
|
||||||
FontWeight
|
FontWeight
|
||||||
.bold,
|
.bold,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
textAlign:
|
textAlign: TextAlign
|
||||||
TextAlign
|
|
||||||
.center,
|
.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1033,8 +1012,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
child: Text(
|
child: Text(
|
||||||
NumberFormat
|
NumberFormat
|
||||||
.currency(
|
.currency(
|
||||||
locale:
|
locale: 'en-PH',
|
||||||
'en-PH',
|
|
||||||
symbol: "₱",
|
symbol: "₱",
|
||||||
).format(assessmentValue(
|
).format(assessmentValue(
|
||||||
calculateMarketValue(
|
calculateMarketValue(
|
||||||
|
@ -1042,21 +1020,16 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
bldgUnitValue),
|
bldgUnitValue),
|
||||||
item,
|
item,
|
||||||
double.parse(keys.currentState?.value['depRate'] ??
|
double.parse(keys.currentState?.value['depRate'] ??
|
||||||
appraisal
|
appraisal.depreciationRate))
|
||||||
.depreciationRate))
|
|
||||||
.toString(),
|
.toString(),
|
||||||
state
|
actualUse)),
|
||||||
.gendesc
|
style: TextStyle(
|
||||||
.actualUse)),
|
|
||||||
style:
|
|
||||||
TextStyle(
|
|
||||||
fontWeight:
|
fontWeight:
|
||||||
FontWeight
|
FontWeight
|
||||||
.bold,
|
.bold,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
textAlign:
|
textAlign: TextAlign
|
||||||
TextAlign
|
|
||||||
.center,
|
.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1079,8 +1052,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
children: [
|
||||||
CustomButton(
|
CustomButton(
|
||||||
icon: const Icon(Icons.chevron_left_rounded,
|
icon: const Icon(Icons.chevron_left_rounded,
|
||||||
|
@ -1093,8 +1065,7 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
CustomButton(
|
CustomButton(
|
||||||
icon: const Icon(
|
icon: const Icon(Icons.chevron_right_rounded,
|
||||||
Icons.chevron_right_rounded,
|
|
||||||
color: Colors.white),
|
color: Colors.white),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final tempID =
|
final tempID =
|
||||||
|
@ -1105,14 +1076,13 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
var appraisals = PropertyAppraisalEdit(
|
var appraisals = PropertyAppraisalEdit(
|
||||||
id: 1,
|
id: 1,
|
||||||
bldgapprDetailsId: id,
|
bldgapprDetailsId: id,
|
||||||
unitconstructCost:
|
unitconstructCost: bldgUnitValue
|
||||||
bldgUnitValue.toString(),
|
|
||||||
buildingCore: 'test',
|
|
||||||
unitconstructSubtotal:
|
|
||||||
(totalArea * bldgUnitValue)
|
|
||||||
.toString(),
|
.toString(),
|
||||||
depreciationRate:
|
buildingCore: 'test',
|
||||||
depRate.toString(),
|
unitconstructSubtotal: (totalArea *
|
||||||
|
bldgUnitValue)
|
||||||
|
.toString(),
|
||||||
|
depreciationRate: depRate.toString(),
|
||||||
depreciationCost: calculateDepCost(
|
depreciationCost: calculateDepCost(
|
||||||
(totalArea * bldgUnitValue),
|
(totalArea * bldgUnitValue),
|
||||||
item,
|
item,
|
||||||
|
@ -1123,16 +1093,15 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
addItemsSubtotal:
|
addItemsSubtotal:
|
||||||
calculateAdditionalItems(item)
|
calculateAdditionalItems(item)
|
||||||
.toString(),
|
.toString(),
|
||||||
totalpercentDepreciation: (depRate * 100)
|
totalpercentDepreciation:
|
||||||
.toStringAsFixed(2),
|
(depRate * 100).toStringAsFixed(2),
|
||||||
marketValue: calculateMarketValue(
|
marketValue: calculateMarketValue(
|
||||||
(totalArea * bldgUnitValue),
|
(totalArea * bldgUnitValue),
|
||||||
item,
|
item,
|
||||||
depRate)
|
depRate)
|
||||||
.toString(),
|
.toString(),
|
||||||
totalArea: totalArea.toString());
|
totalArea: totalArea.toString());
|
||||||
context
|
context.read<PropertyAppraisalEditBloc>()
|
||||||
.read<PropertyAppraisalEditBloc>()
|
|
||||||
..add(UpdatePropertyAppraisalEdit(
|
..add(UpdatePropertyAppraisalEdit(
|
||||||
appraisalEdit: appraisals,
|
appraisalEdit: appraisals,
|
||||||
id: widget.tempId));
|
id: widget.tempId));
|
||||||
|
@ -1153,9 +1122,6 @@ class _PropertyAppraisalEditPage extends State<PropertyAppraisalEditPage> {
|
||||||
return Container();
|
return Container();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return Container();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (state is PropertyAppraisalEditErrorState) {
|
if (state is PropertyAppraisalEditErrorState) {
|
||||||
return SomethingWentWrong(
|
return SomethingWentWrong(
|
||||||
message: onError,
|
message: onError,
|
||||||
|
|
|
@ -107,7 +107,6 @@ class _AddLandAppraisalModal extends State<AddLandAppraisalModal> {
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 800,
|
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -387,7 +386,7 @@ class _AddLandAppraisalModal extends State<AddLandAppraisalModal> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -239,7 +239,9 @@ class _LandAppraisal extends State<LandAppraisal> {
|
||||||
content: Column(
|
content: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [Expanded(child: AddLandAppraisalModal())],
|
children: [
|
||||||
|
Expanded(child: AddLandAppraisalModal()),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
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:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:unit2/bloc/passo/land/land_property_owner_info/land_property_owner_info_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_boundaries.dart';
|
import 'package:unit2/model/passo/land_property_boundaries.dart';
|
||||||
import 'package:unit2/model/passo/land_property_loc.dart';
|
import 'package:unit2/model/passo/land_property_loc.dart';
|
||||||
|
@ -107,16 +108,18 @@ class _LandLocationAndBoundaries extends State<LandLocationAndBoundaries> {
|
||||||
CustomButton(
|
CustomButton(
|
||||||
icon:
|
icon:
|
||||||
const Icon(Icons.chevron_right, color: Colors.white),
|
const Icon(Icons.chevron_right, color: Colors.white),
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
|
final tempID = await SharedPreferences.getInstance();
|
||||||
|
print(tempID.getInt('landid'));
|
||||||
var boundaries = LandPropertyBoundaries(
|
var boundaries = LandPropertyBoundaries(
|
||||||
id: 3,
|
id: tempID.getInt('landid')! - 1,
|
||||||
north: landKey.currentState?.value['north'],
|
north: landKey.currentState?.value['north'],
|
||||||
east: landKey.currentState?.value['east'],
|
east: landKey.currentState?.value['east'],
|
||||||
west: landKey.currentState?.value['west'],
|
west: landKey.currentState?.value['west'],
|
||||||
south: landKey.currentState?.value['south'],
|
south: landKey.currentState?.value['south'],
|
||||||
);
|
);
|
||||||
var location = LandPropertyLoc(
|
var location = LandPropertyLoc(
|
||||||
id: 3,
|
id: tempID.getInt('landid')! - 1,
|
||||||
street: landKey.currentState?.value['street'],
|
street: landKey.currentState?.value['street'],
|
||||||
barangay: landKey.currentState?.value['brgy'],
|
barangay: landKey.currentState?.value['brgy'],
|
||||||
municipality:
|
municipality:
|
||||||
|
|
|
@ -76,7 +76,6 @@ class _LandPropertyOwnerInfo extends State<LandPropertyOwnerInfo> {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: customTextField("Blk", "", "blk")),
|
child: customTextField("Blk", "", "blk")),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
@ -117,45 +116,6 @@ class _LandPropertyOwnerInfo extends State<LandPropertyOwnerInfo> {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: customTextField("Tel No.", "", "admin_telno"))
|
child: customTextField("Tel No.", "", "admin_telno"))
|
||||||
]),
|
]),
|
||||||
|
|
||||||
// SizedBox(
|
|
||||||
// width: double.infinity,
|
|
||||||
// height: 50,
|
|
||||||
// child: ElevatedButton(
|
|
||||||
// style: secondaryBtnStyle(const Color(0xffd92828),
|
|
||||||
// Color.fromARGB(0, 253, 252, 252), Colors.white54),
|
|
||||||
// child: const Text(
|
|
||||||
// "SUBMIT & PROCEED",
|
|
||||||
// style: TextStyle(
|
|
||||||
// color: Color.fromARGB(239, 255, 255, 255),
|
|
||||||
// fontWeight: FontWeight.w700),
|
|
||||||
// ),
|
|
||||||
// onPressed: () {
|
|
||||||
// // formKey.currentState?.save();
|
|
||||||
// // // var faas = 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']);
|
|
||||||
// // // context.read<AssessorsBloc>().add(AddFaas(faas: faas));
|
|
||||||
// // // _loadTempId();
|
|
||||||
// // _pageController.nextPage(
|
|
||||||
// // duration: _kDuration, curve: _kCurve);
|
|
||||||
// }),
|
|
||||||
// ),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
),
|
),
|
||||||
|
|
|
@ -0,0 +1,128 @@
|
||||||
|
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: 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 LandPropertyOwnerInfoEdit(NextBtn, widget.faas!);
|
||||||
|
case 1:
|
||||||
|
return LandLocationAndBoundariesEdit(PrevBtn, NextBtn, widget.faas!);
|
||||||
|
case 2:
|
||||||
|
return LandAppraisalEdit(PrevBtn, NextBtn);
|
||||||
|
case 3:
|
||||||
|
return OtherImprovementEditPage(PrevBtn, NextBtn);
|
||||||
|
case 4:
|
||||||
|
return ValueAdjustmentEditPage(PrevBtn, NextBtn);
|
||||||
|
case 5:
|
||||||
|
return LandPropertyAssessmentEditPage(PrevBtn, NextBtn);
|
||||||
|
case 6:
|
||||||
|
return LandSignatoriesEdit(onSAveAll);
|
||||||
|
|
||||||
|
default:
|
||||||
|
return LandPropertyOwnerInfoEdit(NextBtn, widget.faas!);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,262 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.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 LandAppraisalEdit extends StatefulWidget {
|
||||||
|
Function PrevBtn;
|
||||||
|
Function NextBtn;
|
||||||
|
LandAppraisalEdit(this.PrevBtn, this.NextBtn);
|
||||||
|
@override
|
||||||
|
_LandAppraisalEdit createState() => _LandAppraisalEdit();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LandAppraisalEdit extends State<LandAppraisalEdit> {
|
||||||
|
// 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 BlocConsumer<LandAppraisalBloc, LandAppraisalState>(
|
||||||
|
listener: (context, state) {
|
||||||
|
// TODO: implement listener
|
||||||
|
}, 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: 700.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: [
|
||||||
|
Container(child: AddLandAppraisalModal()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (state is LandAppraisalErrorState) {
|
||||||
|
return SomethingWentWrong(
|
||||||
|
message: onError,
|
||||||
|
onpressed: () {
|
||||||
|
context.read<LandAppraisalBloc>().add(LoadLandAppraisal());
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Container();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,266 @@
|
||||||
|
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/land/land_boundaries_edit/land_boundaries_edit_bloc.dart';
|
||||||
|
import 'package:unit2/bloc/passo/land/land_location_edit/land_location_edit_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_boundaries.dart';
|
||||||
|
import 'package:unit2/model/passo/land_property_loc.dart';
|
||||||
|
import 'package:unit2/model/passo/land_property_owner.dart';
|
||||||
|
import 'package:unit2/screens/passo/Land/add_land.dart';
|
||||||
|
import 'package:unit2/screens/passo/Land/edit_land/property_owner_info_edit.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 LandLocationAndBoundariesEdit extends StatefulWidget {
|
||||||
|
Function PrevBtn;
|
||||||
|
Function NextBtn;
|
||||||
|
LandPropertyOwner land;
|
||||||
|
LandLocationAndBoundariesEdit(this.PrevBtn, this.NextBtn, this.land);
|
||||||
|
@override
|
||||||
|
_LandLocationAndBoundariesEdit createState() =>
|
||||||
|
_LandLocationAndBoundariesEdit();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LandLocationAndBoundariesEdit
|
||||||
|
extends State<LandLocationAndBoundariesEdit> {
|
||||||
|
@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<LandLocationEditBloc, LandLocationEditState>(
|
||||||
|
listener: (context, state) {
|
||||||
|
if (state is LandLocationEditLoading) {
|
||||||
|
final progress = ProgressHUD.of(context);
|
||||||
|
progress!.showWithText("Please wait...");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state is LandLocationEditErrorState) {
|
||||||
|
final progress = ProgressHUD.of(context);
|
||||||
|
progress?.dismiss();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
builder: (context, state) {
|
||||||
|
if (state is LandLocationEditLoaded) {
|
||||||
|
final landLoc = state.land_loc_edit;
|
||||||
|
return BlocConsumer<LandBoundariesEditBloc,
|
||||||
|
LandBoundariesEditState>(
|
||||||
|
listener: (context, state) {
|
||||||
|
if (state is LandLocationEditLoaded) {
|
||||||
|
final progress = ProgressHUD.of(context);
|
||||||
|
progress?.dismiss();
|
||||||
|
}
|
||||||
|
if (state is LandBoundariesEditErrorState) {
|
||||||
|
final progress = ProgressHUD.of(context);
|
||||||
|
progress?.dismiss();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
builder: (context, state) {
|
||||||
|
if (state is LandBoundariesEditLoaded) {
|
||||||
|
return FormBuilder(
|
||||||
|
key: landEditKey,
|
||||||
|
initialValue: {
|
||||||
|
'street': landLoc.street,
|
||||||
|
'brgy': landLoc.barangay,
|
||||||
|
'municipality': landLoc.municipality,
|
||||||
|
'province': landLoc.province
|
||||||
|
},
|
||||||
|
enabled: true,
|
||||||
|
onChanged: () {
|
||||||
|
landEditKey.currentState!.save();
|
||||||
|
debugPrint(landEditKey.currentState!.value.toString());
|
||||||
|
},
|
||||||
|
autovalidateMode: AutovalidateMode.disabled,
|
||||||
|
skipDisabled: true,
|
||||||
|
child: 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: () {
|
||||||
|
print(widget.land.id);
|
||||||
|
var boundaries =
|
||||||
|
LandPropertyBoundaries(
|
||||||
|
id: widget.land.id,
|
||||||
|
north: landEditKey
|
||||||
|
.currentState?.value['north'],
|
||||||
|
east: landEditKey
|
||||||
|
.currentState?.value['east'],
|
||||||
|
west: landEditKey
|
||||||
|
.currentState?.value['west'],
|
||||||
|
south: landEditKey
|
||||||
|
.currentState?.value['south'],
|
||||||
|
);
|
||||||
|
var location = LandPropertyLoc(
|
||||||
|
id: widget.land.id,
|
||||||
|
street: landEditKey
|
||||||
|
.currentState?.value['street'],
|
||||||
|
barangay: landEditKey
|
||||||
|
.currentState?.value['brgy'],
|
||||||
|
municipality: landEditKey
|
||||||
|
.currentState
|
||||||
|
?.value['municipality'],
|
||||||
|
province: landEditKey.currentState
|
||||||
|
?.value['province'],
|
||||||
|
);
|
||||||
|
|
||||||
|
context.read<LandLocationEditBloc>()
|
||||||
|
..add(UpdateLandLocationEdit(
|
||||||
|
land_loc_edit: location,
|
||||||
|
id: widget.land.id!));
|
||||||
|
|
||||||
|
context.read<LandBoundariesEditBloc>()
|
||||||
|
..add(UpdateLandBoundariesEdit(
|
||||||
|
land_boundaries_edit:
|
||||||
|
boundaries,
|
||||||
|
id: widget.land.id!));
|
||||||
|
|
||||||
|
widget.NextBtn();
|
||||||
|
})
|
||||||
|
],
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (state is LandBoundariesEditErrorState) {
|
||||||
|
return SomethingWentWrong(
|
||||||
|
message: onError,
|
||||||
|
onpressed: () {
|
||||||
|
context.read<LandBoundariesEditBloc>().add(
|
||||||
|
LoadLandBoundariesEdit(
|
||||||
|
land_boundaries_edit: LandPropertyBoundaries(),
|
||||||
|
id: widget.land.id!));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Container();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
if (state is LandLocationEditErrorState) {
|
||||||
|
return SomethingWentWrong(
|
||||||
|
message: onError,
|
||||||
|
onpressed: () {
|
||||||
|
context.read<LandLocationEditBloc>().add(LoadLandLocationEdit(
|
||||||
|
land_loc_edit: LandPropertyLoc(), id: widget.land.id!));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Container();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,263 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.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 OtherImprovementEditPage extends StatefulWidget {
|
||||||
|
Function PrevBtn;
|
||||||
|
Function NextBtn;
|
||||||
|
OtherImprovementEditPage(this.PrevBtn, this.NextBtn);
|
||||||
|
@override
|
||||||
|
_OtherImprovementEditPage createState() => _OtherImprovementEditPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _OtherImprovementEditPage extends State<OtherImprovementEditPage> {
|
||||||
|
// 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 BlocConsumer<OtherImprovementsBloc, OtherImprovementsState>(
|
||||||
|
listener: (context, state) {
|
||||||
|
// TODO: implement listener
|
||||||
|
}, 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: 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('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!
|
||||||
|
? "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: EdgeInsets.symmetric(
|
||||||
|
horizontal: 20.0,
|
||||||
|
vertical: 10.0,
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
'ADD OTHER IMPROVEMENTS',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
content: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [Container(child: AddOtherImprovementModal())],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Container();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,541 @@
|
||||||
|
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: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';
|
||||||
|
|
||||||
|
class LandSignatoriesEdit extends StatefulWidget {
|
||||||
|
Function onSAve;
|
||||||
|
LandSignatoriesEdit(this.onSAve);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_LandSignatoriesEdit createState() => _LandSignatoriesEdit();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LandSignatoriesEdit extends State<LandSignatoriesEdit> {
|
||||||
|
bool isTaxable = false;
|
||||||
|
bool isExempt = false;
|
||||||
|
final focus = FocusNode();
|
||||||
|
String _memoranda = "";
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BlocConsumer<LandExtBloc, LandExtState>(
|
||||||
|
listener: (context, state) {
|
||||||
|
// TODO: implement listener
|
||||||
|
},
|
||||||
|
builder: (context, state) {
|
||||||
|
if (state is LandExtLoaded) {
|
||||||
|
return 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) {
|
||||||
|
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,
|
||||||
|
exempt: isExempt,
|
||||||
|
qtr: int.parse(
|
||||||
|
landKey.currentState!.value['land_qtr']),
|
||||||
|
yr: int.parse(
|
||||||
|
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']);
|
||||||
|
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
return Container();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Container();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Container();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,245 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.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 LandPropertyAssessmentEditPage extends StatefulWidget {
|
||||||
|
Function PrevBtn;
|
||||||
|
Function NextBtn;
|
||||||
|
LandPropertyAssessmentEditPage(this.PrevBtn, this.NextBtn);
|
||||||
|
@override
|
||||||
|
_LandPropertyAssessmentEditPage createState() =>
|
||||||
|
_LandPropertyAssessmentEditPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LandPropertyAssessmentEditPage
|
||||||
|
extends State<LandPropertyAssessmentEditPage> {
|
||||||
|
// 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 BlocConsumer<LandPropertyAssessmentBloc,
|
||||||
|
LandPropertyAssessmentState>(listener: (context, state) {
|
||||||
|
// TODO: implement listener
|
||||||
|
}, 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: [Container(child: AddPropertyAssessmentModal())],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Container();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,223 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:flutter_form_builder/flutter_form_builder.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';
|
||||||
|
|
||||||
|
GlobalKey<FormBuilderState> landEditKey = GlobalKey<FormBuilderState>();
|
||||||
|
|
||||||
|
class LandPropertyOwnerInfoEdit extends StatefulWidget {
|
||||||
|
Function NextBtn;
|
||||||
|
LandPropertyOwner land;
|
||||||
|
LandPropertyOwnerInfoEdit(this.NextBtn, this.land);
|
||||||
|
@override
|
||||||
|
_LandPropertyOwnerInfoEdit createState() => _LandPropertyOwnerInfoEdit();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LandPropertyOwnerInfoEdit extends State<LandPropertyOwnerInfoEdit> {
|
||||||
|
final transaction_codes = ['New', 'Revision'];
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BlocConsumer<LandPropertyOwnerInfoBloc, LandPropertyOwnerInfoState>(
|
||||||
|
listener: (context, state) {
|
||||||
|
// TODO: implement listener
|
||||||
|
},
|
||||||
|
builder: (context, state) {
|
||||||
|
return FormBuilder(
|
||||||
|
key: landEditKey,
|
||||||
|
initialValue: {
|
||||||
|
'transaction_code': widget.land.transCode ?? '',
|
||||||
|
'td_no': widget.land.tdn ?? '',
|
||||||
|
'owner': widget.land.owner ?? '',
|
||||||
|
'pin': widget.land.pin ?? '',
|
||||||
|
'tin': widget.land.tin ?? '',
|
||||||
|
'cloa_no': widget.land.cloaNo ?? '',
|
||||||
|
'dated': widget.land.dated ?? '',
|
||||||
|
'survey_no': widget.land.surveyNo ?? '',
|
||||||
|
'lot_no': widget.land.lotNo ?? '',
|
||||||
|
'blk': widget.land.blkNo ?? '',
|
||||||
|
'address': widget.land.address ?? '',
|
||||||
|
'tel_no': widget.land.telno ?? '',
|
||||||
|
'admin': widget.land.adminUser ?? '',
|
||||||
|
'admin_tin': widget.land.adminTin ?? '',
|
||||||
|
'admin_address': widget.land.adminAddress ?? '',
|
||||||
|
'admin_telno': widget.land.adminTelno ?? '',
|
||||||
|
},
|
||||||
|
enabled: true,
|
||||||
|
onChanged: () {
|
||||||
|
landEditKey.currentState!.save();
|
||||||
|
debugPrint(landEditKey.currentState!.value.toString());
|
||||||
|
},
|
||||||
|
autovalidateMode: AutovalidateMode.disabled,
|
||||||
|
skipDisabled: true,
|
||||||
|
child: 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: widget.land.id,
|
||||||
|
transCode: landEditKey
|
||||||
|
.currentState!.value['transaction_code']
|
||||||
|
.toString(),
|
||||||
|
tdn: landEditKey.currentState!.value['td_no'],
|
||||||
|
cloaNo:
|
||||||
|
landEditKey.currentState!.value['cloa_no'],
|
||||||
|
dated: landEditKey.currentState!.value['dated'],
|
||||||
|
assessedById: "1",
|
||||||
|
assessedByName: "cyril",
|
||||||
|
dateCreated:
|
||||||
|
landEditKey.currentState!.value['dated'],
|
||||||
|
dateModified:
|
||||||
|
landEditKey.currentState!.value['dated'],
|
||||||
|
pin: landEditKey.currentState!.value['pin'],
|
||||||
|
surveyNo:
|
||||||
|
landEditKey.currentState!.value['survey_no'],
|
||||||
|
lotNo: landEditKey.currentState!.value['lot_no'],
|
||||||
|
blkNo: landEditKey.currentState!.value['blk'],
|
||||||
|
owner: landEditKey.currentState!.value['owner'],
|
||||||
|
address:
|
||||||
|
landEditKey.currentState!.value['address'],
|
||||||
|
telno: landEditKey.currentState!.value['tel_no'],
|
||||||
|
tin: landEditKey.currentState!.value['tin'],
|
||||||
|
adminUser:
|
||||||
|
landEditKey.currentState!.value['admin'],
|
||||||
|
adminAddress: landEditKey
|
||||||
|
.currentState!.value['admin_address'],
|
||||||
|
adminTin:
|
||||||
|
landEditKey.currentState!.value['admin_tin'],
|
||||||
|
// faasType: "LAND",
|
||||||
|
adminTelno: landEditKey
|
||||||
|
.currentState!.value['admin_telno']);
|
||||||
|
|
||||||
|
context.read<LandPropertyOwnerInfoBloc>().add(
|
||||||
|
UpdateLandPropertyOwner(
|
||||||
|
land_edit: land, id: widget.land.id!));
|
||||||
|
|
||||||
|
widget.NextBtn();
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,246 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.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 ValueAdjustmentEditPage extends StatefulWidget {
|
||||||
|
Function PrevBtn;
|
||||||
|
Function NextBtn;
|
||||||
|
ValueAdjustmentEditPage(this.PrevBtn, this.NextBtn);
|
||||||
|
@override
|
||||||
|
_ValueAdjustmentEditPage createState() => _ValueAdjustmentEditPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ValueAdjustmentEditPage extends State<ValueAdjustmentEditPage> {
|
||||||
|
// double _totalMarketValue(items) {
|
||||||
|
// double total = 0;
|
||||||
|
// items.forEach((row) {
|
||||||
|
// total += double.parse(row);
|
||||||
|
// });
|
||||||
|
// return total;
|
||||||
|
// }
|
||||||
|
|
||||||
|
void deleteItem(int itemId) {
|
||||||
|
context
|
||||||
|
.read<LandValueAdjustmentsBloc>()
|
||||||
|
.add(DeleteLandValueAdjustments(id: itemId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BlocConsumer<LandValueAdjustmentsBloc, LandValueAdjustmentsState>(
|
||||||
|
listener: (context, state) {
|
||||||
|
// TODO: implement listener
|
||||||
|
}, 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();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,8 +18,10 @@ 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/bloc/passo/bulding/structural_material/structural_material_bloc.dart';
|
||||||
import 'package:unit2/bloc/passo/bulding/unit_construct/unit_construct_bloc.dart';
|
import 'package:unit2/bloc/passo/bulding/unit_construct/unit_construct_bloc.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/bloc/passo/land/land_boundaries_edit/land_boundaries_edit_bloc.dart';
|
||||||
import 'package:unit2/bloc/passo/land/land_classification/land_classification_bloc.dart';
|
import 'package:unit2/bloc/passo/land/land_classification/land_classification_bloc.dart';
|
||||||
import 'package:unit2/bloc/passo/land/land_ext/land_ext_bloc.dart';
|
import 'package:unit2/bloc/passo/land/land_ext/land_ext_bloc.dart';
|
||||||
|
import 'package:unit2/bloc/passo/land/land_location_edit/land_location_edit_bloc.dart';
|
||||||
import 'package:unit2/bloc/passo/land/land_property_assessment/land_property_assessment_bloc.dart';
|
import 'package:unit2/bloc/passo/land/land_property_assessment/land_property_assessment_bloc.dart';
|
||||||
import 'package:unit2/bloc/passo/land/land_property_owner_info/land_property_owner_info_bloc.dart';
|
import 'package:unit2/bloc/passo/land/land_property_owner_info/land_property_owner_info_bloc.dart';
|
||||||
import 'package:unit2/bloc/passo/land/land_subclassification/land_subclassification_bloc.dart';
|
import 'package:unit2/bloc/passo/land/land_subclassification/land_subclassification_bloc.dart';
|
||||||
|
@ -37,6 +39,8 @@ import 'package:unit2/bloc/passo/signatories/signatories_bloc.dart';
|
||||||
import 'package:unit2/bloc/user/user_bloc.dart';
|
import 'package:unit2/bloc/user/user_bloc.dart';
|
||||||
import 'package:unit2/model/passo/additional_items.dart';
|
import 'package:unit2/model/passo/additional_items.dart';
|
||||||
import 'package:unit2/model/passo/general_description.dart';
|
import 'package:unit2/model/passo/general_description.dart';
|
||||||
|
import 'package:unit2/model/passo/land_property_boundaries.dart';
|
||||||
|
import 'package:unit2/model/passo/land_property_loc.dart';
|
||||||
import 'package:unit2/model/passo/land_property_owner.dart';
|
import 'package:unit2/model/passo/land_property_owner.dart';
|
||||||
import 'package:unit2/model/passo/land_ref.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';
|
||||||
|
@ -49,6 +53,7 @@ import 'package:unit2/model/profile/basic_information/primary-information.dart';
|
||||||
import 'package:unit2/screens/passo/Building/add_building.dart';
|
import 'package:unit2/screens/passo/Building/add_building.dart';
|
||||||
import 'package:unit2/screens/passo/Building/edit_building.dart';
|
import 'package:unit2/screens/passo/Building/edit_building.dart';
|
||||||
import 'package:unit2/screens/passo/Land/add_land.dart';
|
import 'package:unit2/screens/passo/Land/add_land.dart';
|
||||||
|
import 'package:unit2/screens/passo/Land/edit_land.dart';
|
||||||
import 'package:unit2/screens/passo/Test%20Envi/multi_dropdown.dart';
|
import 'package:unit2/screens/passo/Test%20Envi/multi_dropdown.dart';
|
||||||
import 'package:unit2/screens/passo/Test%20Envi/speed_dial.dart';
|
import 'package:unit2/screens/passo/Test%20Envi/speed_dial.dart';
|
||||||
import 'package:unit2/theme-data.dart/colors.dart';
|
import 'package:unit2/theme-data.dart/colors.dart';
|
||||||
|
@ -283,79 +288,72 @@ Card _listCard(LandPropertyOwner property_info, context, index) {
|
||||||
padding: const EdgeInsets.all(15.0),
|
padding: const EdgeInsets.all(15.0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
// Navigator.push(context,
|
Navigator.push(context,
|
||||||
// MaterialPageRoute(builder: (BuildContext context) {
|
MaterialPageRoute(builder: (BuildContext context) {
|
||||||
// return MultiBlocProvider(
|
return MultiBlocProvider(
|
||||||
// providers: [
|
providers: [
|
||||||
// BlocProvider(
|
BlocProvider(
|
||||||
// create: (context) =>
|
create: (context) =>
|
||||||
// PropertyInfoBloc()..add(LoadPropertyInfo()),
|
LandPropertyOwnerInfoBloc()..add(LoadLand())),
|
||||||
// ),
|
BlocProvider(
|
||||||
// BlocProvider(
|
create: (context) => LandLocationEditBloc()
|
||||||
// create: (context) =>
|
..add(LoadLandLocationEdit(
|
||||||
// UnitConstructBloc()..add(LoadUnitConstruct()),
|
land_loc_edit: LandPropertyLoc(),
|
||||||
// ),
|
id: property_info.id))),
|
||||||
// BlocProvider(
|
BlocProvider(
|
||||||
// create: (context) =>
|
create: (context) => LandBoundariesEditBloc()
|
||||||
// ClassComponentsBloc()..add(LoadClassComponents()),
|
..add(LoadLandBoundariesEdit(
|
||||||
// ),
|
land_boundaries_edit: LandPropertyBoundaries(),
|
||||||
// BlocProvider(
|
id: property_info.id))),
|
||||||
// create: (context) =>
|
BlocProvider(
|
||||||
// SignatoriesBloc()..add(LoadSignatories())),
|
create: (context) =>
|
||||||
// BlocProvider(
|
LandAppraisalBloc()..add(LoadLandAppraisal())),
|
||||||
// create: (context) => LocationBloc()
|
BlocProvider(
|
||||||
// ..add(
|
create: (context) => LandClassificationBloc()
|
||||||
// LoadLocation(bldgloc: BldgLoc(), id: property_info.id)),
|
..add(LoadLandClassification())),
|
||||||
// ),
|
BlocProvider(
|
||||||
// BlocProvider(
|
create: (context) => LandSubClassificationBloc()
|
||||||
// create: (context) => LandrefBloc()
|
..add(LoadLandSubClassification(
|
||||||
// ..add(
|
cityCode: "1", classCode: 1))),
|
||||||
// LoadLandref(landRef: LandRef(), id: property_info.id)),
|
BlocProvider(
|
||||||
// ),
|
create: (context) =>
|
||||||
// BlocProvider(
|
OtherImprovementsBloc()..add(LoadOtherImprovement())),
|
||||||
// create: (context) => GeneralDescriptionBloc()
|
BlocProvider(
|
||||||
// ..add(LoadGenDesc(
|
create: (context) =>
|
||||||
// gendesc: GeneralDesc(), id: property_info.id)),
|
TypeOfLocationBloc()..add(LoadTypeOfLocation())),
|
||||||
// ),
|
BlocProvider(
|
||||||
// BlocProvider(
|
create: (context) =>
|
||||||
// create: (context) => AdditionalItemsEditBloc()
|
TypeOfRoadBloc()..add(LoadTypeOfRoad())),
|
||||||
// ..add(LoadAdditionalItemsEdit(
|
BlocProvider(
|
||||||
// items: const <AdditionalItems>[],
|
create: (context) => LandPropertyAssessmentBloc()
|
||||||
// id: property_info.id)),
|
..add(LoadLandPropertyAssessment())),
|
||||||
// ),
|
BlocProvider(
|
||||||
// BlocProvider(
|
create: (context) => LandTreesImprovementsBloc()
|
||||||
// create: (context) => PropertyAssessmentEditBloc()
|
..add(LoadLandTreesImprovements())),
|
||||||
// ..add(LoadPropertyAssessmentEdit(
|
BlocProvider(
|
||||||
// assessmentsEdit: PropertyAssessmentEdit(),
|
create: (context) => LandExtBloc()..add(LoadLandExt())),
|
||||||
// id: property_info.id)),
|
BlocProvider(
|
||||||
// ),
|
create: (context) => LandValueAdjustmentsBloc()
|
||||||
// BlocProvider(
|
..add(LoadLandValueAdjustments())),
|
||||||
// create: (context) => PropertyAppraisalEditBloc()
|
BlocProvider(
|
||||||
// ..add(LoadPropertyAppraisalEdit(
|
create: (context) =>
|
||||||
// appraisalEdit: PropertyAppraisalEdit(),
|
SignatoriesBloc()..add(LoadSignatories())),
|
||||||
// id: property_info.id)),
|
BlocProvider(
|
||||||
// ),
|
create: (context) =>
|
||||||
// BlocProvider(
|
MunicipalityBloc()..add(LoadMunicipality())),
|
||||||
// create: (context) =>
|
BlocProvider(
|
||||||
// MunicipalityBloc()..add(LoadMunicipality())),
|
create: (context) =>
|
||||||
// BlocProvider(
|
BarangayBloc()..add(LoadBarangay(id: '01'))),
|
||||||
// create: (context) =>
|
BlocProvider(
|
||||||
// BarangayBloc()..add(LoadBarangay(id: '01'))),
|
create: (context) => MemorandaBloc()..add(LoadMemoranda())),
|
||||||
// BlocProvider(
|
],
|
||||||
// create: (context) => MemorandaBloc()..add(LoadMemoranda())),
|
child: EditLand(
|
||||||
// BlocProvider(
|
index: index,
|
||||||
// create: (context) => StructuralMaterialBloc()
|
faas: property_info,
|
||||||
// ..add(LoadStructuralMaterial(
|
title: 'Bldg & Structure Edit',
|
||||||
// structure: StructureMaterials(),
|
),
|
||||||
// id: property_info.id))),
|
);
|
||||||
// ],
|
}));
|
||||||
// child: EditBuilding(
|
|
||||||
// index: index,
|
|
||||||
// faas: property_info,
|
|
||||||
// title: 'Bldg & Structure Edit',
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }));
|
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
|
|
@ -56,4 +56,57 @@ class LandBoundariesService {
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<http.Response?> updateEdit(LandPropertyBoundaries data, id) async {
|
||||||
|
String path = Url.instance.getLandPropertyBoundaries();
|
||||||
|
Map<String, String> headers = {
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
'X-Client-Key': xClientKey,
|
||||||
|
'X-Client-Secret': xClientKeySecret
|
||||||
|
};
|
||||||
|
Map<String, String> params = {
|
||||||
|
"landappr_details_id": id.toString(),
|
||||||
|
};
|
||||||
|
http.Response? response;
|
||||||
|
try {
|
||||||
|
response = await Request.instance.putRequest(
|
||||||
|
path: path, body: data.toJson(), headers: headers, param: params);
|
||||||
|
} catch (e) {
|
||||||
|
log(e.toString());
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<LandPropertyBoundaries> fetchEdit(tempID) async {
|
||||||
|
String path = Url.instance.getLandPropertyBoundaries();
|
||||||
|
Map<String, String> headers = {
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
'X-Client-Key': xClientKey,
|
||||||
|
'X-Client-Secret': xClientKeySecret
|
||||||
|
};
|
||||||
|
Map<String, String> params = {
|
||||||
|
"landappr_details_id": tempID.toString(),
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
http.Response response = await Request.instance
|
||||||
|
.getRequest(param: params, path: path, headers: headers);
|
||||||
|
|
||||||
|
print('LandBoundEdit');
|
||||||
|
print(response.body);
|
||||||
|
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
final jsonData = jsonDecode(response.body);
|
||||||
|
final dataList = jsonData['data'] as List<dynamic>;
|
||||||
|
final result = LandPropertyBoundaries.fromJson(
|
||||||
|
dataList[0] as Map<String, dynamic>);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
print(response.reasonPhrase);
|
||||||
|
throw Exception(response.reasonPhrase);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
throw e.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,4 +55,57 @@ class LandLocationService {
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<http.Response?> updateEdit(LandPropertyLoc data, id) async {
|
||||||
|
String path = Url.instance.getLandPropertyLoc();
|
||||||
|
Map<String, String> headers = {
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
'X-Client-Key': xClientKey,
|
||||||
|
'X-Client-Secret': xClientKeySecret
|
||||||
|
};
|
||||||
|
Map<String, String> params = {
|
||||||
|
"landappr_details_id": id.toString(),
|
||||||
|
};
|
||||||
|
http.Response? response;
|
||||||
|
try {
|
||||||
|
response = await Request.instance.putRequest(
|
||||||
|
path: path, body: data.toJson(), headers: headers, param: params);
|
||||||
|
} catch (e) {
|
||||||
|
log(e.toString());
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<LandPropertyLoc> fetchEdit(tempID) async {
|
||||||
|
String path = Url.instance.getLandPropertyLoc();
|
||||||
|
Map<String, String> headers = {
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
'X-Client-Key': xClientKey,
|
||||||
|
'X-Client-Secret': xClientKeySecret
|
||||||
|
};
|
||||||
|
Map<String, String> params = {
|
||||||
|
"landappr_details_id": tempID.toString(),
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
http.Response response = await Request.instance
|
||||||
|
.getRequest(param: params, path: path, headers: headers);
|
||||||
|
|
||||||
|
print('LandLocEdit');
|
||||||
|
print(response.body);
|
||||||
|
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
final jsonData = jsonDecode(response.body);
|
||||||
|
final dataList = jsonData['data'] as List<dynamic>;
|
||||||
|
final result =
|
||||||
|
LandPropertyLoc.fromJson(dataList[0] as Map<String, dynamic>);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
print(response.reasonPhrase);
|
||||||
|
throw Exception(response.reasonPhrase);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
throw e.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,4 +52,24 @@ class LandServices {
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<http.Response?> update(LandPropertyOwner data, id) async {
|
||||||
|
String path = Url.instance.getLandOwnerInfo();
|
||||||
|
Map<String, String> headers = {
|
||||||
|
'Content-Type': 'application/json; charset=UTF-8',
|
||||||
|
'X-Client-Key': xClientKey,
|
||||||
|
'X-Client-Secret': xClientKeySecret
|
||||||
|
};
|
||||||
|
Map<String, String> params = {
|
||||||
|
"id": id.toString(),
|
||||||
|
};
|
||||||
|
http.Response? response;
|
||||||
|
try {
|
||||||
|
response = await Request.instance.putRequest(
|
||||||
|
path: path, body: data.toJson(), headers: headers, param: params);
|
||||||
|
} catch (e) {
|
||||||
|
log(e.toString());
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue