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));
} 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));
}
});

View File

@ -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()));
}

View File

@ -580,10 +580,11 @@ class _PropertyAssessmentPage extends State<PropertyAssessmentPage> {
propertyAssessments.add(ass);
context.read<PropertyAssessmentBloc>()
..add(UpdatePropertyAssessment(
assessment:
propertyAssessments[0]));
context
.read<PropertyAssessmentBloc>()
.add(UpdatePropertyAssessment(
assessment:
propertyAssessments[0]));
widget.function();
},
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();
},
);
}
if (state is SignatoriesErrorState) {
return SomethingWentWrong(
message: state.error,
onpressed: () {
context
.read<SignatoriesBloc>()
.add(const LoadSignatories());
},
);
}
return Container();
},
);

View File

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

View File

@ -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());
},
);
}

View File

@ -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>()

View File

@ -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(

View File

@ -266,10 +266,8 @@ class _LandAppraisalEdit extends State<LandAppraisalEdit> {
alignment: Alignment.topCenter,
child: Container(
child: ConstrainedBox(
constraints: BoxConstraints(maxHeight: 500),
child: Container(
child: AddLandAppraisalEditModal(widget.faasId),
),
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!));
},
);
}

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/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,24 +107,30 @@ class BuildingHome extends StatelessWidget {
},
builder: (context, state) {
if (state is PropertyInfoLoaded) {
List<PropertyInfo> propertyList = state.property_info;
return Container(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Column(
children: [
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: propertyList.length,
itemBuilder: (BuildContext context, int index) {
return _listCard(propertyList[index], context,
index, deleteItem);
},
if (state.property_info.isNotEmpty) {
List<PropertyInfo> propertyList = state.property_info;
return Container(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Column(
children: [
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: propertyList.length,
itemBuilder: (BuildContext context, int index) {
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) {
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/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,24 +95,30 @@ class LandHome extends StatelessWidget {
},
builder: (context, state) {
if (state is LandLoaded) {
List<LandPropertyOwner> propertyList = state.land;
return Container(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Column(
children: [
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: propertyList.length,
itemBuilder: (BuildContext context, int index) {
return _listCard(propertyList[index], context,
index, deleteItem);
},
if (state.land.isNotEmpty) {
List<LandPropertyOwner> propertyList = state.land;
return Container(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Column(
children: [
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: propertyList.length,
itemBuilder: (BuildContext context, int index) {
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) {
return SomethingWentWrong(

View File

@ -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