|
|
|
|
@ -53,10 +53,6 @@ class _AssetInventoryFormViewState extends State<AssetInventoryFormView> {
|
|
|
|
|
ValueNotifier<bool>? registeredController;
|
|
|
|
|
bool isRegistered = false;
|
|
|
|
|
|
|
|
|
|
// TextEditingController _assetModelController = TextEditingController();
|
|
|
|
|
// TextEditingController _assetManufacturerController = TextEditingController();
|
|
|
|
|
// TextEditingController _assetSupplierController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
final List<GenericAttachmentModel> attachments = [];
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -184,7 +180,6 @@ class _AssetInventoryFormViewState extends State<AssetInventoryFormView> {
|
|
|
|
|
labelText: context.translation.assetNo,
|
|
|
|
|
backgroundColor: AppColor.fieldBgColor(context),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
// controller: _assetNoController,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
enable: true,
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
@ -282,21 +277,7 @@ class _AssetInventoryFormViewState extends State<AssetInventoryFormView> {
|
|
|
|
|
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(() {});
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
if (!isRegistered) ...[
|
|
|
|
|
12.height,
|
|
|
|
|
siteInfoContainer(label: context.translation.site, value: _scannedAssetModel?.siteName ?? '-'),
|
|
|
|
|
12.height,
|
|
|
|
|
@ -308,6 +289,7 @@ class _AssetInventoryFormViewState extends State<AssetInventoryFormView> {
|
|
|
|
|
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(
|
|
|
|
|
@ -442,20 +424,12 @@ class _AssetInventoryFormViewState extends State<AssetInventoryFormView> {
|
|
|
|
|
///Need to use push and remove until...
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
if (success) {
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
/// need to confirm need to call this ...
|
|
|
|
|
AllRequestsProvider allRequestsProvider = Provider.of<AllRequestsProvider>(context, listen: false);
|
|
|
|
|
allRequestsProvider.reset();
|
|
|
|
|
allRequestsProvider.getAllRequests(context, typeTransaction: 8);
|
|
|
|
|
getAssetFilteredList();
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
// Navigator.pushReplacement(
|
|
|
|
|
// context,
|
|
|
|
|
// MaterialPageRoute(
|
|
|
|
|
// builder: (contxt) => SiteInformationPage(
|
|
|
|
|
// sessionModel: SessionModel(id: int.tryParse(widget.assetInventoryModel?.sessionId?.toString() ?? '') ?? 0),
|
|
|
|
|
// )));
|
|
|
|
|
} else {
|
|
|
|
|
log('api error...');
|
|
|
|
|
}
|
|
|
|
|
@ -474,7 +448,6 @@ class _AssetInventoryFormViewState extends State<AssetInventoryFormView> {
|
|
|
|
|
registeredController?.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> getAssetFilteredList({bool loadMore = false}) async {
|
|
|
|
|
AssetInventoryProvider provider = Provider.of<AssetInventoryProvider>(context, listen: false);
|
|
|
|
|
Map<String, dynamic> payload = {
|
|
|
|
|
|