fixed conflict on pubspec.yaml
parent
337fb64bdf
commit
d7324e34f1
|
@ -42,7 +42,7 @@ class AdditionalItemBloc
|
|||
|
||||
emit(AdditionalItemsLoaded(globalAdditionalItems));
|
||||
} else {
|
||||
emit(AdditionalItemsErrorState('error'));
|
||||
emit(const AdditionalItemsErrorState('error'));
|
||||
}
|
||||
} catch (e) {
|
||||
emit(AdditionalItemsErrorState(e.toString()));
|
||||
|
@ -56,7 +56,7 @@ class AdditionalItemBloc
|
|||
if (response.statusCode == 200) {
|
||||
globalAdditionalItems
|
||||
.removeWhere(((AdditionalItems element) => element.id == event.id));
|
||||
emit(AdditionalItemsDeletedState(success: true));
|
||||
emit(const AdditionalItemsDeletedState(success: true));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -12,14 +12,14 @@ part 'property_appraisal_state.dart';
|
|||
|
||||
class PropertyAppraisalBloc
|
||||
extends Bloc<PropertyAppraisalEvent, PropertyAppraisalState> {
|
||||
PropertyAppraisalBloc() : super(PropertyAppraisalInitial()) {
|
||||
PropertyAppraisalBloc() : super(PropertyAppraisalLoading()) {
|
||||
List<PropertyAppraisal> globalPropertyAppraisal = [];
|
||||
on<LoadPropertyAppraisal>((event, emit) async {
|
||||
emit(PropertyAppraisalLoading());
|
||||
try {
|
||||
final appraisal = await PropertyAppraisalServices.instance.fetch();
|
||||
print(appraisal);
|
||||
emit(PropertyAppraisalLoaded(appraisal));
|
||||
// final appraisal = await PropertyAppraisalServices.instance.fetch();
|
||||
// print(appraisal);
|
||||
emit(PropertyAppraisalLoaded(PropertyAppraisal()));
|
||||
} catch (e) {
|
||||
emit(PropertyAppraisalErrorState(e.toString()));
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
@ -509,7 +510,37 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocConsumer<AdditionalItemBloc, AdditionalItemState>(
|
||||
child: BlocConsumer<PropertyAppraisalBloc, PropertyAppraisalState>(
|
||||
listener: (context, state) {
|
||||
if (state is PropertyAppraisalLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
print('app_load');
|
||||
}
|
||||
|
||||
if (state is PropertyAppraisalErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is PropertyAppraisalLoaded) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
}
|
||||
if (state is ShowPropertyAppraisalSuccessAlertState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
widget.NextBtn();
|
||||
}
|
||||
if (state is ShowPropertyAppraisalErrorAlertState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress?.dismiss();
|
||||
Fluttertoast.showToast(
|
||||
msg: "Slow internet connection, please try again!");
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is PropertyAppraisalLoaded) {
|
||||
return BlocConsumer<AdditionalItemBloc, AdditionalItemState>(
|
||||
listener: (context, state) {
|
||||
if (state is AdditionalItemsLoading) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
|
@ -536,7 +567,8 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
left: 0, top: 20, right: 0, bottom: 20),
|
||||
child: const Text('PROPERTY APPRAISAL',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 18),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
),
|
||||
Row(
|
||||
|
@ -546,7 +578,8 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
child: Text(
|
||||
"Unit Construction Cost",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 13),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
|
@ -568,7 +601,8 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
child: Text(
|
||||
"Building Core",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 13),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
|
@ -588,14 +622,15 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
child: Text(
|
||||
"Sub-total",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 13),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Text(
|
||||
(double.parse(formKey
|
||||
.currentState!.value['total_area']) *
|
||||
(double.parse(formKey.currentState!
|
||||
.value['total_area']) *
|
||||
double.parse(formKey.currentState!
|
||||
.value['bldg_type'].unitValue))
|
||||
.toString(),
|
||||
|
@ -612,7 +647,8 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
child: Text(
|
||||
"Cost of Additional Items",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 13),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
|
@ -632,13 +668,15 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
child: Text(
|
||||
"Sub-total",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 13),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Text(
|
||||
calculateAdditionalItems(state.items).toString(),
|
||||
calculateAdditionalItems(state.items)
|
||||
.toString(),
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
)
|
||||
|
@ -652,7 +690,8 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
child: Text(
|
||||
"Total Construction Cost",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 13),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
|
@ -661,8 +700,10 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
calculateTotalConstructionCost(
|
||||
(double.parse(formKey.currentState!
|
||||
.value['total_area']) *
|
||||
double.parse(formKey.currentState!
|
||||
.value['bldg_type'].unitValue)),
|
||||
double.parse(formKey
|
||||
.currentState!
|
||||
.value['bldg_type']
|
||||
.unitValue)),
|
||||
state.items)
|
||||
.toString(),
|
||||
textAlign: TextAlign.right,
|
||||
|
@ -678,7 +719,8 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
child: Text(
|
||||
"Depreciation Rate",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 13),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
|
@ -688,7 +730,8 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
child: FormBuilderTextField(
|
||||
name: 'depRate',
|
||||
decoration: normalTextFieldStyle("", ""),
|
||||
validator: FormBuilderValidators.compose([]),
|
||||
validator:
|
||||
FormBuilderValidators.compose([]),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
depRate = double.parse(value!);
|
||||
|
@ -706,7 +749,8 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
child: Text(
|
||||
"Depreciation Cost",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 13),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
|
@ -715,8 +759,10 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
calculateDepCost(
|
||||
(double.parse(formKey.currentState!
|
||||
.value['total_area']) *
|
||||
double.parse(formKey.currentState!
|
||||
.value['bldg_type'].unitValue)),
|
||||
double.parse(formKey
|
||||
.currentState!
|
||||
.value['bldg_type']
|
||||
.unitValue)),
|
||||
state.items,
|
||||
depRate)
|
||||
.toString(),
|
||||
|
@ -733,7 +779,8 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
child: Text(
|
||||
"Total % Depreciation",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 13),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
|
@ -753,7 +800,8 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
child: Text(
|
||||
"Market Value",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 13),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
|
@ -762,8 +810,10 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
calculateMarketValue(
|
||||
(double.parse(formKey.currentState!
|
||||
.value['total_area']) *
|
||||
double.parse(formKey.currentState!
|
||||
.value['bldg_type'].unitValue)),
|
||||
double.parse(formKey
|
||||
.currentState!
|
||||
.value['bldg_type']
|
||||
.unitValue)),
|
||||
state.items,
|
||||
depRate)
|
||||
.toString(),
|
||||
|
@ -794,9 +844,11 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
child: const Text(
|
||||
'PROPERTY ASSESSMENT',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 18),
|
||||
textAlign: TextAlign.left),
|
||||
textAlign:
|
||||
TextAlign.left),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
|
@ -805,77 +857,89 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
Container(
|
||||
width: 100,
|
||||
margin:
|
||||
const EdgeInsets.only(
|
||||
top: 15, left: 15),
|
||||
const EdgeInsets
|
||||
.only(
|
||||
top: 15,
|
||||
left: 15),
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
5.0),
|
||||
const EdgeInsets
|
||||
.all(5.0),
|
||||
child: const Text(
|
||||
'Actual Use',
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
FontWeight
|
||||
.bold,
|
||||
fontSize: 13,
|
||||
),
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
textAlign: TextAlign
|
||||
.center,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 100,
|
||||
margin:
|
||||
const EdgeInsets.only(
|
||||
top: 15, left: 15),
|
||||
const EdgeInsets
|
||||
.only(
|
||||
top: 15,
|
||||
left: 15),
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
5.0),
|
||||
const EdgeInsets
|
||||
.all(5.0),
|
||||
child: const Text(
|
||||
'Market Value',
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
FontWeight
|
||||
.bold,
|
||||
fontSize: 13,
|
||||
),
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
textAlign: TextAlign
|
||||
.center,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 100,
|
||||
margin:
|
||||
const EdgeInsets.only(
|
||||
top: 15, left: 15),
|
||||
const EdgeInsets
|
||||
.only(
|
||||
top: 15,
|
||||
left: 15),
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
5.0),
|
||||
const EdgeInsets
|
||||
.all(5.0),
|
||||
child: const Text(
|
||||
'Ass. Level',
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
FontWeight
|
||||
.bold,
|
||||
fontSize: 13,
|
||||
),
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
textAlign: TextAlign
|
||||
.center,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 100,
|
||||
margin:
|
||||
const EdgeInsets.only(
|
||||
top: 15, left: 15),
|
||||
const EdgeInsets
|
||||
.only(
|
||||
top: 15,
|
||||
left: 15),
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
5.0),
|
||||
const EdgeInsets
|
||||
.all(5.0),
|
||||
child: const Text(
|
||||
'Ass. Value',
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
FontWeight
|
||||
.bold,
|
||||
fontSize: 13,
|
||||
),
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
textAlign: TextAlign
|
||||
.center,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -887,102 +951,72 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
Container(
|
||||
width: 100,
|
||||
margin:
|
||||
const EdgeInsets.only(
|
||||
const EdgeInsets
|
||||
.only(
|
||||
top: 15,
|
||||
left: 15),
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
5.0),
|
||||
const EdgeInsets
|
||||
.all(5.0),
|
||||
child: Text(
|
||||
formKey.currentState
|
||||
?.value[
|
||||
'actual_use']!,
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
FontWeight
|
||||
.bold,
|
||||
fontSize: 13,
|
||||
),
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
TextAlign
|
||||
.center,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 100,
|
||||
margin:
|
||||
const EdgeInsets.only(
|
||||
const EdgeInsets
|
||||
.only(
|
||||
top: 15,
|
||||
left: 15),
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
5.0),
|
||||
const EdgeInsets
|
||||
.all(5.0),
|
||||
child: Text(
|
||||
calculateMarketValue(
|
||||
(double.parse(formKey
|
||||
.currentState!
|
||||
.value[
|
||||
'total_area']) *
|
||||
double.parse(formKey
|
||||
.currentState!
|
||||
.value[
|
||||
'bldg_type']
|
||||
.unitValue)),
|
||||
state.items,
|
||||
depRate)
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 13,
|
||||
),
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 100,
|
||||
margin:
|
||||
const EdgeInsets.only(
|
||||
top: 15,
|
||||
left: 15),
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
5.0),
|
||||
child: Text(
|
||||
assessmentLevel(
|
||||
calculateMarketValue(
|
||||
(double.parse(formKey.currentState!.value[
|
||||
'total_area']) *
|
||||
double.parse(formKey
|
||||
.currentState!
|
||||
.value[
|
||||
'bldg_type']
|
||||
.value['bldg_type']
|
||||
.unitValue)),
|
||||
state.items,
|
||||
depRate)
|
||||
.toString(),
|
||||
formKey.currentState
|
||||
?.value[
|
||||
'actual_use']),
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
FontWeight
|
||||
.bold,
|
||||
fontSize: 13,
|
||||
),
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
TextAlign
|
||||
.center,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 100,
|
||||
margin:
|
||||
const EdgeInsets.only(
|
||||
const EdgeInsets
|
||||
.only(
|
||||
top: 15,
|
||||
left: 15),
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
5.0),
|
||||
const EdgeInsets
|
||||
.all(5.0),
|
||||
child: Text(
|
||||
assessmentValue(
|
||||
assessmentLevel(
|
||||
calculateMarketValue(
|
||||
(double.parse(formKey.currentState!.value['total_area']) *
|
||||
double.parse(formKey
|
||||
|
@ -996,15 +1030,45 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
.toString(),
|
||||
formKey.currentState
|
||||
?.value[
|
||||
'actual_use'])
|
||||
.toString(),
|
||||
'actual_use']),
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
FontWeight
|
||||
.bold,
|
||||
fontSize: 13,
|
||||
),
|
||||
textAlign:
|
||||
TextAlign.center,
|
||||
TextAlign
|
||||
.center,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 100,
|
||||
margin:
|
||||
const EdgeInsets
|
||||
.only(
|
||||
top: 15,
|
||||
left: 15),
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(5.0),
|
||||
child: Text(
|
||||
assessmentValue(
|
||||
calculateMarketValue((double.parse(formKey.currentState!.value['total_area']) * double.parse(formKey.currentState!.value['bldg_type'].unitValue)), state.items, depRate)
|
||||
.toString(),
|
||||
formKey
|
||||
.currentState
|
||||
?.value['actual_use'])
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.bold,
|
||||
fontSize: 13,
|
||||
),
|
||||
textAlign:
|
||||
TextAlign
|
||||
.center,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -1044,11 +1108,12 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
id: 1,
|
||||
bldgapprDetailsId:
|
||||
tempID.getInt('tempid')! - 1,
|
||||
unitconstructCost: formKey.currentState!
|
||||
.value['bldg_type'].unitValue,
|
||||
unitconstructCost: formKey
|
||||
.currentState!
|
||||
.value['bldg_type']
|
||||
.unitValue,
|
||||
buildingCore: 'test',
|
||||
unitconstructSubtotal:
|
||||
(double.parse(formKey.currentState!.value['total_area']) *
|
||||
unitconstructSubtotal: (double.parse(formKey.currentState!.value['total_area']) *
|
||||
double.parse(formKey
|
||||
.currentState!
|
||||
.value['bldg_type']
|
||||
|
@ -1070,8 +1135,6 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
context.read<PropertyAppraisalBloc>()
|
||||
..add(AddPropertyAppraisal(
|
||||
appraisal: appraisals));
|
||||
|
||||
widget.NextBtn();
|
||||
}
|
||||
;
|
||||
},
|
||||
|
@ -1085,6 +1148,10 @@ class _PropertyAppraisalPage extends State<PropertyAppraisalPage> {
|
|||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -580,8 +580,9 @@ class _PropertyAssessmentPage extends State<PropertyAssessmentPage> {
|
|||
|
||||
propertyAssessments.add(ass);
|
||||
|
||||
context.read<PropertyAssessmentBloc>()
|
||||
..add(UpdatePropertyAssessment(
|
||||
context
|
||||
.read<PropertyAssessmentBloc>()
|
||||
.add(UpdatePropertyAssessment(
|
||||
assessment:
|
||||
propertyAssessments[0]));
|
||||
widget.function();
|
||||
|
|
|
@ -1129,10 +1129,30 @@ class _PropertyAssessmentEditPage extends State<PropertyAssessmentEditPage> {
|
|||
),
|
||||
);
|
||||
}
|
||||
if (state is MemorandaErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: state.error,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<MemorandaBloc>()
|
||||
.add(const LoadMemoranda());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (state is SignatoriesErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: state.error,
|
||||
onpressed: () {
|
||||
context
|
||||
.read<SignatoriesBloc>()
|
||||
.add(const LoadSignatories());
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:unit2/bloc/passo/land/land_appraisal/land_appraisal_bloc.dart';
|
||||
|
@ -105,7 +107,12 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<LandValueAdjustmentsBloc, LandValueAdjustmentsState>(
|
||||
return Scaffold(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
backgroundColor: Colors.black87,
|
||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||
child: BlocBuilder<LandValueAdjustmentsBloc, LandValueAdjustmentsState>(
|
||||
buildWhen: (previous, current) {
|
||||
return false;
|
||||
}, builder: (context, state) {
|
||||
|
@ -123,7 +130,8 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
builder: (context, state) {
|
||||
if (state is TypeOfRoadLoaded) {
|
||||
final roadType = state.road_type;
|
||||
return BlocConsumer<TypeOfLocationBloc, TypeOfLocationState>(
|
||||
return BlocConsumer<TypeOfLocationBloc,
|
||||
TypeOfLocationState>(
|
||||
listener: (context, state) {
|
||||
// TODO: implement listener
|
||||
},
|
||||
|
@ -141,7 +149,8 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
@ -154,12 +163,14 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
bottom: 0),
|
||||
child: Expanded(
|
||||
flex: 1,
|
||||
child:
|
||||
FormBuilderDropdown<LandAppr?>(
|
||||
child: FormBuilderDropdown<
|
||||
LandAppr?>(
|
||||
name: 'land_appr_item',
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Land Appraisal Items", ""),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Land Appraisal Items",
|
||||
""),
|
||||
items: land_appr
|
||||
.map((land_appr) =>
|
||||
DropdownMenuItem<
|
||||
|
@ -170,8 +181,10 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
"")),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (selectedLandAppr) {
|
||||
if (selectedLandAppr != null) {
|
||||
onChanged:
|
||||
(selectedLandAppr) {
|
||||
if (selectedLandAppr !=
|
||||
null) {
|
||||
setState(() {
|
||||
_unitValue = double.parse(
|
||||
selectedLandAppr
|
||||
|
@ -197,7 +210,8 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
TypeOfRoad?>(
|
||||
name: 'road_type',
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle(
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Type of Road", ""),
|
||||
items: roadType
|
||||
.map((roadType) =>
|
||||
|
@ -216,8 +230,8 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
double.parse(
|
||||
selectedRoad
|
||||
.deduction!);
|
||||
_roadType =
|
||||
selectedRoad.roadType!;
|
||||
_roadType = selectedRoad
|
||||
.roadType!;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -239,8 +253,10 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
TypeOfLocation?>(
|
||||
name: 'loc_type_road',
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Distance to Road", ""),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Distance to Road",
|
||||
""),
|
||||
items: state.loc_type
|
||||
.map((locTypeRoad) =>
|
||||
DropdownMenuItem<
|
||||
|
@ -251,11 +267,13 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
"")),
|
||||
))
|
||||
.toList(),
|
||||
onChanged: (selectedLoadRoad) {
|
||||
if (selectedLoadRoad != null) {
|
||||
onChanged:
|
||||
(selectedLoadRoad) {
|
||||
if (selectedLoadRoad !=
|
||||
null) {
|
||||
setState(() {
|
||||
_locTypeRoad = double.parse(
|
||||
selectedLoadRoad
|
||||
_locTypeRoad = double
|
||||
.parse(selectedLoadRoad
|
||||
.allRoadTypes!);
|
||||
_locRdDistance =
|
||||
selectedLoadRoad
|
||||
|
@ -277,8 +295,10 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
TypeOfLocation?>(
|
||||
name: 'loc_type_pob',
|
||||
autofocus: false,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Distance to Poblacion", ""),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Distance to Poblacion",
|
||||
""),
|
||||
items: state.loc_type
|
||||
.map((locTypePob) =>
|
||||
DropdownMenuItem<
|
||||
|
@ -290,10 +310,11 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
))
|
||||
.toList(),
|
||||
onChanged: (selectedLocPob) {
|
||||
if (selectedLocPob != null) {
|
||||
if (selectedLocPob !=
|
||||
null) {
|
||||
setState(() {
|
||||
_locTypePob = double.parse(
|
||||
selectedLocPob
|
||||
_locTypePob = double
|
||||
.parse(selectedLocPob
|
||||
.localTradingCenter!);
|
||||
|
||||
_locPobDistance =
|
||||
|
@ -343,7 +364,8 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
child: Text(NumberFormat.currency(
|
||||
locale: 'en-PH',
|
||||
symbol: "₱",
|
||||
).format(calculateValueAdjustment())),
|
||||
).format(
|
||||
calculateValueAdjustment())),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
|
@ -373,21 +395,24 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
final tempID =
|
||||
await SharedPreferences
|
||||
.getInstance();
|
||||
print(tempID.getInt('landid'));
|
||||
print(tempID
|
||||
.getInt('landid'));
|
||||
var adjustments = ValueAdjustments(
|
||||
landapprDetailsId: tempID
|
||||
.getInt('landid')! -
|
||||
landapprDetailsId:
|
||||
tempID.getInt(
|
||||
'landid')! -
|
||||
1,
|
||||
baseMarketval:
|
||||
_unitValue.toString(),
|
||||
adjustmentFactors:
|
||||
_roadType +
|
||||
_unitValue
|
||||
.toString(),
|
||||
adjustmentFactors: _roadType +
|
||||
' , ' +
|
||||
_locPobDistance +
|
||||
' km from road , ' +
|
||||
|
@ -406,12 +431,12 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
context
|
||||
.read<
|
||||
LandValueAdjustmentsBloc>()
|
||||
.add(
|
||||
AddLandValueAdjustments(
|
||||
.add(AddLandValueAdjustments(
|
||||
val_adj:
|
||||
adjustments));
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
style:
|
||||
ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Submit"),
|
||||
|
@ -423,7 +448,8 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
Container(
|
||||
width: 120,
|
||||
height: 60,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
padding:
|
||||
const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
context
|
||||
|
@ -432,7 +458,8 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
.add(
|
||||
const LoadLandValueAdjustments());
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
style:
|
||||
ElevatedButton.styleFrom(
|
||||
primary: Colors.black,
|
||||
),
|
||||
child: const Text("Cancel"),
|
||||
|
@ -493,6 +520,8 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
|
|||
return Container(
|
||||
child: Text("Land Value Adjustment"),
|
||||
);
|
||||
});
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,23 +68,17 @@ class _AddPropertyAssessmentModal extends State<AddPropertyAssessmentModal> {
|
|||
calculateAssessmentValue() {
|
||||
switch (_actualUse) {
|
||||
case "Residential":
|
||||
return _unitValue * 0.20;
|
||||
break;
|
||||
return (_unitValue * 0.20).ceil();
|
||||
case "Agricultural":
|
||||
return _unitValue * 0.40;
|
||||
break;
|
||||
return (_unitValue * 0.40).ceil();
|
||||
case "Commercial":
|
||||
return _unitValue * 0.50;
|
||||
break;
|
||||
return (_unitValue * 0.50).ceil();
|
||||
case "Industrial":
|
||||
return _unitValue * 0.50;
|
||||
break;
|
||||
return (_unitValue * 0.50).ceil();
|
||||
case "Mineral":
|
||||
return _unitValue * 0.50;
|
||||
break;
|
||||
return (_unitValue * 0.50).ceil();
|
||||
case "Timberland":
|
||||
return _unitValue * 0.20;
|
||||
break;
|
||||
return (_unitValue * 0.20).ceil();
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
@ -335,7 +329,7 @@ class _AddPropertyAssessmentModal extends State<AddPropertyAssessmentModal> {
|
|||
onpressed: () {
|
||||
context
|
||||
.read<LandValueAdjustmentsBloc>()
|
||||
.add(LoadLandValueAdjustments());
|
||||
.add(const LoadLandValueAdjustments());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -348,7 +342,7 @@ class _AddPropertyAssessmentModal extends State<AddPropertyAssessmentModal> {
|
|||
onpressed: () {
|
||||
context
|
||||
.read<LandPropertyAssessmentBloc>()
|
||||
.add(LoadLandPropertyAssessment());
|
||||
.add(const LoadLandPropertyAssessment());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -16,14 +16,6 @@ class ValueAdjustmentPage extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _ValueAdjustmentPage extends State<ValueAdjustmentPage> {
|
||||
// double _totalMarketValue(items) {
|
||||
// double total = 0;
|
||||
// items.forEach((row) {
|
||||
// total += double.parse(row);
|
||||
// });
|
||||
// return total;
|
||||
// }
|
||||
|
||||
void deleteItem(int itemId) {
|
||||
context
|
||||
.read<LandValueAdjustmentsBloc>()
|
||||
|
|
|
@ -70,22 +70,22 @@ class _AddPropertyAssessmentEditModal
|
|||
calculateAssessmentValue() {
|
||||
switch (_actualUse) {
|
||||
case "Residential":
|
||||
return _unitValue * 0.20;
|
||||
return (_unitValue * 0.20).ceil();
|
||||
break;
|
||||
case "Agricultural":
|
||||
return _unitValue * 0.40;
|
||||
return (_unitValue * 0.40).ceil();
|
||||
break;
|
||||
case "Commercial":
|
||||
return _unitValue * 0.50;
|
||||
return (_unitValue * 0.50).ceil();
|
||||
break;
|
||||
case "Industrial":
|
||||
return _unitValue * 0.50;
|
||||
return (_unitValue * 0.50).ceil();
|
||||
break;
|
||||
case "Mineral":
|
||||
return _unitValue * 0.50;
|
||||
return (_unitValue * 0.50).ceil();
|
||||
break;
|
||||
case "Timberland":
|
||||
return _unitValue * 0.20;
|
||||
return (_unitValue * 0.20).ceil();
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ class _AddPropertyAssessmentEditModal
|
|||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
var assessment = LandPropertyAssessment(
|
||||
landapprDetailsId: widget.tempId,
|
||||
landapprDetailsId: 35,
|
||||
actualUse: _actualUse,
|
||||
marketval: _unitValue.toString(),
|
||||
assessmentLevel: _assessmentLevel,
|
||||
|
@ -287,7 +287,7 @@ class _AddPropertyAssessmentEditModal
|
|||
.toString(),
|
||||
totalMarketval: '0',
|
||||
totalAssessedval: '0');
|
||||
|
||||
print(assessment.toJson());
|
||||
context
|
||||
.read<LandPropertyAssessmentBloc>()
|
||||
.add(AddLandPropertyAssessment(
|
||||
|
|
|
@ -266,13 +266,11 @@ class _LandAppraisalEdit extends State<LandAppraisalEdit> {
|
|||
alignment: Alignment.topCenter,
|
||||
child: Container(
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(maxHeight: 500),
|
||||
child: Container(
|
||||
constraints: const BoxConstraints(maxHeight: 500),
|
||||
child: AddLandAppraisalEditModal(widget.faasId),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -283,7 +281,7 @@ class _LandAppraisalEdit extends State<LandAppraisalEdit> {
|
|||
message: onError,
|
||||
onpressed: () {
|
||||
context.read<LandAppraisalBloc>().add(LoadLandAppraisalEdit(
|
||||
land_appr: <LandAppr>[], id: widget.faasId!));
|
||||
land_appr: const <LandAppr>[], id: widget.faasId!));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@ import 'package:unit2/screens/passo/Test%20Envi/speed_dial.dart';
|
|||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/utils/global_context.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/empty_data.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
|
||||
|
@ -106,6 +107,7 @@ class BuildingHome extends StatelessWidget {
|
|||
},
|
||||
builder: (context, state) {
|
||||
if (state is PropertyInfoLoaded) {
|
||||
if (state.property_info.isNotEmpty) {
|
||||
List<PropertyInfo> propertyList = state.property_info;
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
|
@ -124,6 +126,11 @@ class BuildingHome extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const EmptyData(
|
||||
message:
|
||||
"You don't have any building faas added. Please click + to add");
|
||||
}
|
||||
}
|
||||
if (state is PropertyInfoErrorState) {
|
||||
return SomethingWentWrong(
|
||||
|
|
|
@ -47,6 +47,7 @@ import 'package:unit2/screens/passo/Land/edit_land.dart';
|
|||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/utils/alerts.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/empty_data.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
|
||||
|
@ -94,6 +95,7 @@ class LandHome extends StatelessWidget {
|
|||
},
|
||||
builder: (context, state) {
|
||||
if (state is LandLoaded) {
|
||||
if (state.land.isNotEmpty) {
|
||||
List<LandPropertyOwner> propertyList = state.land;
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
|
@ -112,6 +114,11 @@ class LandHome extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const EmptyData(
|
||||
message:
|
||||
"You don't have any land faas added. Please click + to add");
|
||||
}
|
||||
}
|
||||
if (state is LandErrorState) {
|
||||
return SomethingWentWrong(
|
||||
|
|
|
@ -99,6 +99,7 @@ dependencies:
|
|||
share_plus: ^7.1.0
|
||||
animated_splash_screen: ^1.3.0
|
||||
sqflite: ^2.3.0
|
||||
|
||||
dependency_overrides:
|
||||
intl: ^0.18.0
|
||||
|
||||
|
|
Loading…
Reference in New Issue