Fixed building home and land home errors enclosed expanded with column, added errorstate try again button
parent
eaabcda3d7
commit
ed41815966
|
@ -10,6 +10,8 @@ import 'package:unit2/model/passo/additional_items.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/theme-data.dart/form-style.dart';
|
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||||
|
import 'package:unit2/utils/text_container.dart';
|
||||||
|
import 'package:unit2/widgets/error_state.dart';
|
||||||
|
|
||||||
class AddExtraItems extends StatefulWidget {
|
class AddExtraItems extends StatefulWidget {
|
||||||
final List<UnitConstruct> unit;
|
final List<UnitConstruct> unit;
|
||||||
|
@ -573,6 +575,14 @@ class _AddExtraItems extends State<AddExtraItems> {
|
||||||
),
|
),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
if (state is AdditionalItemsErrorState) {
|
||||||
|
return SomethingWentWrong(
|
||||||
|
message: onError,
|
||||||
|
onpressed: () {
|
||||||
|
context.read<AdditionalItemBloc>().add(LoadAdditionalItems());
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
return Container();
|
return Container();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,13 +52,6 @@ class _BldgLocLandRefEdit extends State<BldgLocLandRefEdit> {
|
||||||
if (state is LocationErrorState) {
|
if (state is LocationErrorState) {
|
||||||
final progress = ProgressHUD.of(context);
|
final progress = ProgressHUD.of(context);
|
||||||
progress?.dismiss();
|
progress?.dismiss();
|
||||||
// Fluttertoast.showToast(
|
|
||||||
// msg: onError,
|
|
||||||
// fontSize: 24,
|
|
||||||
// toastLength: Toast.LENGTH_LONG,
|
|
||||||
// gravity: ToastGravity.CENTER,
|
|
||||||
// backgroundColor: Colors.black,
|
|
||||||
// textColor: Colors.white);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
|
@ -77,13 +70,6 @@ class _BldgLocLandRefEdit extends State<BldgLocLandRefEdit> {
|
||||||
if (state is LandrefErrorState) {
|
if (state is LandrefErrorState) {
|
||||||
final progress = ProgressHUD.of(context);
|
final progress = ProgressHUD.of(context);
|
||||||
progress?.dismiss();
|
progress?.dismiss();
|
||||||
// Fluttertoast.showToast(
|
|
||||||
// msg: onError,
|
|
||||||
// fontSize: 24,
|
|
||||||
// toastLength: Toast.LENGTH_LONG,
|
|
||||||
// gravity: ToastGravity.CENTER,
|
|
||||||
// backgroundColor: Colors.black,
|
|
||||||
// textColor: Colors.white);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
|
@ -102,13 +88,6 @@ class _BldgLocLandRefEdit extends State<BldgLocLandRefEdit> {
|
||||||
if (state is MunicipalityErrorState) {
|
if (state is MunicipalityErrorState) {
|
||||||
final progress = ProgressHUD.of(context);
|
final progress = ProgressHUD.of(context);
|
||||||
progress?.dismiss();
|
progress?.dismiss();
|
||||||
// Fluttertoast.showToast(
|
|
||||||
// msg: onError,
|
|
||||||
// fontSize: 24,
|
|
||||||
// toastLength: Toast.LENGTH_LONG,
|
|
||||||
// gravity: ToastGravity.CENTER,
|
|
||||||
// backgroundColor: Colors.black,
|
|
||||||
// textColor: Colors.white);
|
|
||||||
}
|
}
|
||||||
}, builder: (context, state) {
|
}, builder: (context, state) {
|
||||||
if (state is MunicipalityLoaded) {
|
if (state is MunicipalityLoaded) {
|
||||||
|
@ -132,13 +111,6 @@ class _BldgLocLandRefEdit extends State<BldgLocLandRefEdit> {
|
||||||
if (state is BarangayErrorState) {
|
if (state is BarangayErrorState) {
|
||||||
final progress = ProgressHUD.of(context);
|
final progress = ProgressHUD.of(context);
|
||||||
progress?.dismiss();
|
progress?.dismiss();
|
||||||
// Fluttertoast.showToast(
|
|
||||||
// msg: onError,
|
|
||||||
// fontSize: 24,
|
|
||||||
// toastLength: Toast.LENGTH_LONG,
|
|
||||||
// gravity: ToastGravity.CENTER,
|
|
||||||
// backgroundColor: Colors.black,
|
|
||||||
// textColor: Colors.white);
|
|
||||||
}
|
}
|
||||||
}, builder: (context, state) {
|
}, builder: (context, state) {
|
||||||
if (state is BarangayLoaded) {
|
if (state is BarangayLoaded) {
|
||||||
|
@ -150,17 +122,15 @@ class _BldgLocLandRefEdit extends State<BldgLocLandRefEdit> {
|
||||||
return FormBuilder(
|
return FormBuilder(
|
||||||
key: keys,
|
key: keys,
|
||||||
initialValue: {
|
initialValue: {
|
||||||
'street': bldgloc.street,
|
'street': bldgloc.street ?? "",
|
||||||
// 'brgy': bldgloc.barangay,
|
'province': bldgloc.province ?? "",
|
||||||
// 'municipality': bldgloc.municipality,
|
|
||||||
'province': bldgloc.province,
|
|
||||||
'l_owner': landRef.owner,
|
'l_owner': landRef.owner,
|
||||||
'oct_tct_cloa': landRef.cloaNo,
|
'oct_tct_cloa': landRef.cloaNo ?? "",
|
||||||
'survey_no': landRef.surveyNo,
|
'survey_no': landRef.surveyNo ?? "",
|
||||||
'lot_no': landRef.lotNo,
|
'lot_no': landRef.lotNo ?? "",
|
||||||
'blk_no': landRef.blkNo,
|
'blk_no': landRef.blkNo ?? "",
|
||||||
'l_td_arp': landRef.tdn,
|
'l_td_arp': landRef.tdn ?? "",
|
||||||
'area': landRef.area
|
'area': landRef.area ?? ""
|
||||||
},
|
},
|
||||||
enabled: true,
|
enabled: true,
|
||||||
onChanged: () {
|
onChanged: () {
|
||||||
|
@ -250,8 +220,8 @@ class _BldgLocLandRefEdit extends State<BldgLocLandRefEdit> {
|
||||||
// optional flex property if flex is 1 because the default flex is 1
|
// optional flex property if flex is 1 because the default flex is 1
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: customDropDownField(
|
child: customDropDownField(
|
||||||
bldgloc.barangay,
|
bldgloc.barangay ?? "",
|
||||||
"",
|
"Barangay",
|
||||||
'brgy',
|
'brgy',
|
||||||
brgyNAmes))
|
brgyNAmes))
|
||||||
]),
|
]),
|
||||||
|
|
|
@ -43,13 +43,13 @@ class _StructuralMaterialsPageEdit extends State<StructuralMaterialsPageEdit> {
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
if (state is StructuralMaterialsLoaded) {
|
if (state is StructuralMaterialsLoaded) {
|
||||||
setState(() {
|
setState(() {
|
||||||
foundation = state.structure.foundation!.split(',');
|
foundation = state.structure.foundation!.split(',') ?? [];
|
||||||
column = state.structure.columns!.split(',');
|
column = state.structure.columns!.split(',') ?? [];
|
||||||
beam = state.structure.beams!.split(',');
|
beam = state.structure.beams!.split(',') ?? [];
|
||||||
truss_framing = state.structure.trussFraming!.split(',');
|
truss_framing = state.structure.trussFraming!.split(',') ?? [];
|
||||||
roof = state.structure.roof!.split(',');
|
roof = state.structure.roof!.split(',') ?? [];
|
||||||
flooring = state.structure.flooring!.split(',');
|
flooring = state.structure.flooring!.split(',') ?? [];
|
||||||
walls = state.structure.walls!.split(',');
|
walls = state.structure.walls!.split(',') ?? [];
|
||||||
// Update other local state variables here if needed
|
// Update other local state variables here if needed
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class PropertyOwnerPage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_PropertyOwnerPage createState() => _PropertyOwnerPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PropertyOwnerPage extends State<PropertyOwnerPage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(body: Container());
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,6 +19,8 @@ import 'package:unit2/model/passo/land_subclassification.dart';
|
||||||
import 'package:unit2/model/passo/unit_construct.dart';
|
import 'package:unit2/model/passo/unit_construct.dart';
|
||||||
import 'package:unit2/screens/passo/Land/add_land.dart';
|
import 'package:unit2/screens/passo/Land/add_land.dart';
|
||||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||||
|
import 'package:unit2/utils/text_container.dart';
|
||||||
|
import 'package:unit2/widgets/error_state.dart';
|
||||||
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
import 'package:unit2/widgets/passo/custom_formBuilder_fields.dart';
|
||||||
|
|
||||||
class AddLandAppraisalModal extends StatefulWidget {
|
class AddLandAppraisalModal extends StatefulWidget {
|
||||||
|
@ -392,22 +394,54 @@ class _AddLandAppraisalModal extends State<AddLandAppraisalModal> {
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
if (state is MunicipalityErrorState) {
|
if (state is MunicipalityErrorState) {
|
||||||
return Text(state.error);
|
return SomethingWentWrong(
|
||||||
|
message: onError,
|
||||||
|
onpressed: () {
|
||||||
|
context
|
||||||
|
.read<MunicipalityBloc>()
|
||||||
|
.add(LoadMunicipality());
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return Container();
|
return Container();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (state is LandSubClassificationErrorState) {
|
||||||
|
return SomethingWentWrong(
|
||||||
|
message: onError,
|
||||||
|
onpressed: () {
|
||||||
|
context.read<LandSubClassificationBloc>().add(
|
||||||
|
const LoadLandSubClassification(
|
||||||
|
cityCode: '1', classCode: 1));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
return Container();
|
return Container();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (state is LandClassificationErrorState) {
|
||||||
|
return SomethingWentWrong(
|
||||||
|
message: onError,
|
||||||
|
onpressed: () {
|
||||||
|
context
|
||||||
|
.read<LandClassificationBloc>()
|
||||||
|
.add(LoadLandClassification());
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
return Container();
|
return Container();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (state is LandAppraisalErrorState) {
|
if (state is LandAppraisalErrorState) {
|
||||||
return Text(state.error);
|
return SomethingWentWrong(
|
||||||
|
message: onError,
|
||||||
|
onpressed: () {
|
||||||
|
context.read<LandAppraisalBloc>().add(LoadLandAppraisal());
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return Container();
|
return Container();
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,6 +9,8 @@ import 'package:unit2/bloc/passo/land/other_improvements/other_improvements_bloc
|
||||||
import 'package:unit2/model/passo/other_improvements.dart';
|
import 'package:unit2/model/passo/other_improvements.dart';
|
||||||
import 'package:unit2/model/passo/trees_improvements.dart';
|
import 'package:unit2/model/passo/trees_improvements.dart';
|
||||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||||
|
import 'package:unit2/utils/text_container.dart';
|
||||||
|
import 'package:unit2/widgets/error_state.dart';
|
||||||
|
|
||||||
class AddOtherImprovementModal extends StatefulWidget {
|
class AddOtherImprovementModal extends StatefulWidget {
|
||||||
// final List<UnitConstruct> unit;
|
// final List<UnitConstruct> unit;
|
||||||
|
@ -329,16 +331,28 @@ class _AddOtherImprovementModal extends State<AddOtherImprovementModal> {
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
if (state is LandTreesImprovementsErrorState) {
|
||||||
|
return SomethingWentWrong(
|
||||||
|
message: onError,
|
||||||
|
onpressed: () {
|
||||||
|
context
|
||||||
|
.read<LandTreesImprovementsBloc>()
|
||||||
|
.add(LoadLandTreesImprovements());
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
return Container();
|
return Container();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (state is OtherImprovementErrorState) {
|
if (state is OtherImprovementErrorState) {
|
||||||
return Text(state.error);
|
return SomethingWentWrong(
|
||||||
|
message: onError,
|
||||||
|
onpressed: () {
|
||||||
|
context.read<OtherImprovementsBloc>().add(LoadOtherImprovement());
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return Container(
|
return Container();
|
||||||
child: Text("Other Improvement"),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@ import 'package:unit2/bloc/passo/land/land_value_adjustments/land_value_adjustme
|
||||||
import 'package:unit2/model/passo/land_property_assessment.dart';
|
import 'package:unit2/model/passo/land_property_assessment.dart';
|
||||||
import 'package:unit2/model/passo/land_value_adjustment.dart';
|
import 'package:unit2/model/passo/land_value_adjustment.dart';
|
||||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||||
|
import 'package:unit2/utils/text_container.dart';
|
||||||
|
import 'package:unit2/widgets/error_state.dart';
|
||||||
|
|
||||||
class AddPropertyAssessmentModal extends StatefulWidget {
|
class AddPropertyAssessmentModal extends StatefulWidget {
|
||||||
// final List<UnitConstruct> unit;
|
// final List<UnitConstruct> unit;
|
||||||
|
@ -327,16 +329,30 @@ class _AddPropertyAssessmentModal extends State<AddPropertyAssessmentModal> {
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
if (state is LandValueAdjustmentsErrorState) {
|
||||||
|
return SomethingWentWrong(
|
||||||
|
message: onError,
|
||||||
|
onpressed: () {
|
||||||
|
context
|
||||||
|
.read<LandValueAdjustmentsBloc>()
|
||||||
|
.add(LoadLandValueAdjustments());
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
return Container();
|
return Container();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (state is LandPropertyAssessmentErrorState) {
|
if (state is LandPropertyAssessmentErrorState) {
|
||||||
return Text(state.error);
|
return SomethingWentWrong(
|
||||||
|
message: onError,
|
||||||
|
onpressed: () {
|
||||||
|
context
|
||||||
|
.read<LandPropertyAssessmentBloc>()
|
||||||
|
.add(LoadLandPropertyAssessment());
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return Container(
|
return Container();
|
||||||
child: Text("Property Assessment"),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,6 @@ class BuildingHome extends StatelessWidget {
|
||||||
Profile profile;
|
Profile profile;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: ProgressHUD(
|
body: ProgressHUD(
|
||||||
padding: const EdgeInsets.only(left: 24, right: 24),
|
|
||||||
backgroundColor: Colors.black87,
|
backgroundColor: Colors.black87,
|
||||||
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
||||||
child: BlocBuilder<UserBloc, UserState>(builder: (context, state) {
|
child: BlocBuilder<UserBloc, UserState>(builder: (context, state) {
|
||||||
|
@ -96,15 +95,19 @@ class BuildingHome extends StatelessWidget {
|
||||||
List<PropertyInfo> propertyList = state.property_info;
|
List<PropertyInfo> propertyList = state.property_info;
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
child: Expanded(
|
child: Column(
|
||||||
child: ListView.builder(
|
children: [
|
||||||
shrinkWrap: true,
|
Expanded(
|
||||||
itemCount: propertyList.length,
|
child: ListView.builder(
|
||||||
itemBuilder: (BuildContext context, int index) {
|
shrinkWrap: true,
|
||||||
return _listCard(
|
itemCount: propertyList.length,
|
||||||
propertyList[index], context, index);
|
itemBuilder: (BuildContext context, int index) {
|
||||||
},
|
return _listCard(
|
||||||
),
|
propertyList[index], context, index);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,15 +96,19 @@ class LandHome extends StatelessWidget {
|
||||||
List<LandPropertyOwner> propertyList = state.land;
|
List<LandPropertyOwner> propertyList = state.land;
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
child: Expanded(
|
child: Column(
|
||||||
child: ListView.builder(
|
children: [
|
||||||
shrinkWrap: true,
|
Expanded(
|
||||||
itemCount: propertyList.length,
|
child: ListView.builder(
|
||||||
itemBuilder: (BuildContext context, int index) {
|
shrinkWrap: true,
|
||||||
return _listCard(
|
itemCount: propertyList.length,
|
||||||
propertyList[index], context, index);
|
itemBuilder: (BuildContext context, int index) {
|
||||||
},
|
return _listCard(
|
||||||
),
|
propertyList[index], context, index);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -114,7 +118,7 @@ class LandHome extends StatelessWidget {
|
||||||
onpressed: () {
|
onpressed: () {
|
||||||
context
|
context
|
||||||
.read<LandPropertyOwnerInfoBloc>()
|
.read<LandPropertyOwnerInfoBloc>()
|
||||||
.add(LoadLand());
|
.add(const LoadLand());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue