|
|
|
@ -29,7 +29,7 @@ import 'package:test_sa/views/widgets/images/multi_image_picker_item.dart';
|
|
|
|
import 'package:test_sa/views/widgets/requests/request_status.dart';
|
|
|
|
import 'package:test_sa/views/widgets/requests/request_status.dart';
|
|
|
|
import '../../../new_views/common_widgets/app_filled_button.dart';
|
|
|
|
import '../../../new_views/common_widgets/app_filled_button.dart';
|
|
|
|
import '../../../new_views/common_widgets/default_app_bar.dart';
|
|
|
|
import '../../../new_views/common_widgets/default_app_bar.dart';
|
|
|
|
import 'asset_inventory_site_information_view.dart';
|
|
|
|
import 'asset_inventory_site_information_page.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class AssetInventoryFormView extends StatefulWidget {
|
|
|
|
class AssetInventoryFormView extends StatefulWidget {
|
|
|
|
static const String id = "/asset-inventory-form";
|
|
|
|
static const String id = "/asset-inventory-form";
|
|
|
|
@ -92,254 +92,255 @@ class _AssetInventoryFormViewState extends State<AssetInventoryFormView> {
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SingleChildScrollView(
|
|
|
|
SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
if (widget.sessionTypeValue == 1 || widget.sessionTypeValue == 2) ...[
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
'Not Registered'.addTranslation.heading5(context),
|
|
|
|
if (widget.sessionTypeValue == 1 || widget.sessionTypeValue == 2) ...[
|
|
|
|
AdvancedSwitch(
|
|
|
|
Row(
|
|
|
|
controller: registeredController,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
activeColor: AppColor.green50.withOpacity(0.5),
|
|
|
|
children: [
|
|
|
|
inactiveColor: AppColor.neutral10,
|
|
|
|
'Not Registered'.addTranslation.heading5(context),
|
|
|
|
thumb: CircleAvatar(backgroundColor: isRegistered == true ? AppColor.green50 : AppColor.neutral20),
|
|
|
|
AdvancedSwitch(
|
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(30)),
|
|
|
|
controller: registeredController,
|
|
|
|
width: 42.toScreenWidth,
|
|
|
|
activeColor: AppColor.green50.withOpacity(0.5),
|
|
|
|
height: 24.toScreenHeight,
|
|
|
|
inactiveColor: AppColor.neutral10,
|
|
|
|
onChanged: (value) {
|
|
|
|
thumb: CircleAvatar(backgroundColor: isRegistered == true ? AppColor.green50 : AppColor.neutral20),
|
|
|
|
isRegistered = value;
|
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(30)),
|
|
|
|
resetData();
|
|
|
|
width: 42.toScreenWidth,
|
|
|
|
setState(() {});
|
|
|
|
height: 24.toScreenHeight,
|
|
|
|
},
|
|
|
|
onChanged: (value) {
|
|
|
|
disabledOpacity: 1,
|
|
|
|
isRegistered = value;
|
|
|
|
),
|
|
|
|
resetData();
|
|
|
|
],
|
|
|
|
setState(() {});
|
|
|
|
),
|
|
|
|
},
|
|
|
|
16.height,
|
|
|
|
disabledOpacity: 1,
|
|
|
|
],
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
if ((!isRegistered && widget.sessionTypeValue == 1) || (widget.sessionTypeValue == 3) || (!isRegistered && widget.sessionTypeValue == 2)) ...[
|
|
|
|
),
|
|
|
|
AssetPicker(
|
|
|
|
12.height,
|
|
|
|
showLoading: false,
|
|
|
|
],
|
|
|
|
labelColor: AppColor.white936,
|
|
|
|
|
|
|
|
iconColor: AppColor.neutral120,
|
|
|
|
|
|
|
|
label: 'Scan Asset'.addTranslation,
|
|
|
|
|
|
|
|
borderColor: AppColor.white936,
|
|
|
|
|
|
|
|
buttonColor: Colors.white,
|
|
|
|
|
|
|
|
enablePickManually: false,
|
|
|
|
|
|
|
|
showAssetInfo: false,
|
|
|
|
|
|
|
|
showBorder: true,
|
|
|
|
|
|
|
|
onPick: (asset) async {
|
|
|
|
|
|
|
|
resetData();
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
if (asset.assetNumber != null) {
|
|
|
|
|
|
|
|
searchAsset(assetNo: asset.assetNumber!);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
|
|
|
labelText: context.translation.assetNo,
|
|
|
|
|
|
|
|
backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
controller: _assetNoController,
|
|
|
|
|
|
|
|
showShadow: false,
|
|
|
|
|
|
|
|
enable: false,
|
|
|
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (((!isRegistered && widget.sessionTypeValue == 2)))
|
|
|
|
if ((!isRegistered && widget.sessionTypeValue == 1) || (widget.sessionTypeValue == 3) || (!isRegistered && widget.sessionTypeValue == 2)) ...[
|
|
|
|
AppFilledButton(
|
|
|
|
AssetPicker(
|
|
|
|
label: 'Search Asset'.addTranslation,
|
|
|
|
showLoading: false,
|
|
|
|
onPressed: () async {
|
|
|
|
labelColor: AppColor.white936,
|
|
|
|
resetData(isScanned: false);
|
|
|
|
iconColor: AppColor.neutral120,
|
|
|
|
setState(() {});
|
|
|
|
label: 'Scan Asset'.addTranslation,
|
|
|
|
await Navigator.push(
|
|
|
|
borderColor: AppColor.white936,
|
|
|
|
context,
|
|
|
|
buttonColor: Colors.white,
|
|
|
|
MaterialPageRoute(
|
|
|
|
enablePickManually: false,
|
|
|
|
builder: (context) => SearchAssetView(
|
|
|
|
showAssetInfo: false,
|
|
|
|
sessionId: widget.assetInventoryModel?.sessionId ?? 0,
|
|
|
|
showBorder: true,
|
|
|
|
))).then((value) {
|
|
|
|
onPick: (asset) async {
|
|
|
|
if (value != null) {
|
|
|
|
resetData();
|
|
|
|
_pickedAssetModel = value;
|
|
|
|
setState(() {});
|
|
|
|
// _pickedAssetModel?.assetNumber = _scannedAssetModel?.assetNumber;
|
|
|
|
if (asset.assetNumber != null) {
|
|
|
|
// _pickedAssetModel?.assetId = _scannedAssetModel?.assetId;
|
|
|
|
searchAsset(assetNo: asset.assetNumber!);
|
|
|
|
// _pickedAssetModel?.status = _scannedAssetModel?.status;
|
|
|
|
}
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
|
|
|
labelText: context.translation.assetNo,
|
|
|
|
|
|
|
|
backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
controller: _assetNoController,
|
|
|
|
|
|
|
|
showShadow: false,
|
|
|
|
|
|
|
|
enable: false,
|
|
|
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
_scannedAssetModel = _scannedAssetModel?.mergeWith(_pickedAssetModel) ?? _pickedAssetModel;
|
|
|
|
if (((!isRegistered && widget.sessionTypeValue == 2))) ...[
|
|
|
|
|
|
|
|
AppFilledButton(
|
|
|
|
|
|
|
|
label: 'Search Asset'.addTranslation,
|
|
|
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
resetData(isScanned: false);
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
await Navigator.push(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
|
|
|
builder: (context) => SearchAssetView(
|
|
|
|
|
|
|
|
sessionId: widget.assetInventoryModel?.sessionId ?? 0,
|
|
|
|
|
|
|
|
))).then((value) {
|
|
|
|
|
|
|
|
if (value != null) {
|
|
|
|
|
|
|
|
_pickedAssetModel = value;
|
|
|
|
|
|
|
|
// _pickedAssetModel?.assetNumber = _scannedAssetModel?.assetNumber;
|
|
|
|
|
|
|
|
// _pickedAssetModel?.assetId = _scannedAssetModel?.assetId;
|
|
|
|
|
|
|
|
// _pickedAssetModel?.status = _scannedAssetModel?.status;
|
|
|
|
|
|
|
|
|
|
|
|
populateFormValues();
|
|
|
|
_scannedAssetModel = _scannedAssetModel?.mergeWith(_pickedAssetModel) ?? _pickedAssetModel;
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///Need to assign the values
|
|
|
|
populateFormValues();
|
|
|
|
});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
}
|
|
|
|
).paddingOnly(bottom: 12),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AppTextFormField(
|
|
|
|
///Need to assign the values
|
|
|
|
labelText: context.translation.serialNo,
|
|
|
|
});
|
|
|
|
backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
},
|
|
|
|
controller: _serialNoController,
|
|
|
|
),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
12.height,
|
|
|
|
showShadow: false,
|
|
|
|
],
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
AppTextFormField(
|
|
|
|
onChange: (value) {
|
|
|
|
labelText: context.translation.serialNo,
|
|
|
|
if (value != _scannedAssetModel?.serialNo) {
|
|
|
|
backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
_scannedAssetModel?.newSerialNo = value;
|
|
|
|
controller: _serialNoController,
|
|
|
|
// setState(() {});
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
}
|
|
|
|
showShadow: false,
|
|
|
|
},
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
onChange: (value) {
|
|
|
|
),
|
|
|
|
if (value != _scannedAssetModel?.serialNo) {
|
|
|
|
12.height,
|
|
|
|
_scannedAssetModel?.newSerialNo = value;
|
|
|
|
LookUpAutoCompleteField(
|
|
|
|
// setState(() {});
|
|
|
|
clearAfterPick: false,
|
|
|
|
}
|
|
|
|
forAssetName: true,
|
|
|
|
},
|
|
|
|
onChanged: (value) {
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
_scannedAssetModel?.newAssetNameId = null;
|
|
|
|
),
|
|
|
|
_scannedAssetModel?.newAssetNameText = value;
|
|
|
|
12.height,
|
|
|
|
},
|
|
|
|
LookUpAutoCompleteField(
|
|
|
|
initialValue: _scannedAssetModel?.assetName ?? "",
|
|
|
|
clearAfterPick: false,
|
|
|
|
label: 'Asset Name'.addTranslation,
|
|
|
|
forAssetName: true,
|
|
|
|
onPick: (value) {
|
|
|
|
onChanged: (value) {
|
|
|
|
_scannedAssetModel?.newAssetNameText = null;
|
|
|
|
_scannedAssetModel?.newAssetNameId = null;
|
|
|
|
_scannedAssetModel?.assetName = value.name;
|
|
|
|
_scannedAssetModel?.newAssetNameText = value;
|
|
|
|
_scannedAssetModel?.newAssetNameId = value.id;
|
|
|
|
},
|
|
|
|
setState(() {});
|
|
|
|
initialValue: _scannedAssetModel?.assetName ?? "",
|
|
|
|
},
|
|
|
|
label: 'Asset Name'.addTranslation,
|
|
|
|
),
|
|
|
|
onPick: (value) {
|
|
|
|
12.height,
|
|
|
|
_scannedAssetModel?.newAssetNameText = null;
|
|
|
|
//Asset Name..
|
|
|
|
_scannedAssetModel?.assetName = value.name;
|
|
|
|
LookUpAutoCompleteField(
|
|
|
|
_scannedAssetModel?.newAssetNameId = value.id;
|
|
|
|
clearAfterPick: false,
|
|
|
|
setState(() {});
|
|
|
|
isManufacturer: true,
|
|
|
|
},
|
|
|
|
initialValue: _scannedAssetModel?.manufacturer ?? "",
|
|
|
|
),
|
|
|
|
label: 'Manufacturer'.addTranslation,
|
|
|
|
12.height,
|
|
|
|
onChanged: (value) {
|
|
|
|
//Asset Name..
|
|
|
|
_scannedAssetModel?.newManufacturerId = null;
|
|
|
|
LookUpAutoCompleteField(
|
|
|
|
_scannedAssetModel?.newManufacturerName = value;
|
|
|
|
clearAfterPick: false,
|
|
|
|
},
|
|
|
|
isManufacturer: true,
|
|
|
|
onPick: (value) {
|
|
|
|
initialValue: _scannedAssetModel?.manufacturer ?? "",
|
|
|
|
_scannedAssetModel?.newManufacturerName = null;
|
|
|
|
label: 'Manufacturer'.addTranslation,
|
|
|
|
_scannedAssetModel?.manufacturer = value.name;
|
|
|
|
onChanged: (value) {
|
|
|
|
_scannedAssetModel?.newManufacturerId = value.id;
|
|
|
|
_scannedAssetModel?.newManufacturerId = null;
|
|
|
|
|
|
|
|
_scannedAssetModel?.newManufacturerName = value;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onPick: (value) {
|
|
|
|
|
|
|
|
_scannedAssetModel?.newManufacturerName = null;
|
|
|
|
|
|
|
|
_scannedAssetModel?.manufacturer = value.name;
|
|
|
|
|
|
|
|
_scannedAssetModel?.newManufacturerId = value.id;
|
|
|
|
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
12.height,
|
|
|
|
12.height,
|
|
|
|
LookUpAutoCompleteField(
|
|
|
|
LookUpAutoCompleteField(
|
|
|
|
clearAfterPick: false,
|
|
|
|
clearAfterPick: false,
|
|
|
|
isManufacturer: false,
|
|
|
|
isManufacturer: false,
|
|
|
|
initialValue: _scannedAssetModel?.model ?? "",
|
|
|
|
initialValue: _scannedAssetModel?.model ?? "",
|
|
|
|
label: 'Model'.addTranslation,
|
|
|
|
label: 'Model'.addTranslation,
|
|
|
|
onChanged: (value) {
|
|
|
|
onChanged: (value) {
|
|
|
|
_scannedAssetModel?.newModelId = null;
|
|
|
|
_scannedAssetModel?.newModelId = null;
|
|
|
|
_scannedAssetModel?.newModelName = value;
|
|
|
|
_scannedAssetModel?.newModelName = value;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onPick: (value) {
|
|
|
|
onPick: (value) {
|
|
|
|
_scannedAssetModel?.newModelName = null;
|
|
|
|
_scannedAssetModel?.newModelName = null;
|
|
|
|
_scannedAssetModel?.model = value.name;
|
|
|
|
_scannedAssetModel?.model = value.name;
|
|
|
|
_scannedAssetModel?.newModelId = value.id;
|
|
|
|
_scannedAssetModel?.newModelId = value.id;
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
|
|
|
|
LookUpAutoCompleteField(
|
|
|
|
LookUpAutoCompleteField(
|
|
|
|
clearAfterPick: false,
|
|
|
|
clearAfterPick: false,
|
|
|
|
forSupplier: true,
|
|
|
|
forSupplier: true,
|
|
|
|
initialValue: _scannedAssetModel?.supplierName ?? "",
|
|
|
|
initialValue: _scannedAssetModel?.supplierName ?? "",
|
|
|
|
label: context.translation.supplier,
|
|
|
|
label: context.translation.supplier,
|
|
|
|
onChanged: (value) {
|
|
|
|
onChanged: (value) {
|
|
|
|
_scannedAssetModel?.newSupplierId = null;
|
|
|
|
_scannedAssetModel?.newSupplierId = null;
|
|
|
|
_scannedAssetModel?.newSupplierName = value;
|
|
|
|
_scannedAssetModel?.newSupplierName = value;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onPick: (value) {
|
|
|
|
onPick: (value) {
|
|
|
|
_scannedAssetModel?.newSupplierName = null;
|
|
|
|
_scannedAssetModel?.newSupplierName = null;
|
|
|
|
_scannedAssetModel?.supplierName = value.name;
|
|
|
|
_scannedAssetModel?.supplierName = value.name;
|
|
|
|
_scannedAssetModel?.newSupplierId = value.id;
|
|
|
|
_scannedAssetModel?.newSupplierId = value.id;
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
// SingleItemDropDownMenu<SupplierDetails, VendorProvider>(
|
|
|
|
|
|
|
|
// context: context,
|
|
|
|
|
|
|
|
// title: context.translation.supplier,
|
|
|
|
|
|
|
|
// backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
|
|
|
|
// initialValue: _scannedAssetModel?.supplier,
|
|
|
|
|
|
|
|
// showAsBottomSheet: true,
|
|
|
|
|
|
|
|
// showShadow: false,
|
|
|
|
|
|
|
|
// showCancel: true,
|
|
|
|
|
|
|
|
// onSelect: (supplier) {
|
|
|
|
|
|
|
|
// _scannedAssetModel?.supplier = supplier;
|
|
|
|
|
|
|
|
// _scannedAssetModel?.newSupplierId = supplier?.id;
|
|
|
|
|
|
|
|
// _scannedAssetModel?.newSupplierName = supplier?.name;
|
|
|
|
|
|
|
|
// setState(() {});
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
siteInfoContainer(label: context.translation.site, value: _scannedAssetModel?.siteName ?? '-'),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
siteInfoContainer(label: context.translation.building, value: _scannedAssetModel?.buildingName ?? '-'),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
siteInfoContainer(label: context.translation.floor, value: _scannedAssetModel?.floorName ?? '-'),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
siteInfoContainer(label: context.translation.department, value: _scannedAssetModel?.departmentName ?? '-'),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
siteInfoContainer(label: context.translation.room, value: _scannedAssetModel?.roomName ?? '-'),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
if (_scannedAssetModel?.status != null && _scannedAssetModel!.status!.isNotEmpty) classificationWidget(label: _scannedAssetModel?.status),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'Asset Photo'.addTranslation,
|
|
|
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.white936),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
attachments.isEmpty
|
|
|
|
|
|
|
|
? AttachmentPicker(
|
|
|
|
|
|
|
|
label: context.translation.attachImage,
|
|
|
|
|
|
|
|
attachment: attachments,
|
|
|
|
|
|
|
|
buttonColor: AppColor.black10,
|
|
|
|
|
|
|
|
onlyImages: true,
|
|
|
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
buttonIcon: 'image-plus'.toSvgAsset(color: AppColor.neutral120),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
// SingleItemDropDownMenu<SupplierDetails, VendorProvider>(
|
|
|
|
: MultiFilesPickerItem(
|
|
|
|
// context: context,
|
|
|
|
file: File(attachments.first.name ?? ''),
|
|
|
|
// title: context.translation.supplier,
|
|
|
|
enabled: true,
|
|
|
|
// backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
onRemoveTap: (file) {
|
|
|
|
// initialValue: _scannedAssetModel?.supplier,
|
|
|
|
setState(() {
|
|
|
|
// showAsBottomSheet: true,
|
|
|
|
attachments.clear();
|
|
|
|
// showShadow: false,
|
|
|
|
});
|
|
|
|
// showCancel: true,
|
|
|
|
|
|
|
|
// onSelect: (supplier) {
|
|
|
|
|
|
|
|
// _scannedAssetModel?.supplier = supplier;
|
|
|
|
|
|
|
|
// _scannedAssetModel?.newSupplierId = supplier?.id;
|
|
|
|
|
|
|
|
// _scannedAssetModel?.newSupplierName = supplier?.name;
|
|
|
|
|
|
|
|
// setState(() {});
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
siteInfoContainer(label: context.translation.site, value: _scannedAssetModel?.siteName ?? '-'),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
siteInfoContainer(label: context.translation.building, value: _scannedAssetModel?.buildingName ?? '-'),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
siteInfoContainer(label: context.translation.floor, value: _scannedAssetModel?.floorName ?? '-'),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
siteInfoContainer(label: context.translation.department, value: _scannedAssetModel?.departmentName ?? '-'),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
siteInfoContainer(label: context.translation.room, value: _scannedAssetModel?.roomName ?? '-'),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
if (_scannedAssetModel?.status != null && _scannedAssetModel!.status!.isNotEmpty) classificationWidget(label: _scannedAssetModel?.status),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'Asset Photo'.addTranslation,
|
|
|
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.white936),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
attachments.isEmpty
|
|
|
|
|
|
|
|
? AttachmentPicker(
|
|
|
|
|
|
|
|
label: context.translation.attachImage,
|
|
|
|
|
|
|
|
attachment: attachments,
|
|
|
|
|
|
|
|
buttonColor: AppColor.black10,
|
|
|
|
|
|
|
|
onlyImages: true,
|
|
|
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
buttonIcon: 'image-plus'.toSvgAsset(color: AppColor.neutral120),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: MultiFilesPickerItem(
|
|
|
|
|
|
|
|
file: File(attachments.first.name ?? ''),
|
|
|
|
|
|
|
|
enabled: true,
|
|
|
|
|
|
|
|
onRemoveTap: (file) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
attachments.clear();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
|
|
|
backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
|
|
|
|
labelText: 'Remarks'.addTranslation,
|
|
|
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)),
|
|
|
|
|
|
|
|
alignLabelWithHint: true,
|
|
|
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
|
|
|
showShadow: false,
|
|
|
|
|
|
|
|
controller: _remarksController,
|
|
|
|
|
|
|
|
onSaved: (text) {
|
|
|
|
|
|
|
|
_scannedAssetModel?.remarks = text;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
12.height,
|
|
|
|
// 100.height,
|
|
|
|
AppTextFormField(
|
|
|
|
],
|
|
|
|
backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
).toShadowContainer(context, borderRadius: 20, padding: 12))
|
|
|
|
labelText: 'Remarks'.addTranslation,
|
|
|
|
.expanded,
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle.copyWith(color: AppColor.textColor(context)),
|
|
|
|
|
|
|
|
alignLabelWithHint: true,
|
|
|
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
|
|
|
showShadow: false,
|
|
|
|
|
|
|
|
controller: _remarksController,
|
|
|
|
|
|
|
|
onSaved: (text) {
|
|
|
|
|
|
|
|
_scannedAssetModel?.remarks = text;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
// 100.height,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).toShadowContainer(context).paddingOnly(top: 20, start: 16, end: 16),
|
|
|
|
|
|
|
|
).expanded,
|
|
|
|
|
|
|
|
10.height,
|
|
|
|
|
|
|
|
FooterActionButton.footerContainer(
|
|
|
|
FooterActionButton.footerContainer(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
child: AppFilledButton(buttonColor: AppColor.primary10, label: context.translation.submitRequest, maxWidth: true, onPressed: _onSubmit),
|
|
|
|
child: AppFilledButton(buttonColor: AppColor.primary10, label: context.translation.submitRequest, maxWidth: true, onPressed: _onSubmit),
|
|
|
|
@ -438,7 +439,7 @@ class _AssetInventoryFormViewState extends State<AssetInventoryFormView> {
|
|
|
|
Navigator.pushReplacement(
|
|
|
|
Navigator.pushReplacement(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (contxt) => SiteInformationView(
|
|
|
|
builder: (contxt) => SiteInformationPage(
|
|
|
|
sessionModel: SessionModel(id: int.tryParse(widget.assetInventoryModel?.sessionId?.toString() ?? '') ?? 0),
|
|
|
|
sessionModel: SessionModel(id: int.tryParse(widget.assetInventoryModel?.sessionId?.toString() ?? '') ?? 0),
|
|
|
|
)));
|
|
|
|
)));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|