diff --git a/assets/images/collesped_arrow_icon.svg b/assets/images/collesped_arrow_icon.svg
new file mode 100644
index 00000000..7980fef7
--- /dev/null
+++ b/assets/images/collesped_arrow_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/expended_arrow_icon.svg b/assets/images/expended_arrow_icon.svg
new file mode 100644
index 00000000..c1085125
--- /dev/null
+++ b/assets/images/expended_arrow_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/lib/modules/asset_inventory_module/models/asset_inventory_model.dart b/lib/modules/asset_inventory_module/models/asset_inventory_model.dart
index 0b6796cb..4a4e6587 100644
--- a/lib/modules/asset_inventory_module/models/asset_inventory_model.dart
+++ b/lib/modules/asset_inventory_module/models/asset_inventory_model.dart
@@ -100,13 +100,13 @@ class AssetInventoryModel {
String? photo;
String? photoOriginName;
String? remarks;
-
Site? site;
Building? building;
Floor? floor;
Department? department;
Rooms? room;
SupplierDetails? supplier;
+ List assetInventoryDetailAssetAttachments = [];
AssetInventoryModel({
this.id,
@@ -160,6 +160,7 @@ class AssetInventoryModel {
this.floor,
this.room,
this.supplier,
+ this.assetInventoryDetailAssetAttachments = const [],
});
AssetInventoryModel.fromJson(Map json) {
@@ -194,6 +195,13 @@ class AssetInventoryModel {
photo = json['photo'];
photoOriginName = json['photoOriginName'];
remarks = json['remarks'];
+ if (json['assetTransferAttachments'] != null) {
+ assetInventoryDetailAssetAttachments = [];
+ json['assetInventoryDetailAssetAttachments'].forEach((v) {
+ assetInventoryDetailAssetAttachments.add(AssetInventoryDetailAssetAttachments.fromJson(v));
+ });
+ }
+
//new data..
// newAssetNumber = json['newAssetNumber'] ?? json['assetNumber'];
// manufacturerId = json['manufacturerId'] ?? json['manufacturerId'];
@@ -232,6 +240,9 @@ class AssetInventoryModel {
'newSupplierName': newSupplierName,
'photo': photo,
'remarks': remarks,
+ 'assetInventoryDetailAssetAttachments': assetInventoryDetailAssetAttachments != null
+ ? assetInventoryDetailAssetAttachments!.map((v) => v.toJson()).toList()
+ : [],
};
}
@@ -290,8 +301,45 @@ class AssetInventoryModel {
department: department ?? other.department,
room: room ?? other.room,
supplier: supplier ?? other.supplier,
+ assetInventoryDetailAssetAttachments: assetInventoryDetailAssetAttachments??other.assetInventoryDetailAssetAttachments,
);
}
}
+class AssetInventoryDetailAssetAttachments {
+ AssetInventoryDetailAssetAttachments({
+ this.id,
+ this.name,
+ this.originalName,
+ });
+
+ AssetInventoryDetailAssetAttachments.fromJson(dynamic json) {
+ id = json['id'];
+ name = json['name'];
+ originalName = json['originalName'];
+ }
+
+ num? id;
+ String? name;
+ String? originalName;
+
+ AssetInventoryDetailAssetAttachments copyWith({
+ num? id, // Parameter is now nullable
+ String? name, // Parameter is now nullable
+ String? originalName, // Parameter is now nullable
+ }) =>
+ AssetInventoryDetailAssetAttachments(
+ id: id ?? this.id,
+ name: name??this.name,
+ originalName: originalName??this.originalName,
+ );
+
+ Map toJson() {
+ final map = {};
+ map['id'] = id;
+ map['name'] = name;
+ map['originalName'] = originalName;
+ return map;
+ }
+}
diff --git a/lib/modules/asset_inventory_module/pages/asset_detail_card_view.dart b/lib/modules/asset_inventory_module/pages/asset_detail_card_view.dart
index c49a836f..9d128718 100644
--- a/lib/modules/asset_inventory_module/pages/asset_detail_card_view.dart
+++ b/lib/modules/asset_inventory_module/pages/asset_detail_card_view.dart
@@ -24,6 +24,7 @@ class AssetDetailCardView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
@@ -37,81 +38,75 @@ class AssetDetailCardView extends StatelessWidget {
],
),
8.height,
- Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- 'transaction Date: ${assetInventoryModel.transactionDate?.toServiceRequestDetailsFormat ?? '-'}',
- style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
- ),
- Text(
- '${context.translation.assetNumber}: ${assetInventoryModel.assetNumber ?? '-'}',
- style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
- ),
- Text(
- '${context.translation.serialNo}: ${assetInventoryModel.serialNo ?? '-'}',
- style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
- ),
- Text(
- '${context.translation.manufacture}: ${assetInventoryModel.manufacturer ?? ''}',
- style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
- ),
- Text(
- '${context.translation.model}: ${assetInventoryModel.model ?? ''}',
- style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
- ),
- Text(
- '${context.translation.site}: ${assetInventoryModel.siteName ?? ''}',
- style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
- ),
- Text(
- '${context.translation.building}: ${assetInventoryModel.buildingName ?? ''}',
- style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
- ),
- Text(
- '${context.translation.floor}: ${assetInventoryModel.floorName ?? ''}',
- style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
- ),
- Text(
- '${context.translation.department}: ${assetInventoryModel.departmentName ?? ''}',
- style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
- ),
- Text(
- '${context.translation.supplier}: ${assetInventoryModel.supplierName ?? ''}',
- style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
- ),
- Text(
- '${'Classifications'.addTranslation}: ${assetInventoryModel.status ?? ''}',
- style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
- ),
- Text(
- '${'Remarks'.addTranslation}: ${assetInventoryModel.remarks ?? ''}',
- style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
- ),
- ],
- ).expanded,
- Container(
- decoration: BoxDecoration(color: AppColor.neutral100, borderRadius: BorderRadius.circular(15)),
- height: 115.toScreenHeight,
- width: 115.toScreenWidth,
- margin: const EdgeInsets.only(top: 8),
- child: assetInventoryModel.photo != null && assetInventoryModel.photo!.isNotEmpty
- ? ClipRRect(
- borderRadius: BorderRadius.circular(8),
- child: ImageLoader(
- url: URLs.getFileUrl(assetInventoryModel.photo),
- boxFit: BoxFit.cover,
- height: 48,
- width: 48,
- ))
- : 'image_placeholder'.toSvgAsset().center,
- )
- ],
+ Text(
+ 'Inventory Date: ${assetInventoryModel.transactionDate?.toServiceRequestDetailsFormat ?? '-'}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
+ ),
+ Text(
+ '${context.translation.assetNumber}: ${assetInventoryModel.assetNumber ?? '-'}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
+ ), Text(
+ '${context.translation.assetName}: ${assetInventoryModel.assetName ?? '-'}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
+ ),
+ Text(
+ '${context.translation.serialNo}: ${assetInventoryModel.serialNo ?? '-'}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
+ ),
+ Text(
+ '${context.translation.manufacture}: ${assetInventoryModel.manufacturer ?? ''}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
+ ),
+ Text(
+ '${context.translation.model}: ${assetInventoryModel.model ?? ''}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
+ ),
+ Text(
+ '${context.translation.site}: ${assetInventoryModel.siteName ?? ''}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
+ ),
+ Text(
+ '${context.translation.building}: ${assetInventoryModel.buildingName ?? ''}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
+ ),
+ Text(
+ '${context.translation.floor}: ${assetInventoryModel.floorName ?? ''}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
+ ),
+ Text(
+ '${context.translation.department}: ${assetInventoryModel.departmentName ?? ''}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
+ ),
+ Text(
+ '${context.translation.supplier}: ${assetInventoryModel.supplierName ?? ''}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
+ ),
+ Text(
+ '${'Classifications'.addTranslation}: ${assetInventoryModel.status ?? ''}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
+ ),
+ Text(
+ '${'Remarks'.addTranslation}: ${assetInventoryModel.remarks ?? ''}',
+ style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
),
],
).toShadowContainer(context, borderRadius: 20, padding: 12);
}
}
+//TODO old code.
+// Container(
+// decoration: BoxDecoration(color: AppColor.neutral100, borderRadius: BorderRadius.circular(15)),
+// height: 115.toScreenHeight,
+// width: 115.toScreenWidth,
+// margin: const EdgeInsets.only(top: 8),
+// child: assetInventoryModel.photo != null && assetInventoryModel.photo!.isNotEmpty
+// ? ClipRRect(
+// borderRadius: BorderRadius.circular(8),
+// child: ImageLoader(
+// url: URLs.getFileUrl(assetInventoryModel.photo),
+// boxFit: BoxFit.cover,
+// height: 48,
+// width: 48,
+// ))
+// : 'image_placeholder'.toSvgAsset().center,
+// )
diff --git a/lib/modules/asset_inventory_module/pages/asset_inventory_detail_view.dart b/lib/modules/asset_inventory_module/pages/asset_inventory_detail_view.dart
index 5c826f56..9337013a 100644
--- a/lib/modules/asset_inventory_module/pages/asset_inventory_detail_view.dart
+++ b/lib/modules/asset_inventory_module/pages/asset_inventory_detail_view.dart
@@ -4,6 +4,7 @@ import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/string_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
+import 'package:test_sa/models/new_models/site.dart';
import 'package:test_sa/modules/asset_inventory_module/models/session_model.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/views/widgets/loaders/no_data_found.dart';
@@ -48,12 +49,15 @@ class _AssetInventoryDetailViewState extends State {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
+ //
StatusLabel(
label: sessionModel.statusName,
id: sessionModel.statusId,
radius: 4,
- textColor: AppColor.green15,
- backgroundColor: AppColor.greenStatus(context),
+ textColor: AppColor.getRequestStatusTextColorByName(context, sessionModel.statusName),
+ backgroundColor: AppColor.getRequestStatusColorByName(context, sessionModel.statusName),
+ // textColor: AppColor.green15,
+ // backgroundColor: AppColor.greenStatus(context),
),
Text(
sessionModel.createdDate!.toString().toServiceRequestCardFormat,
@@ -64,7 +68,7 @@ class _AssetInventoryDetailViewState extends State {
),
8.height,
Text(
- context.translation.requestDetails,
+ 'Session Details'.addTranslation,
style: AppTextStyles.heading4.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
),
8.height,
@@ -100,64 +104,139 @@ class _AssetInventoryDetailViewState extends State {
style: AppTextStyles.heading4.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
),
8.height,
- ListView.separated(
- physics: const NeverScrollableScrollPhysics(),
- shrinkWrap: true,
- padding: EdgeInsets.zero,
- itemCount: sites.length,
- itemBuilder: (cxt, siteIndex) {
- final site = sites[siteIndex];
- final buildingNames = (site.buildings ?? []).map((b) => b.name).where((name) => name != null && name!.trim().isNotEmpty).join(', ');
- final floorNames = (site.buildings ?? []).expand((b) => b.floors ?? []).map((f) => f.name).where((name) => name != null && name!.trim().isNotEmpty).join(', ');
- final departmentNames =
- (site.buildings ?? []).expand((b) => b.floors ?? []).expand((f) => f.departments ?? []).map((d) => d.name).where((name) => name != null && name!.trim().isNotEmpty).join(', ');
- final roomNames = (site.buildings ?? [])
- .expand((b) => b.floors ?? [])
- .expand((f) => f.departments ?? [])
- .expand((d) => d.rooms ?? [])
- .map((r) => r.name)
- .where((name) => name != null && name!.trim().isNotEmpty)
- .join(', ');
-
- return Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ SiteHierarchyView(
+ sites: sites,
+ ),
+ ],
+ ).toShadowContainer(context, padding: 12, borderRadius: 20);
+ }
+}
+
+
+
+class SiteHierarchyView extends StatelessWidget {
+ final List sites;
+
+ const SiteHierarchyView({super.key, required this.sites});
+
+ @override
+ Widget build(BuildContext context) {
+ return ListView.builder(
+ physics: const NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ itemCount: sites.length,
+ itemBuilder: (context, index) {
+ final site = sites[index];
+ return HierarchyTile(
+ title: site.name ?? '-',
+ children: (site.buildings ?? [])
+ .map((b) => HierarchyTile(
+ title: b.name ?? '-',
+ children: (b.floors ?? [])
+ .map((f) => HierarchyTile(
+ title: f.name ?? '-',
+ children: (f.departments ?? [])
+ .map((d) => HierarchyTile(
+ title: d.name ?? '-',
+ children: (d.rooms ?? [])
+ .map((r) => LeafTile(title: r.name ?? '-'))
+ .toList(),
+ ))
+ .toList(),
+ ))
+ .toList(),
+ ))
+ .toList(),
+ );
+ },
+ );
+ }
+}
+class HierarchyTile extends StatefulWidget {
+ final String title;
+ final List children;
+ final double indent;
+
+ const HierarchyTile({
+ super.key,
+ required this.title,
+ this.children = const [],
+ this.indent = 0,
+ });
+
+ @override
+ State createState() => _HierarchyTileState();
+}
+
+class _HierarchyTileState extends State {
+ bool expanded = false;
+
+ @override
+ Widget build(BuildContext context) {
+ final hasChildren = widget.children.isNotEmpty;
+ return Padding(
+ padding: EdgeInsets.only(left: widget.indent,top: 10.toScreenHeight),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: hasChildren ? () => setState(() => expanded = !expanded) : null,
+ child: Row(
children: [
+ if (hasChildren)
+ // expanded? 'expended_arrow_icon'.toSvgAsset(color: AppColor.neutral50,width: 8,height:13): 'collesped_arrow_icon'.toSvgAsset(color: AppColor.neutral50,width: 8,height:13)
+ Icon(
+ expanded ? Icons.expand_more : Icons.chevron_right,
+ size: 25.toScreenHeight,
+ color: AppColor.neutral50,
+ )
+ else
+ SizedBox(width: 18.toScreenWidth),
+ SizedBox(width: 15.toScreenWidth),
Text(
- site.name ?? '-',
- style: AppTextStyles.heading6.copyWith(
- color: context.isDark ? AppColor.neutral30 : AppColor.neutral50,
- ),
- ),
- Text(
- '${context.translation.building}: ${buildingNames.isNotEmpty ? buildingNames : '-'}',
- style: AppTextStyles.bodyText.copyWith(
- color: context.isDark ? AppColor.neutral10 : AppColor.neutral120,
- ),
- ),
- Text(
- '${context.translation.floor}: ${floorNames.isNotEmpty ? floorNames : '-'}',
- style: AppTextStyles.bodyText.copyWith(
- color: context.isDark ? AppColor.neutral10 : AppColor.neutral120,
- ),
- ),
- Text(
- '${context.translation.department}: ${departmentNames.isNotEmpty ? departmentNames : '-'}',
- style: AppTextStyles.bodyText.copyWith(
- color: context.isDark ? AppColor.neutral10 : AppColor.neutral120,
- ),
- ),
- Text(
- '${context.translation.room}: ${roomNames.isNotEmpty ? roomNames : '-'}',
- style: AppTextStyles.bodyText.copyWith(
- color: context.isDark ? AppColor.neutral10 : AppColor.neutral120,
- ),
+ widget.title,
+ style:AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50),
),
],
- );
- },
- separatorBuilder: (cxt, index) => const Divider().defaultStyle(context),
- ),
- ],
- ).toShadowContainer(context, padding: 12, borderRadius: 20);
+ ),
+ ),
+ if (expanded)
+ Padding(
+ padding: const EdgeInsets.only(left: 20, top: 6),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: widget.children
+ .map((child) => child is HierarchyTile
+ ? HierarchyTile(
+ title: (child).title,
+ indent: 0,
+ children: (child).children,
+ )
+ : child)
+ .toList(),
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+}
+class LeafTile extends StatelessWidget {
+ final String title;
+
+ const LeafTile({super.key, required this.title});
+
+ @override
+ Widget build(BuildContext context) {
+ return Padding(
+ padding: const EdgeInsets.only(left: 22, top: 4, bottom: 4),
+ child: Text(
+ title,
+ style: const TextStyle(fontSize: 13, color: Colors.black87),
+ ),
+ );
}
}
+
+
diff --git a/lib/modules/asset_inventory_module/pages/asset_inventory_form_view.dart b/lib/modules/asset_inventory_module/pages/asset_inventory_form_view.dart
index fd4bea7c..f6c2e0b2 100644
--- a/lib/modules/asset_inventory_module/pages/asset_inventory_form_view.dart
+++ b/lib/modules/asset_inventory_module/pages/asset_inventory_form_view.dart
@@ -294,30 +294,17 @@ class _AssetInventoryFormViewState extends State {
],
12.height,
Text(
- 'Asset Photo'.addTranslation,
+ 'Attachments'.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();
- });
- },
- ),
+ AttachmentPicker(
+ label: context.translation.attachFiles,
+ attachment: attachments,
+ buttonColor: AppColor.black10,
+ onlyImages: false,
+ buttonIcon: 'image-plus'.toSvgAsset(color: AppColor.neutral120),
+ ),
12.height,
AppTextFormField(
backgroundColor: AppColor.fieldBgColor(context),
@@ -338,7 +325,7 @@ class _AssetInventoryFormViewState extends State {
.expanded,
FooterActionButton.footerContainer(
context: context,
- child: AppFilledButton(buttonColor: AppColor.primary10, label: context.translation.submitRequest, maxWidth: true, onPressed: _onSubmit),
+ child: AppFilledButton(buttonColor: AppColor.primary10, label: 'Submit'.addTranslation, maxWidth: true, onPressed: _onSubmit),
),
],
),
@@ -348,7 +335,6 @@ class _AssetInventoryFormViewState extends State {
Future searchAsset({required String assetNo}) async {
AssetInventoryProvider provider = Provider.of(context, listen: false);
-
Map payload = {
"assetNumber": assetNo,
"sessionId": widget.assetInventoryModel?.sessionId,
@@ -415,11 +401,20 @@ class _AssetInventoryFormViewState extends State {
_scannedAssetModel?.departmentId = widget.assetInventoryModel?.department?.id;
_scannedAssetModel?.roomId = widget.assetInventoryModel?.room?.id;
_scannedAssetModel?.isNotRegistered = isRegistered;
- if (attachments.isNotEmpty) {
- String? photoName = attachments.first.name;
- String fileName = ServiceRequestUtils.isLocalUrl(photoName ?? '') ? ("${photoName ?? ''.split("/").last}|${base64Encode(File(photoName ?? '').readAsBytesSync())}") : photoName ?? '';
- _scannedAssetModel?.photo = fileName;
+ _scannedAssetModel?.assetInventoryDetailAssetAttachments = [];
+ // try {
+ for (var item in attachments) {
+ String fileName = ServiceRequestUtils.isLocalUrl(item.name ?? '') ? ("${item.name ?? ''.split("/").last}|${base64Encode(File(item.name ?? '').readAsBytesSync())}") : item.name ?? '';
+ _scannedAssetModel?.assetInventoryDetailAssetAttachments.add(AssetInventoryDetailAssetAttachments(id: item.id, name: fileName));
}
+ // // } catch (error) {
+ // // print(error);
+ // // }
+ // if (attachments.isNotEmpty) {
+ // String? photoName = attachments.first.name;
+ // String fileName = ServiceRequestUtils.isLocalUrl(photoName ?? '') ? ("${photoName ?? ''.split("/").last}|${base64Encode(File(photoName ?? '').readAsBytesSync())}") : photoName ?? '';
+ // _scannedAssetModel?.photo = fileName;
+ // }
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
assetInventoryProvider.saveAssetInSession(model: _scannedAssetModel).then((success) async {
///Need to use push and remove until...
diff --git a/lib/modules/asset_inventory_module/pages/asset_inventory_page.dart b/lib/modules/asset_inventory_module/pages/asset_inventory_page.dart
index 88e21b07..6240373c 100644
--- a/lib/modules/asset_inventory_module/pages/asset_inventory_page.dart
+++ b/lib/modules/asset_inventory_module/pages/asset_inventory_page.dart
@@ -58,7 +58,7 @@ class _AssetInventoryPageState extends State {
return Scaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: DefaultAppBar(
- title: 'Inventory Session Request'.addTranslation,
+ title: 'Asset Inventory Session'.addTranslation,
onBackPress: () {
Navigator.pop(context);
},
@@ -86,7 +86,7 @@ class _AssetInventoryPageState extends State {
indicator: BoxDecoration(color: context.isDark ? AppColor.neutral60 : AppColor.neutral110, borderRadius: BorderRadius.circular(7)),
onTap: (index) {},
tabs: [
- Tab(text: 'Request Details'.addTranslation, height: 57.toScreenHeight),
+ Tab(text: 'Session Details'.addTranslation, height: 57.toScreenHeight),
Tab(
text:
'${'Scan Assets'.addTranslation} ${provider.assetInventoryResponse?.totalRows != null && provider.assetInventoryResponse!.totalRows! > 0 ? '(${provider.assetInventoryResponse?.totalRows})' : ''}',
diff --git a/lib/modules/asset_inventory_module/pages/inventory_session_item_view.dart b/lib/modules/asset_inventory_module/pages/inventory_session_item_view.dart
index 8d9abfdd..12adb610 100644
--- a/lib/modules/asset_inventory_module/pages/inventory_session_item_view.dart
+++ b/lib/modules/asset_inventory_module/pages/inventory_session_item_view.dart
@@ -26,12 +26,6 @@ class InventorySessionItemView extends StatelessWidget {
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- StatusLabel(
- label: requestData!.priorityName!,
- textColor: AppColor.getRequestStatusTextColorByName(context, requestData!.priorityName!),
- backgroundColor: AppColor.getRequestStatusColorByName(context, requestData!.priorityName!),
- ),
- 8.width,
StatusLabel(
label: requestData!.statusName!,
textColor: AppColor.getRequestStatusTextColorByName(context, requestData!.statusName!),
@@ -47,7 +41,7 @@ class InventorySessionItemView extends StatelessWidget {
),
8.height,
(requestData?.typeTransaction ?? context.translation.taskRequest).heading5(context),
- infoWidget(label: context.translation.requestType, value: requestData?.sessionType, context: context),
+ infoWidget(label: 'Session Type'.addTranslation, value: requestData?.sessionType, context: context),
infoWidget(label: 'No of Assets'.addTranslation, value: requestData?.numberOfAssets != null ? requestData?.numberOfAssets.toString() : '-', context: context),
infoWidget(label: 'No of Sites'.addTranslation, value: requestData?.numberOfSites != null ? requestData?.numberOfSites.toString() : '-', context: context),
8.height,
@@ -73,12 +67,6 @@ class InventorySessionItemView extends StatelessWidget {
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- StatusLabel(
- label: requestDetails!.priority!,
- textColor: AppColor.getRequestStatusTextColorByName(context, requestDetails?.priority!),
- backgroundColor: AppColor.getRequestStatusColorByName(context, requestDetails?.priority!),
- ),
- 8.width,
StatusLabel(
label: requestDetails!.status!,
textColor: AppColor.getRequestStatusTextColorByName(context, requestDetails?.status!),
@@ -94,7 +82,7 @@ class InventorySessionItemView extends StatelessWidget {
),
8.height,
(requestDetails?.nameOfType ?? context.translation.taskRequest).heading5(context),
- infoWidget(label: context.translation.requestType, value: requestDetails?.sessionType, context: context),
+ infoWidget(label: 'Session Type'.addTranslation, value: requestDetails?.sessionType, context: context),
infoWidget(label: 'No of Assets'.addTranslation, value: requestDetails?.numberOfAssets != null ? requestDetails?.numberOfAssets.toString() : '-', context: context),
infoWidget(label: 'No of Sites'.addTranslation, value: requestDetails?.numberOfSites != null ? requestDetails?.numberOfSites.toString() : '-', context: context),
8.height,
diff --git a/pubspec.lock b/pubspec.lock
index fdc4903d..902236f8 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -1570,6 +1570,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.0"
+ tree_view_flutter:
+ dependency: "direct main"
+ description:
+ name: tree_view_flutter
+ sha256: "3365e29b7d1b1e6c5098a2a0e77a208a12a9345dfa73865cb4c87657cf387801"
+ url: "https://pub.dev"
+ source: hosted
+ version: "1.0.2"
typed_data:
dependency: transitive
description:
diff --git a/pubspec.yaml b/pubspec.yaml
index 70641f4d..e7584098 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -95,6 +95,7 @@ dependencies:
safe_device: ^1.2.1
toggle_switch: ^2.3.0
clipboard: ^2.0.2
+ tree_view_flutter: ^1.0.2
local_auth_darwin: any
dev_dependencies: