From c1455378a62921c59336eb12ee11e6b9c7a6cb3c Mon Sep 17 00:00:00 2001 From: WaseemAbbasi22 Date: Mon, 10 Nov 2025 16:15:06 +0300 Subject: [PATCH 1/4] bug fixes and improvements --- assets/images/collesped_arrow_icon.svg | 3 + assets/images/expended_arrow_icon.svg | 3 + lib/controllers/api_routes/urls.dart | 1 + .../models/asset_inventory_model.dart | 50 ++++- .../pages/asset_detail_card_view.dart | 138 ++++++------- .../pages/asset_inventory_detail_view.dart | 195 ++++++++++++------ .../pages/asset_inventory_form_view.dart | 49 ++--- .../pages/asset_inventory_page.dart | 2 +- .../pages/inventory_session_item_view.dart | 12 -- pubspec.lock | 8 + pubspec.yaml | 1 + 11 files changed, 290 insertions(+), 172 deletions(-) create mode 100644 assets/images/collesped_arrow_icon.svg create mode 100644 assets/images/expended_arrow_icon.svg 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/controllers/api_routes/urls.dart b/lib/controllers/api_routes/urls.dart index 72f82b54..c2f40b8c 100644 --- a/lib/controllers/api_routes/urls.dart +++ b/lib/controllers/api_routes/urls.dart @@ -8,6 +8,7 @@ class URLs { // static const host1 = "https://atomsmuat.hmg.com"; // local UAT url static const host1 = "http://10.201.111.125:9495"; // temporary Server UAT url + // static String _baseUrl = "$_host/mobile"; // static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis static final String _baseUrl = "$_host/v4/mobile"; // for asset inventory on UAT 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..2bb74028 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,72 @@ 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.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..b9a3de09 100644 --- a/lib/modules/asset_inventory_module/pages/asset_inventory_page.dart +++ b/lib/modules/asset_inventory_module/pages/asset_inventory_page.dart @@ -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..51771032 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!), @@ -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!), 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: From 675c1fa10b8c0dc5ee7048e5cf65f42a5b8353c2 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Tue, 11 Nov 2025 09:12:17 +0300 Subject: [PATCH 2/4] for uat --- lib/controllers/api_routes/urls.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/controllers/api_routes/urls.dart b/lib/controllers/api_routes/urls.dart index c2f40b8c..2cc5fa8d 100644 --- a/lib/controllers/api_routes/urls.dart +++ b/lib/controllers/api_routes/urls.dart @@ -5,13 +5,13 @@ class URLs { // static const host1 = "https://atomsm.hmg.com"; // production url // static const host1 = "https://atomsmdev.hmg.com"; // local DEV url - // static const host1 = "https://atomsmuat.hmg.com"; // local UAT url - static const host1 = "http://10.201.111.125:9495"; // temporary Server UAT url + static const host1 = "https://atomsmuat.hmg.com"; // local UAT url + // static const host1 = "http://10.201.111.125:9495"; // temporary Server UAT url - // static String _baseUrl = "$_host/mobile"; + static String _baseUrl = "$_host/mobile"; // static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis - static final String _baseUrl = "$_host/v4/mobile"; // for asset inventory on UAT + // static final String _baseUrl = "$_host/v4/mobile"; // for asset inventory on UAT // static final String _baseUrl = "$_host/mobile"; // host local UAT // static final String _baseUrl = "$_host/v3/mobile"; // v3 for production CM,PM,TM // static final String _baseUrl = "$_host/v5/mobile"; // v5 for data segregation From 37ff2b4f4a0b0cb9f0bbd8f64ac8ecfd9862d36b Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 13 Nov 2025 14:57:44 +0300 Subject: [PATCH 3/4] APK to provided to FM with fixed tracker issues. --- lib/controllers/api_routes/urls.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/controllers/api_routes/urls.dart b/lib/controllers/api_routes/urls.dart index 2cc5fa8d..09ccf264 100644 --- a/lib/controllers/api_routes/urls.dart +++ b/lib/controllers/api_routes/urls.dart @@ -9,9 +9,9 @@ class URLs { // static const host1 = "http://10.201.111.125:9495"; // temporary Server UAT url - static String _baseUrl = "$_host/mobile"; + // static String _baseUrl = "$_host/mobile"; // static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis - // static final String _baseUrl = "$_host/v4/mobile"; // for asset inventory on UAT + static final String _baseUrl = "$_host/v4/mobile"; // for asset inventory on UAT // static final String _baseUrl = "$_host/mobile"; // host local UAT // static final String _baseUrl = "$_host/v3/mobile"; // v3 for production CM,PM,TM // static final String _baseUrl = "$_host/v5/mobile"; // v5 for data segregation From 659f2029dcddf377d7a9244932bf810d14e23971 Mon Sep 17 00:00:00 2001 From: WaseemAbbasi22 Date: Sun, 16 Nov 2025 11:19:10 +0300 Subject: [PATCH 4/4] label changes --- .../asset_inventory_module/pages/asset_detail_card_view.dart | 3 +++ .../asset_inventory_module/pages/asset_inventory_page.dart | 2 +- .../pages/inventory_session_item_view.dart | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) 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 2bb74028..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 @@ -45,6 +45,9 @@ class AssetDetailCardView extends StatelessWidget { 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 ?? '-'}', 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 b9a3de09..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); }, 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 51771032..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 @@ -41,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, @@ -82,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,