2024-03-21 05:47:57 +00:00
|
|
|
import 'dart:convert';
|
|
|
|
import 'dart:io';
|
|
|
|
|
2023-11-10 08:38:47 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
|
|
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
|
|
|
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
|
|
|
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
2024-03-21 05:47:57 +00:00
|
|
|
import 'package:intl/intl.dart';
|
2023-11-10 08:38:47 +00:00
|
|
|
import 'package:unit2/bloc/offline/offline_passo/admin/barangay_admin/barangay_admin_bloc.dart';
|
|
|
|
import 'package:unit2/bloc/offline/offline_passo/admin/class_components_admin.dart/class_components_admin_bloc.dart';
|
|
|
|
import 'package:unit2/bloc/offline/offline_passo/admin/memoranda/memoranda_admin_bloc.dart';
|
|
|
|
import 'package:unit2/bloc/offline/offline_passo/admin/municipalities_admin/municipalities_admin_bloc.dart';
|
|
|
|
import 'package:unit2/bloc/offline/offline_passo/admin/signatories/signatories_admin_bloc.dart';
|
|
|
|
import 'package:unit2/bloc/offline/offline_passo/admin/unit_construction/unit_construction_admin_bloc.dart';
|
|
|
|
import 'package:unit2/bloc/offline/offline_passo/building/additional_items_offline/additional_items_offline_bloc.dart';
|
|
|
|
import 'package:unit2/bloc/offline/offline_passo/building/appraisal_offline/bldg_appraisal_offline_bloc.dart';
|
|
|
|
import 'package:unit2/bloc/offline/offline_passo/building/assessment_offline/bldg_assessment_offline_bloc.dart';
|
2024-02-08 00:52:29 +00:00
|
|
|
import 'package:unit2/bloc/offline/offline_passo/building/building_and_structure/building_and_structure_bloc.dart';
|
2023-11-10 08:38:47 +00:00
|
|
|
import 'package:unit2/bloc/offline/offline_passo/building/general_description/general_description_bloc.dart';
|
|
|
|
import 'package:unit2/bloc/offline/offline_passo/building/landref/landref_location_bloc.dart';
|
|
|
|
import 'package:unit2/bloc/offline/offline_passo/building/location/location_bloc.dart';
|
|
|
|
import 'package:unit2/bloc/offline/offline_passo/building/structural_materials_offline.dart/structural_material_offline_bloc.dart';
|
2024-02-08 00:52:29 +00:00
|
|
|
import 'package:unit2/model/offline/offline_profile.dart';
|
2023-11-10 08:38:47 +00:00
|
|
|
import 'package:unit2/model/passo/additional_items.dart';
|
2024-03-21 05:47:57 +00:00
|
|
|
import 'package:unit2/model/passo/bldg_loc.dart';
|
|
|
|
import 'package:unit2/model/passo/building_and_structure.dart';
|
|
|
|
import 'package:unit2/model/passo/building_details.dart';
|
|
|
|
import 'package:unit2/model/passo/land_ref.dart';
|
2024-02-08 00:52:29 +00:00
|
|
|
import 'package:unit2/model/passo/property_appraisal.dart';
|
2024-03-21 05:47:57 +00:00
|
|
|
import 'package:unit2/model/passo/property_assessment.dart';
|
2023-11-10 08:38:47 +00:00
|
|
|
import 'package:unit2/model/passo/property_info.dart';
|
|
|
|
import 'package:unit2/screens/offline/passo/building/add/add_building.dart';
|
2024-07-11 01:27:35 +00:00
|
|
|
import 'package:unit2/screens/offline/passo/building/add/drawing_pad.dart';
|
|
|
|
import 'package:unit2/screens/offline/passo/building/add/flutter_painter.dart';
|
2023-11-10 08:38:47 +00:00
|
|
|
import 'package:unit2/screens/offline/passo/building/edit/edit_building.dart';
|
2024-02-08 00:52:29 +00:00
|
|
|
import 'package:unit2/screens/offline/passo/land/add/add_land.dart';
|
2023-11-10 08:38:47 +00:00
|
|
|
import 'package:unit2/theme-data.dart/colors.dart';
|
|
|
|
import 'package:unit2/widgets/empty_data.dart';
|
|
|
|
|
2024-02-08 00:52:29 +00:00
|
|
|
import '../../../bloc/offline/offline_passo/admin/land_classification/land_classification_bloc.dart';
|
|
|
|
import '../../../bloc/offline/offline_passo/admin/land_subclassification/land_subclassification_bloc.dart';
|
|
|
|
import '../../../bloc/offline/offline_passo/admin/trees_improvements/trees_improvements_bloc.dart';
|
|
|
|
import '../../../bloc/offline/offline_passo/admin/type_of_location/type_of_location_bloc.dart';
|
|
|
|
import '../../../bloc/offline/offline_passo/admin/type_of_road/type_of_road_bloc.dart';
|
2023-11-10 08:38:47 +00:00
|
|
|
import '../../../bloc/offline/offline_passo/building/owner_info_bloc/crud_bloc.dart';
|
2024-02-08 00:52:29 +00:00
|
|
|
import '../../../bloc/offline/offline_passo/land/land_property_appraisal/land_property_appraisal_bloc.dart';
|
|
|
|
import '../../../bloc/offline/offline_passo/land/land_property_assessment/land_property_assessment_bloc.dart';
|
|
|
|
import '../../../bloc/offline/offline_passo/land/land_property_boundaries/land_property_boundaries_bloc.dart';
|
|
|
|
import '../../../bloc/offline/offline_passo/land/land_property_location/land_property_location_bloc.dart';
|
|
|
|
import '../../../bloc/offline/offline_passo/land/land_property_owner_bloc/land_property_owner_bloc.dart';
|
|
|
|
import '../../../bloc/offline/offline_passo/land/land_property_signture/land_property_signature_bloc.dart';
|
|
|
|
import '../../../bloc/offline/offline_passo/land/other_improvements/other_improvements_bloc.dart';
|
|
|
|
import '../../../bloc/offline/offline_passo/land/value_adjustment/value_adjustment_bloc.dart';
|
2024-03-21 05:47:57 +00:00
|
|
|
import '../../../model/passo/general_description.dart';
|
|
|
|
import '../../../model/passo/structureMaterial.dart';
|
|
|
|
import '../../../sevices/offline/offline_passo/admin/sql_services/sql_services.dart';
|
2024-02-08 00:52:29 +00:00
|
|
|
import '../../../utils/alerts.dart';
|
2024-03-21 05:47:57 +00:00
|
|
|
import 'package:http/http.dart';
|
|
|
|
import 'package:date_format/date_format.dart';
|
|
|
|
|
|
|
|
import '../../../utils/urls.dart';
|
2023-11-10 08:38:47 +00:00
|
|
|
|
|
|
|
class BuildingHomeOffline extends StatelessWidget {
|
2024-02-08 00:52:29 +00:00
|
|
|
final OfflineProfile offlineProfile;
|
|
|
|
const BuildingHomeOffline(this.offlineProfile, {super.key});
|
2023-11-10 08:38:47 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
void deleteItem(int itemId) {
|
|
|
|
context.read<CrudBloc>().add(DeleteTodo(id: itemId));
|
|
|
|
}
|
|
|
|
|
2024-02-08 00:52:29 +00:00
|
|
|
void triggerLoadBldgFaas() {
|
|
|
|
final myBloc = BlocProvider.of<CrudBloc>(context);
|
|
|
|
myBloc.add(FetchTodos());
|
|
|
|
}
|
|
|
|
|
|
|
|
void triggerLoadLandFaas() {
|
|
|
|
final myBloc = BlocProvider.of<LandPropertyOwnerBloc>(context);
|
|
|
|
myBloc.add(LoadLandPropertyOwner());
|
|
|
|
}
|
2023-11-10 08:38:47 +00:00
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
body: ProgressHUD(
|
|
|
|
backgroundColor: Colors.black87,
|
|
|
|
indicatorWidget: const SpinKitFadingCircle(color: Colors.white),
|
2024-03-22 09:01:14 +00:00
|
|
|
child: BlocConsumer<CrudBloc, CrudState>(
|
|
|
|
listener: (context, state) async {
|
|
|
|
if (state is UploadBuildingFaasLoading) {
|
|
|
|
final progress = ProgressHUD.of(context);
|
|
|
|
progress!.showWithText("Syncing data please wait...");
|
|
|
|
}
|
|
|
|
// if (state is GenDescLoaded) {
|
|
|
|
// final progress = ProgressHUD.of(context);
|
|
|
|
// progress?.dismiss();
|
|
|
|
|
|
|
|
// final tempID = await SharedPreferences.getInstance();
|
|
|
|
// await tempID.setInt(
|
|
|
|
// 'totalValue', int.parse(state.gendesc.totalFloorArea!));
|
|
|
|
// await tempID.setString(
|
|
|
|
// 'actualUse', state.gendesc.actualUse!);
|
|
|
|
|
|
|
|
// }
|
2024-04-22 08:05:35 +00:00
|
|
|
if (state is PropertyInfoLoaded) {
|
|
|
|
final progress = ProgressHUD.of(context);
|
|
|
|
progress?.dismiss();
|
|
|
|
}
|
|
|
|
if (state is PropertyOwnerInfoErrorState) {
|
|
|
|
final progress = ProgressHUD.of(context);
|
|
|
|
progress?.dismiss();
|
|
|
|
}
|
2024-03-22 09:01:14 +00:00
|
|
|
},
|
2023-11-10 08:38:47 +00:00
|
|
|
builder: (context, state) {
|
2024-02-08 00:52:29 +00:00
|
|
|
if (state is PropertyInfoLoaded) {
|
|
|
|
if (state.propertyInfos.isNotEmpty) {
|
2023-11-10 08:38:47 +00:00
|
|
|
return Container(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: ListView.builder(
|
|
|
|
shrinkWrap: true,
|
2024-02-08 00:52:29 +00:00
|
|
|
itemCount: state.propertyInfos.length,
|
2023-11-10 08:38:47 +00:00
|
|
|
itemBuilder: (BuildContext context, int index) {
|
2024-02-08 00:52:29 +00:00
|
|
|
return _listCard(
|
|
|
|
state.propertyInfos[index],
|
|
|
|
context,
|
|
|
|
index,
|
|
|
|
deleteItem,
|
2024-03-21 05:47:57 +00:00
|
|
|
state.propertyInfos.length,
|
2024-07-11 01:27:35 +00:00
|
|
|
offlineProfile,
|
|
|
|
triggerLoadBldgFaas);
|
2023-11-10 08:38:47 +00:00
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return const EmptyData(
|
|
|
|
message:
|
|
|
|
"You don't have any building faas added. Please click + to add");
|
|
|
|
}
|
|
|
|
}
|
2024-07-11 01:27:35 +00:00
|
|
|
if (state is PropertyOwnerInfoErrorState) {
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
// Perform actions after the current build frame; safe place for setState or context-dependent actions
|
|
|
|
confirmAlertWithCancelCustom(
|
|
|
|
context,
|
|
|
|
() => context.read<CrudBloc>().add(
|
|
|
|
UploadBuildingFaas(offlineProfile: offlineProfile)),
|
|
|
|
() => context.read<CrudBloc>().add(FetchTodos()),
|
|
|
|
"Sync unsuccesful!",
|
|
|
|
"Please try again!",
|
|
|
|
"Retry",
|
|
|
|
"Cancel");
|
|
|
|
});
|
|
|
|
}
|
2023-11-10 08:38:47 +00:00
|
|
|
return Container();
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
floatingActionButton: SpeedDial(
|
|
|
|
//provide here features of your parent FAB
|
|
|
|
icon: Icons.add,
|
|
|
|
backgroundColor: primary,
|
|
|
|
heroTag: null,
|
|
|
|
useRotationAnimation: true,
|
|
|
|
activeIcon: Icons.close,
|
|
|
|
animationCurve: Curves.elasticInOut,
|
|
|
|
children: [
|
|
|
|
SpeedDialChild(
|
|
|
|
child: const Icon(
|
|
|
|
Icons.maps_home_work_rounded,
|
|
|
|
color: primary,
|
|
|
|
),
|
|
|
|
label: 'Building & Other Structure',
|
|
|
|
onTap: () {
|
|
|
|
Navigator.push(context,
|
|
|
|
MaterialPageRoute(builder: (BuildContext context) {
|
|
|
|
return MultiBlocProvider(providers: [
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => CrudBloc(),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => AdditionalItemsOfflineBloc(),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => MunicipalitiesAdminBloc()
|
|
|
|
..add(const LoadMunicipalities()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => BarangayAdminBloc()
|
|
|
|
..add(
|
|
|
|
const LoadBarangayInMunicipality(cityCode: '01')),
|
|
|
|
),
|
2024-02-08 00:52:29 +00:00
|
|
|
BlocProvider(
|
|
|
|
create: (context) => BuildingAndStructureBloc()),
|
2023-11-10 08:38:47 +00:00
|
|
|
BlocProvider(
|
|
|
|
create: (context) => ClassComponentsAdminBloc()
|
|
|
|
..add(const LoadClassComponents()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => UnitConstructionAdminBloc()
|
|
|
|
..add(const LoadUnitConstruct()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => SignatoriesAdminBloc()
|
|
|
|
..add(const LoadSignatories()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) =>
|
|
|
|
MemorandaAdminBloc()..add(const LoadMemoranda()),
|
|
|
|
),
|
|
|
|
BlocProvider(create: (context) => LandrefLocationBloc()),
|
|
|
|
BlocProvider(create: (context) => LocationBloc()),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => GeneralDescriptionBloc()),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => StructuralMaterialOfflineBloc()),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => AdditionalItemsOfflineBloc()
|
|
|
|
..add(const LoadAdditionalItems())),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => BldgAppraisalOfflineBloc()),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => BldgAssessmentOfflineBloc()),
|
2024-02-08 00:52:29 +00:00
|
|
|
], child: AddBuilding(triggerLoadBldgFaas, offlineProfile));
|
2023-11-10 08:38:47 +00:00
|
|
|
}));
|
|
|
|
}),
|
|
|
|
SpeedDialChild(
|
|
|
|
child: const Icon(
|
|
|
|
Icons.forest_rounded,
|
|
|
|
color: primary,
|
|
|
|
),
|
|
|
|
label: 'Land/Other Improvements',
|
2024-02-08 00:52:29 +00:00
|
|
|
onTap: () {
|
|
|
|
Navigator.push(context,
|
|
|
|
MaterialPageRoute(builder: (BuildContext context) {
|
|
|
|
return MultiBlocProvider(providers: [
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => LandPropertyOwnerBloc(),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => LandPropertyAppraisalBloc()
|
|
|
|
..add(const LoadLandPropertyAppraisal()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => LandClassificationBloc()
|
|
|
|
..add(const LoadLandClassification()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => LandSubclassificationBloc()
|
|
|
|
..add(const LoadLandSubClassification()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => MunicipalitiesAdminBloc()
|
|
|
|
..add(const LoadMunicipalities()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => OtherImprovementsBloc()
|
|
|
|
..add(const LoadOtherImprovements()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => TreesImprovementsBloc()
|
|
|
|
..add(const LoadTreesImprovements()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => ValueAdjustmentBloc()
|
|
|
|
..add(const LoadValueAdjustment()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) =>
|
|
|
|
TypeOfRoadBloc()..add(const LoadTypeOfRoad()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) =>
|
|
|
|
TypeOfLocationBloc()..add(const LoadTypeOfLocation()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => LandPropertyAssessmentBloc()
|
|
|
|
..add(const LoadLandPropertyAssessment()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => LandPropertySignatureBloc()),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) =>
|
|
|
|
SignatoriesAdminBloc()..add(const LoadSignatories()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) =>
|
|
|
|
MemorandaAdminBloc()..add(const LoadMemoranda()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => LandPropertyLocationBloc(),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => LandPropertyBoundariesBloc(),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => TreesImprovementsBloc()
|
|
|
|
..add(const LoadTreesImprovements()),
|
|
|
|
),
|
|
|
|
], child: AddLandOffline(triggerLoadBldgFaas));
|
|
|
|
}));
|
|
|
|
},
|
2023-11-10 08:38:47 +00:00
|
|
|
),
|
|
|
|
SpeedDialChild(
|
|
|
|
child: const Icon(
|
|
|
|
Icons.precision_manufacturing_rounded,
|
|
|
|
color: primary,
|
|
|
|
),
|
|
|
|
label: 'Machinery',
|
2024-07-11 01:27:35 +00:00
|
|
|
onTap: () {
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (context) => const DrawingScreen()),
|
|
|
|
);
|
|
|
|
},
|
2023-11-10 08:38:47 +00:00
|
|
|
),
|
2024-02-08 00:52:29 +00:00
|
|
|
SpeedDialChild(
|
|
|
|
child: const Icon(
|
|
|
|
Icons.upload,
|
|
|
|
color: primary,
|
|
|
|
),
|
|
|
|
label: 'Upload/Sync',
|
2024-03-21 05:47:57 +00:00
|
|
|
onTap: () {
|
2024-03-22 09:01:14 +00:00
|
|
|
context
|
|
|
|
.read<CrudBloc>()
|
|
|
|
.add(UploadBuildingFaas(offlineProfile: offlineProfile));
|
2024-03-21 05:47:57 +00:00
|
|
|
},
|
2024-02-08 00:52:29 +00:00
|
|
|
),
|
2023-11-10 08:38:47 +00:00
|
|
|
]),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-21 05:47:57 +00:00
|
|
|
Card _listCard(PropertyInfo property_info, context, index, deleteItem,
|
2024-07-11 01:27:35 +00:00
|
|
|
bldgLength, offlineProfile, triggerLoadLandFaas) {
|
2023-11-10 08:38:47 +00:00
|
|
|
return Card(
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
//set border radius more than 50% of height and width to make circle
|
|
|
|
),
|
|
|
|
margin: const EdgeInsets.all(5.0),
|
|
|
|
elevation: 5,
|
|
|
|
shadowColor: Colors.grey,
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(15.0),
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () async {
|
|
|
|
Navigator.push(context,
|
|
|
|
MaterialPageRoute(builder: (BuildContext context) {
|
|
|
|
return MultiBlocProvider(
|
|
|
|
providers: [
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => CrudBloc()..add(FetchTodos()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => MunicipalitiesAdminBloc()
|
|
|
|
..add(const LoadMunicipalities()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => BarangayAdminBloc()
|
|
|
|
..add(const LoadBarangayInMunicipality(cityCode: '01')),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => ClassComponentsAdminBloc()
|
|
|
|
..add(const LoadClassComponents()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => UnitConstructionAdminBloc()
|
|
|
|
..add(const LoadUnitConstruct()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) =>
|
|
|
|
SignatoriesAdminBloc()..add(const LoadSignatories()),
|
|
|
|
),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) =>
|
|
|
|
MemorandaAdminBloc()..add(const LoadMemoranda()),
|
|
|
|
),
|
2024-02-08 00:52:29 +00:00
|
|
|
BlocProvider(
|
|
|
|
create: (context) => BldgAppraisalOfflineBloc()
|
|
|
|
..add(FetchSingleBldgAppraisal(id: property_info.id!)),
|
|
|
|
),
|
2023-11-10 08:38:47 +00:00
|
|
|
BlocProvider(
|
|
|
|
create: (context) => LandrefLocationBloc()
|
|
|
|
..add(FetchSingleLandref(id: property_info.id!))),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => LocationBloc()
|
|
|
|
..add(FetchSingleLocation(id: property_info.id!))),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => GeneralDescriptionBloc()
|
|
|
|
..add(FetchSingleGeneralDescription(
|
|
|
|
id: property_info.id!))),
|
|
|
|
BlocProvider(
|
|
|
|
create: (context) => StructuralMaterialOfflineBloc()
|
|
|
|
..add(FetchSingleStructuralMaterial(
|
|
|
|
id: property_info.id!))),
|
2024-02-08 00:52:29 +00:00
|
|
|
BlocProvider(
|
|
|
|
create: (context) => BldgAssessmentOfflineBloc()
|
|
|
|
..add(FetchSingleBldgAssessment(id: property_info.id!))),
|
2023-11-10 08:38:47 +00:00
|
|
|
BlocProvider(
|
|
|
|
create: (context) => AdditionalItemsOfflineBloc()
|
|
|
|
..add(LoadAdditionalItemsEdit(
|
|
|
|
items: const <AdditionalItems>[],
|
|
|
|
id: property_info.id!))),
|
2024-03-21 05:47:57 +00:00
|
|
|
BlocProvider(
|
|
|
|
create: (context) => BuildingAndStructureBloc()
|
|
|
|
..add(LoadBuildingAndStructureEdit(
|
|
|
|
bldgAndStructure: const <BldgAndStructure>[],
|
|
|
|
id: property_info.id!))),
|
2023-11-10 08:38:47 +00:00
|
|
|
],
|
|
|
|
child: EditBuildingOffline(
|
2024-03-21 05:47:57 +00:00
|
|
|
index: index,
|
|
|
|
faas: property_info,
|
|
|
|
title: 'Bldg & Structure Edit',
|
2024-07-11 01:27:35 +00:00
|
|
|
offlineProfile: offlineProfile,
|
|
|
|
loadBldg: triggerLoadLandFaas),
|
2023-11-10 08:38:47 +00:00
|
|
|
);
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: 40, // Adjust this to your desired size
|
|
|
|
height: 40, // Adjust this to your desired size
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
border: Border.all(
|
|
|
|
color: primary, // Border color
|
2024-02-08 00:52:29 +00:00
|
|
|
width: 1, // Border width
|
2023-11-10 08:38:47 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
child: const Icon(
|
|
|
|
Icons.maps_home_work_rounded,
|
|
|
|
color: primary, // Icon color
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
width: 20,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
2024-03-21 05:47:57 +00:00
|
|
|
'${property_info.fname} ${property_info.mname} ${property_info.lname}',
|
2023-11-10 08:38:47 +00:00
|
|
|
style: const TextStyle(
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
),
|
|
|
|
SizedBox(height: 5),
|
|
|
|
Text(
|
2024-07-11 01:27:35 +00:00
|
|
|
'TDN: ${property_info.tdn}',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 13,
|
|
|
|
),
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
'Uploaded on: ${property_info.dateSynced == null ? '--' : property_info.dateSynced}',
|
2023-11-10 08:38:47 +00:00
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 13,
|
|
|
|
),
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
IconButton(
|
|
|
|
onPressed: () {
|
2024-02-08 00:52:29 +00:00
|
|
|
confirmAlertWithCancel(
|
|
|
|
context,
|
|
|
|
() => deleteItem(property_info.id),
|
|
|
|
() => null,
|
|
|
|
'Delete FAAS Item?',
|
|
|
|
"Are you sure you want to delete this item?");
|
2023-11-10 08:38:47 +00:00
|
|
|
},
|
|
|
|
icon: const Icon(Icons.delete_rounded),
|
|
|
|
color: primary,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|