fixed conflict on pubspec.yaml

feature/passo/PASSO-#1-Sync-data-from-device-to-postgre-and-vice-versa
cyzoox 2023-10-03 09:16:28 +08:00
parent 337fb64bdf
commit d7324e34f1
13 changed files with 1113 additions and 997 deletions

View File

@ -42,7 +42,7 @@ class AdditionalItemBloc
emit(AdditionalItemsLoaded(globalAdditionalItems)); emit(AdditionalItemsLoaded(globalAdditionalItems));
} else { } else {
emit(AdditionalItemsErrorState('error')); emit(const AdditionalItemsErrorState('error'));
} }
} catch (e) { } catch (e) {
emit(AdditionalItemsErrorState(e.toString())); emit(AdditionalItemsErrorState(e.toString()));
@ -56,7 +56,7 @@ class AdditionalItemBloc
if (response.statusCode == 200) { if (response.statusCode == 200) {
globalAdditionalItems globalAdditionalItems
.removeWhere(((AdditionalItems element) => element.id == event.id)); .removeWhere(((AdditionalItems element) => element.id == event.id));
emit(AdditionalItemsDeletedState(success: true)); emit(const AdditionalItemsDeletedState(success: true));
} }
}); });

View File

@ -12,14 +12,14 @@ part 'property_appraisal_state.dart';
class PropertyAppraisalBloc class PropertyAppraisalBloc
extends Bloc<PropertyAppraisalEvent, PropertyAppraisalState> { extends Bloc<PropertyAppraisalEvent, PropertyAppraisalState> {
PropertyAppraisalBloc() : super(PropertyAppraisalInitial()) { PropertyAppraisalBloc() : super(PropertyAppraisalLoading()) {
List<PropertyAppraisal> globalPropertyAppraisal = []; List<PropertyAppraisal> globalPropertyAppraisal = [];
on<LoadPropertyAppraisal>((event, emit) async { on<LoadPropertyAppraisal>((event, emit) async {
emit(PropertyAppraisalLoading()); emit(PropertyAppraisalLoading());
try { try {
final appraisal = await PropertyAppraisalServices.instance.fetch(); // final appraisal = await PropertyAppraisalServices.instance.fetch();
print(appraisal); // print(appraisal);
emit(PropertyAppraisalLoaded(appraisal)); emit(PropertyAppraisalLoaded(PropertyAppraisal()));
} catch (e) { } catch (e) {
emit(PropertyAppraisalErrorState(e.toString())); emit(PropertyAppraisalErrorState(e.toString()));
} }

View File

@ -580,10 +580,11 @@ class _PropertyAssessmentPage extends State<PropertyAssessmentPage> {
propertyAssessments.add(ass); propertyAssessments.add(ass);
context.read<PropertyAssessmentBloc>() context
..add(UpdatePropertyAssessment( .read<PropertyAssessmentBloc>()
assessment: .add(UpdatePropertyAssessment(
propertyAssessments[0])); assessment:
propertyAssessments[0]));
widget.function(); widget.function();
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(

View File

@ -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(); return Container();
}, },
); );
} }
if (state is SignatoriesErrorState) {
return SomethingWentWrong(
message: state.error,
onpressed: () {
context
.read<SignatoriesBloc>()
.add(const LoadSignatories());
},
);
}
return Container(); return Container();
}, },
); );

View File

@ -1,6 +1,8 @@
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: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:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:unit2/bloc/passo/land/land_appraisal/land_appraisal_bloc.dart'; import 'package:unit2/bloc/passo/land/land_appraisal/land_appraisal_bloc.dart';
@ -105,394 +107,421 @@ class _AddLandValueAdjustmentModal extends State<AddLandValueAdjustmentModal> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocBuilder<LandValueAdjustmentsBloc, LandValueAdjustmentsState>( return Scaffold(
buildWhen: (previous, current) { body: ProgressHUD(
return false; padding: const EdgeInsets.all(24),
}, builder: (context, state) { backgroundColor: Colors.black87,
if (state is ShowAddLandValueAdjustmentsScreen) { indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
return BlocConsumer<LandAppraisalBloc, LandAppraisalState>( child: BlocBuilder<LandValueAdjustmentsBloc, LandValueAdjustmentsState>(
listener: (context, state) { buildWhen: (previous, current) {
// TODO: implement listener return false;
}, builder: (context, state) { }, builder: (context, state) {
if (state is LandAppraisalLoaded) { if (state is ShowAddLandValueAdjustmentsScreen) {
final land_appr = state.land_appr; return BlocConsumer<LandAppraisalBloc, LandAppraisalState>(
return BlocConsumer<TypeOfRoadBloc, TypeOfRoadState>( listener: (context, state) {
listener: (context, state) { // TODO: implement listener
// TODO: implement listener }, builder: (context, state) {
}, if (state is LandAppraisalLoaded) {
builder: (context, state) { final land_appr = state.land_appr;
if (state is TypeOfRoadLoaded) { return BlocConsumer<TypeOfRoadBloc, TypeOfRoadState>(
final roadType = state.road_type; listener: (context, state) {
return BlocConsumer<TypeOfLocationBloc, TypeOfLocationState>( // TODO: implement listener
listener: (context, state) { },
// TODO: implement listener builder: (context, state) {
}, if (state is TypeOfRoadLoaded) {
builder: (context, state) { final roadType = state.road_type;
if (state is TypeOfLocationLoaded) { return BlocConsumer<TypeOfLocationBloc,
return FormBuilder( TypeOfLocationState>(
key: otherImpKey, listener: (context, state) {
onChanged: () { // TODO: implement listener
otherImpKey.currentState?.save(); },
}, builder: (context, state) {
autovalidateMode: AutovalidateMode.disabled, if (state is TypeOfLocationLoaded) {
child: Padding( return FormBuilder(
padding: const EdgeInsets.all(8.0), key: otherImpKey,
child: Container( onChanged: () {
child: SingleChildScrollView( otherImpKey.currentState?.save();
},
autovalidateMode: AutovalidateMode.disabled,
child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Container(
mainAxisAlignment: MainAxisAlignment.start, child: SingleChildScrollView(
crossAxisAlignment: padding: const EdgeInsets.all(8.0),
CrossAxisAlignment.start, child: Column(
mainAxisSize: MainAxisSize.min, mainAxisAlignment:
children: <Widget>[ MainAxisAlignment.start,
Container( crossAxisAlignment:
margin: const EdgeInsets.only( CrossAxisAlignment.start,
left: 0, mainAxisSize: MainAxisSize.min,
top: 10, children: <Widget>[
right: 0,
bottom: 0),
child: Expanded(
flex: 1,
child:
FormBuilderDropdown<LandAppr?>(
name: 'land_appr_item',
autofocus: false,
decoration: normalTextFieldStyle(
"Land Appraisal Items", ""),
items: land_appr
.map((land_appr) =>
DropdownMenuItem<
LandAppr?>(
value: land_appr,
child: Text((land_appr
.subClass ??
"")),
))
.toList(),
onChanged: (selectedLandAppr) {
if (selectedLandAppr != null) {
setState(() {
_unitValue = double.parse(
selectedLandAppr
.baseMarketval!);
});
}
},
)),
),
SizedBox(
height: 10,
),
Text("Adjustment Factors"),
Container(
margin: const EdgeInsets.only(
left: 0,
top: 10,
right: 0,
bottom: 0),
child: Expanded(
flex: 1,
child: FormBuilderDropdown<
TypeOfRoad?>(
name: 'road_type',
autofocus: false,
decoration: normalTextFieldStyle(
"Type of Road", ""),
items: roadType
.map((roadType) =>
DropdownMenuItem<
TypeOfRoad?>(
value: roadType,
child: Text((roadType
.roadType ??
"")),
))
.toList(),
onChanged: (selectedRoad) {
if (selectedRoad != null) {
setState(() {
_roadTypeDeduction =
double.parse(
selectedRoad
.deduction!);
_roadType =
selectedRoad.roadType!;
});
}
},
)),
),
SizedBox(
height: 10,
),
Text("Type of Location"),
Container(
margin: const EdgeInsets.only(
left: 0,
top: 10,
right: 0,
bottom: 0),
child: Expanded(
flex: 1,
child: FormBuilderDropdown<
TypeOfLocation?>(
name: 'loc_type_road',
autofocus: false,
decoration: normalTextFieldStyle(
"Distance to Road", ""),
items: state.loc_type
.map((locTypeRoad) =>
DropdownMenuItem<
TypeOfLocation?>(
value: locTypeRoad,
child: Text((locTypeRoad
.distanceKm ??
"")),
))
.toList(),
onChanged: (selectedLoadRoad) {
if (selectedLoadRoad != null) {
setState(() {
_locTypeRoad = double.parse(
selectedLoadRoad
.allRoadTypes!);
_locRdDistance =
selectedLoadRoad
.distanceKm!;
});
}
},
)),
),
Container(
margin: const EdgeInsets.only(
left: 0,
top: 10,
right: 0,
bottom: 0),
child: Expanded(
flex: 1,
child: FormBuilderDropdown<
TypeOfLocation?>(
name: 'loc_type_pob',
autofocus: false,
decoration: normalTextFieldStyle(
"Distance to Poblacion", ""),
items: state.loc_type
.map((locTypePob) =>
DropdownMenuItem<
TypeOfLocation?>(
value: locTypePob,
child: Text((locTypePob
.distanceKm ??
"")),
))
.toList(),
onChanged: (selectedLocPob) {
if (selectedLocPob != null) {
setState(() {
_locTypePob = double.parse(
selectedLocPob
.localTradingCenter!);
_locPobDistance =
selectedLocPob
.distanceKm!;
});
}
},
)),
),
const SizedBox(height: 10),
Container(
height: 45.0,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey,
width: 1.0,
),
borderRadius:
BorderRadius.circular(5.0),
),
child: Align(
alignment: Alignment.center,
child: Text(
(calculateAdjustment() * 100)
.toString() +
'%'),
),
),
const SizedBox(height: 10),
Container(
height: 45.0,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey,
width: 1.0,
),
borderRadius:
BorderRadius.circular(5.0),
),
child: Align(
alignment: Alignment.center,
child: Text(NumberFormat.currency(
locale: 'en-PH',
symbol: "",
).format(calculateValueAdjustment())),
),
),
const SizedBox(height: 10),
Container(
height: 45.0,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey,
width: 1.0,
),
borderRadius:
BorderRadius.circular(5.0),
),
child: Align(
alignment: Alignment.center,
child: Text(NumberFormat.currency(
locale: 'en-PH',
symbol: "",
).format(calculateMarketValue())),
),
),
const SizedBox(height: 10),
Row(
children: [
Container( Container(
width: 120, margin: const EdgeInsets.only(
height: 60, left: 0,
padding: const EdgeInsets.all(8.0), top: 10,
child: ElevatedButton( right: 0,
onPressed: () async { bottom: 0),
final tempID = child: Expanded(
await SharedPreferences flex: 1,
.getInstance(); child: FormBuilderDropdown<
print(tempID.getInt('landid')); LandAppr?>(
var adjustments = ValueAdjustments( name: 'land_appr_item',
landapprDetailsId: tempID autofocus: false,
.getInt('landid')! - decoration:
1, normalTextFieldStyle(
baseMarketval: "Land Appraisal Items",
_unitValue.toString(), ""),
adjustmentFactors: items: land_appr
_roadType + .map((land_appr) =>
DropdownMenuItem<
LandAppr?>(
value: land_appr,
child: Text((land_appr
.subClass ??
"")),
))
.toList(),
onChanged:
(selectedLandAppr) {
if (selectedLandAppr !=
null) {
setState(() {
_unitValue = double.parse(
selectedLandAppr
.baseMarketval!);
});
}
},
)),
),
SizedBox(
height: 10,
),
Text("Adjustment Factors"),
Container(
margin: const EdgeInsets.only(
left: 0,
top: 10,
right: 0,
bottom: 0),
child: Expanded(
flex: 1,
child: FormBuilderDropdown<
TypeOfRoad?>(
name: 'road_type',
autofocus: false,
decoration:
normalTextFieldStyle(
"Type of Road", ""),
items: roadType
.map((roadType) =>
DropdownMenuItem<
TypeOfRoad?>(
value: roadType,
child: Text((roadType
.roadType ??
"")),
))
.toList(),
onChanged: (selectedRoad) {
if (selectedRoad != null) {
setState(() {
_roadTypeDeduction =
double.parse(
selectedRoad
.deduction!);
_roadType = selectedRoad
.roadType!;
});
}
},
)),
),
SizedBox(
height: 10,
),
Text("Type of Location"),
Container(
margin: const EdgeInsets.only(
left: 0,
top: 10,
right: 0,
bottom: 0),
child: Expanded(
flex: 1,
child: FormBuilderDropdown<
TypeOfLocation?>(
name: 'loc_type_road',
autofocus: false,
decoration:
normalTextFieldStyle(
"Distance to Road",
""),
items: state.loc_type
.map((locTypeRoad) =>
DropdownMenuItem<
TypeOfLocation?>(
value: locTypeRoad,
child: Text((locTypeRoad
.distanceKm ??
"")),
))
.toList(),
onChanged:
(selectedLoadRoad) {
if (selectedLoadRoad !=
null) {
setState(() {
_locTypeRoad = double
.parse(selectedLoadRoad
.allRoadTypes!);
_locRdDistance =
selectedLoadRoad
.distanceKm!;
});
}
},
)),
),
Container(
margin: const EdgeInsets.only(
left: 0,
top: 10,
right: 0,
bottom: 0),
child: Expanded(
flex: 1,
child: FormBuilderDropdown<
TypeOfLocation?>(
name: 'loc_type_pob',
autofocus: false,
decoration:
normalTextFieldStyle(
"Distance to Poblacion",
""),
items: state.loc_type
.map((locTypePob) =>
DropdownMenuItem<
TypeOfLocation?>(
value: locTypePob,
child: Text((locTypePob
.distanceKm ??
"")),
))
.toList(),
onChanged: (selectedLocPob) {
if (selectedLocPob !=
null) {
setState(() {
_locTypePob = double
.parse(selectedLocPob
.localTradingCenter!);
_locPobDistance =
selectedLocPob
.distanceKm!;
});
}
},
)),
),
const SizedBox(height: 10),
Container(
height: 45.0,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey,
width: 1.0,
),
borderRadius:
BorderRadius.circular(5.0),
),
child: Align(
alignment: Alignment.center,
child: Text(
(calculateAdjustment() * 100)
.toString() +
'%'),
),
),
const SizedBox(height: 10),
Container(
height: 45.0,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey,
width: 1.0,
),
borderRadius:
BorderRadius.circular(5.0),
),
child: Align(
alignment: Alignment.center,
child: Text(NumberFormat.currency(
locale: 'en-PH',
symbol: "",
).format(
calculateValueAdjustment())),
),
),
const SizedBox(height: 10),
Container(
height: 45.0,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey,
width: 1.0,
),
borderRadius:
BorderRadius.circular(5.0),
),
child: Align(
alignment: Alignment.center,
child: Text(NumberFormat.currency(
locale: 'en-PH',
symbol: "",
).format(calculateMarketValue())),
),
),
const SizedBox(height: 10),
Row(
children: [
Container(
width: 120,
height: 60,
padding:
const EdgeInsets.all(8.0),
child: ElevatedButton(
onPressed: () async {
final tempID =
await SharedPreferences
.getInstance();
print(tempID
.getInt('landid'));
var adjustments = ValueAdjustments(
landapprDetailsId:
tempID.getInt(
'landid')! -
1,
baseMarketval:
_unitValue
.toString(),
adjustmentFactors: _roadType +
' , ' + ' , ' +
_locPobDistance + _locPobDistance +
' km from road , ' + ' km from road , ' +
_locPobDistance + _locPobDistance +
' km from poblacion', ' km from poblacion',
adjustment: adjustment:
calculateAdjustment() calculateAdjustment()
.toString(), .toString(),
valueAdjustment: valueAdjustment:
calculateValueAdjustment() calculateValueAdjustment()
.toString(), .toString(),
marketValue: marketValue:
calculateMarketValue() calculateMarketValue()
.toString()); .toString());
context context
.read< .read<
LandValueAdjustmentsBloc>() LandValueAdjustmentsBloc>()
.add( .add(AddLandValueAdjustments(
AddLandValueAdjustments(
val_adj: val_adj:
adjustments)); adjustments));
}, },
style: ElevatedButton.styleFrom( style:
primary: Colors.black, ElevatedButton.styleFrom(
primary: Colors.black,
),
child: const Text("Submit"),
),
), ),
child: const Text("Submit"), const SizedBox(
), width:
), 5), // Use SizedBox for horizontal spacing in a Row
const SizedBox( Container(
width: width: 120,
5), // Use SizedBox for horizontal spacing in a Row height: 60,
Container( padding:
width: 120, const EdgeInsets.all(8.0),
height: 60, child: ElevatedButton(
padding: const EdgeInsets.all(8.0), onPressed: () {
child: ElevatedButton( context
onPressed: () { .read<
context LandValueAdjustmentsBloc>()
.read< .add(
LandValueAdjustmentsBloc>() const LoadLandValueAdjustments());
.add( },
const LoadLandValueAdjustments()); style:
}, ElevatedButton.styleFrom(
style: ElevatedButton.styleFrom( primary: Colors.black,
primary: Colors.black, ),
child: const Text("Cancel"),
),
), ),
child: const Text("Cancel"), ],
), )
),
], ],
) ),
], ),
), ),
), ));
), }
)); if (state is TypeOfLocationErrorState) {
} return SomethingWentWrong(
if (state is TypeOfLocationErrorState) { message: onError,
return SomethingWentWrong( onpressed: () {
message: onError, context
onpressed: () { .read<TypeOfLocationBloc>()
context .add(LoadTypeOfLocation());
.read<TypeOfLocationBloc>() },
.add(LoadTypeOfLocation()); );
}, }
); return Container();
} },
return Container(); );
}, }
); if (state is LandAppraisalErrorState) {
} return SomethingWentWrong(
if (state is LandAppraisalErrorState) { message: onError,
return SomethingWentWrong( onpressed: () {
message: onError, context
onpressed: () { .read<LandAppraisalBloc>()
context .add(LoadLandAppraisal());
.read<LandAppraisalBloc>() },
.add(LoadLandAppraisal()); );
}, }
); return Container();
} },
return Container(); );
}, }
); if (state is LandValueAdjustmentsErrorState) {
return SomethingWentWrong(
message: onError,
onpressed: () {
context
.read<LandValueAdjustmentsBloc>()
.add(LoadLandValueAdjustments());
},
);
}
return Container();
});
} }
if (state is LandValueAdjustmentsErrorState) { if (state is LandValueAdjustmentsErrorState) {
return SomethingWentWrong( return Text(state.error);
message: onError,
onpressed: () {
context
.read<LandValueAdjustmentsBloc>()
.add(LoadLandValueAdjustments());
},
);
} }
return Container(); return Container(
}); child: Text("Land Value Adjustment"),
} );
if (state is LandValueAdjustmentsErrorState) { }),
return Text(state.error); ),
} );
return Container(
child: Text("Land Value Adjustment"),
);
});
} }
} }

View File

@ -68,23 +68,17 @@ class _AddPropertyAssessmentModal extends State<AddPropertyAssessmentModal> {
calculateAssessmentValue() { calculateAssessmentValue() {
switch (_actualUse) { switch (_actualUse) {
case "Residential": case "Residential":
return _unitValue * 0.20; return (_unitValue * 0.20).ceil();
break;
case "Agricultural": case "Agricultural":
return _unitValue * 0.40; return (_unitValue * 0.40).ceil();
break;
case "Commercial": case "Commercial":
return _unitValue * 0.50; return (_unitValue * 0.50).ceil();
break;
case "Industrial": case "Industrial":
return _unitValue * 0.50; return (_unitValue * 0.50).ceil();
break;
case "Mineral": case "Mineral":
return _unitValue * 0.50; return (_unitValue * 0.50).ceil();
break;
case "Timberland": case "Timberland":
return _unitValue * 0.20; return (_unitValue * 0.20).ceil();
break;
default: default:
} }
} }
@ -335,7 +329,7 @@ class _AddPropertyAssessmentModal extends State<AddPropertyAssessmentModal> {
onpressed: () { onpressed: () {
context context
.read<LandValueAdjustmentsBloc>() .read<LandValueAdjustmentsBloc>()
.add(LoadLandValueAdjustments()); .add(const LoadLandValueAdjustments());
}, },
); );
} }
@ -348,7 +342,7 @@ class _AddPropertyAssessmentModal extends State<AddPropertyAssessmentModal> {
onpressed: () { onpressed: () {
context context
.read<LandPropertyAssessmentBloc>() .read<LandPropertyAssessmentBloc>()
.add(LoadLandPropertyAssessment()); .add(const LoadLandPropertyAssessment());
}, },
); );
} }

View File

@ -16,14 +16,6 @@ class ValueAdjustmentPage extends StatefulWidget {
} }
class _ValueAdjustmentPage extends State<ValueAdjustmentPage> { class _ValueAdjustmentPage extends State<ValueAdjustmentPage> {
// double _totalMarketValue(items) {
// double total = 0;
// items.forEach((row) {
// total += double.parse(row);
// });
// return total;
// }
void deleteItem(int itemId) { void deleteItem(int itemId) {
context context
.read<LandValueAdjustmentsBloc>() .read<LandValueAdjustmentsBloc>()

View File

@ -70,22 +70,22 @@ class _AddPropertyAssessmentEditModal
calculateAssessmentValue() { calculateAssessmentValue() {
switch (_actualUse) { switch (_actualUse) {
case "Residential": case "Residential":
return _unitValue * 0.20; return (_unitValue * 0.20).ceil();
break; break;
case "Agricultural": case "Agricultural":
return _unitValue * 0.40; return (_unitValue * 0.40).ceil();
break; break;
case "Commercial": case "Commercial":
return _unitValue * 0.50; return (_unitValue * 0.50).ceil();
break; break;
case "Industrial": case "Industrial":
return _unitValue * 0.50; return (_unitValue * 0.50).ceil();
break; break;
case "Mineral": case "Mineral":
return _unitValue * 0.50; return (_unitValue * 0.50).ceil();
break; break;
case "Timberland": case "Timberland":
return _unitValue * 0.20; return (_unitValue * 0.20).ceil();
break; break;
default: default:
} }
@ -278,7 +278,7 @@ class _AddPropertyAssessmentEditModal
child: ElevatedButton( child: ElevatedButton(
onPressed: () async { onPressed: () async {
var assessment = LandPropertyAssessment( var assessment = LandPropertyAssessment(
landapprDetailsId: widget.tempId, landapprDetailsId: 35,
actualUse: _actualUse, actualUse: _actualUse,
marketval: _unitValue.toString(), marketval: _unitValue.toString(),
assessmentLevel: _assessmentLevel, assessmentLevel: _assessmentLevel,
@ -287,7 +287,7 @@ class _AddPropertyAssessmentEditModal
.toString(), .toString(),
totalMarketval: '0', totalMarketval: '0',
totalAssessedval: '0'); totalAssessedval: '0');
print(assessment.toJson());
context context
.read<LandPropertyAssessmentBloc>() .read<LandPropertyAssessmentBloc>()
.add(AddLandPropertyAssessment( .add(AddLandPropertyAssessment(

View File

@ -266,10 +266,8 @@ class _LandAppraisalEdit extends State<LandAppraisalEdit> {
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
child: Container( child: Container(
child: ConstrainedBox( child: ConstrainedBox(
constraints: BoxConstraints(maxHeight: 500), constraints: const BoxConstraints(maxHeight: 500),
child: Container( child: AddLandAppraisalEditModal(widget.faasId),
child: AddLandAppraisalEditModal(widget.faasId),
),
), ),
), ),
), ),
@ -283,7 +281,7 @@ class _LandAppraisalEdit extends State<LandAppraisalEdit> {
message: onError, message: onError,
onpressed: () { onpressed: () {
context.read<LandAppraisalBloc>().add(LoadLandAppraisalEdit( context.read<LandAppraisalBloc>().add(LoadLandAppraisalEdit(
land_appr: <LandAppr>[], id: widget.faasId!)); land_appr: const <LandAppr>[], id: widget.faasId!));
}, },
); );
} }

View File

@ -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/theme-data.dart/colors.dart';
import 'package:unit2/utils/global_context.dart'; import 'package:unit2/utils/global_context.dart';
import 'package:unit2/utils/text_container.dart'; import 'package:unit2/utils/text_container.dart';
import 'package:unit2/widgets/empty_data.dart';
import 'package:unit2/widgets/error_state.dart'; import 'package:unit2/widgets/error_state.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:flutter_speed_dial/flutter_speed_dial.dart';
@ -106,24 +107,30 @@ class BuildingHome extends StatelessWidget {
}, },
builder: (context, state) { builder: (context, state) {
if (state is PropertyInfoLoaded) { if (state is PropertyInfoLoaded) {
List<PropertyInfo> propertyList = state.property_info; if (state.property_info.isNotEmpty) {
return Container( List<PropertyInfo> propertyList = state.property_info;
padding: const EdgeInsets.symmetric(horizontal: 12), return Container(
child: Column( padding: const EdgeInsets.symmetric(horizontal: 12),
children: [ child: Column(
Expanded( children: [
child: ListView.builder( Expanded(
shrinkWrap: true, child: ListView.builder(
itemCount: propertyList.length, shrinkWrap: true,
itemBuilder: (BuildContext context, int index) { itemCount: propertyList.length,
return _listCard(propertyList[index], context, itemBuilder: (BuildContext context, int index) {
index, deleteItem); return _listCard(propertyList[index], context,
}, index, deleteItem);
},
),
), ),
), ],
], ),
), );
); } else {
return const EmptyData(
message:
"You don't have any building faas added. Please click + to add");
}
} }
if (state is PropertyInfoErrorState) { if (state is PropertyInfoErrorState) {
return SomethingWentWrong( return SomethingWentWrong(

View File

@ -47,6 +47,7 @@ import 'package:unit2/screens/passo/Land/edit_land.dart';
import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/utils/alerts.dart'; import 'package:unit2/utils/alerts.dart';
import 'package:unit2/utils/text_container.dart'; import 'package:unit2/utils/text_container.dart';
import 'package:unit2/widgets/empty_data.dart';
import 'package:unit2/widgets/error_state.dart'; import 'package:unit2/widgets/error_state.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart'; import 'package:flutter_speed_dial/flutter_speed_dial.dart';
@ -94,24 +95,30 @@ class LandHome extends StatelessWidget {
}, },
builder: (context, state) { builder: (context, state) {
if (state is LandLoaded) { if (state is LandLoaded) {
List<LandPropertyOwner> propertyList = state.land; if (state.land.isNotEmpty) {
return Container( List<LandPropertyOwner> propertyList = state.land;
padding: const EdgeInsets.symmetric(horizontal: 12), return Container(
child: Column( padding: const EdgeInsets.symmetric(horizontal: 12),
children: [ child: Column(
Expanded( children: [
child: ListView.builder( Expanded(
shrinkWrap: true, child: ListView.builder(
itemCount: propertyList.length, shrinkWrap: true,
itemBuilder: (BuildContext context, int index) { itemCount: propertyList.length,
return _listCard(propertyList[index], context, itemBuilder: (BuildContext context, int index) {
index, deleteItem); return _listCard(propertyList[index], context,
}, index, deleteItem);
},
),
), ),
), ],
], ),
), );
); } else {
return const EmptyData(
message:
"You don't have any land faas added. Please click + to add");
}
} }
if (state is LandErrorState) { if (state is LandErrorState) {
return SomethingWentWrong( return SomethingWentWrong(

View File

@ -99,6 +99,7 @@ dependencies:
share_plus: ^7.1.0 share_plus: ^7.1.0
animated_splash_screen: ^1.3.0 animated_splash_screen: ^1.3.0
sqflite: ^2.3.0 sqflite: ^2.3.0
dependency_overrides: dependency_overrides:
intl: ^0.18.0 intl: ^0.18.0