From c32b1557186af5e53633dc4fa3cdd04e7aa780dc Mon Sep 17 00:00:00 2001 From: Sultan khan Date: Sun, 1 Nov 2026 16:43:42 +0300 Subject: [PATCH] ui updates --- lib/app_state/app_state.dart | 8 + lib/classes/consts.dart | 4 +- lib/ui/chat/chat_home.dart | 4 +- lib/ui/mazaya/mazaya_discover_screen.dart | 90 +++++++++-- lib/ui/mazaya/retailer_details_screen.dart | 50 +++--- lib/ui/mazaya/retailers_list_screen.dart | 144 +++++++++++------- lib/ui/mazaya/saved_retailers_screen.dart | 2 +- .../widgets/wala_plus_retailer_grid.dart | 47 ++++-- lib/ui/profile/family_members.dart | 4 +- .../work_list/sheets/selected_item_sheet.dart | 12 +- 10 files changed, 247 insertions(+), 118 deletions(-) diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index c194d5b..35fb69a 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -7,6 +7,7 @@ import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/member_information_list_model.dart'; import 'package:mohem_flutter_app/models/member_login_list_model.dart'; import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart'; +import 'package:mohem_flutter_app/models/offers_and_discounts/wala_plus_city_model.dart'; import 'package:mohem_flutter_app/models/post_params_model.dart'; import 'package:mohem_flutter_app/models/privilege_list_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart'; @@ -140,6 +141,12 @@ class AppState { set setIsEmpLastLoginToDevice(bool? val) => _isEmpLastLoginToDevice = val; + WalaPlusCityModel? _selectedMazayaCity; + + WalaPlusCityModel? get selectedMazayaCity => _selectedMazayaCity; + + set setSelectedMazayaCity(WalaPlusCityModel? city) => _selectedMazayaCity = city; + void setPostParamsInitConfig() { isAuthenticated = false; isLogged = false; @@ -151,6 +158,7 @@ class AppState { _dependentDob = null; _authenticationTokenID = null; _isEmpLastLoginToDevice = null; + _selectedMazayaCity = null; _postParamsInitConfig.pLegislationCode = null; _postParams = _postParamsInitConfig; } diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 3c64cbb..e2d777b 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -4,12 +4,12 @@ class ApiConsts { // static String baseUrl = "http://10.201.214.101:2027"; // Local server // static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server - static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server + // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server // static String baseUrl = "http://10.201.204.101:2024"; // static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://hmgwebservices.com"; // Live server - // static String baseUrl = "https://mohemm.hmg.com"; // New Live server + static String baseUrl = "https://mohemm.hmg.com"; // New Live server static String ssoBaseUrl = "https://sso.hmg.com"; // New Live server // // static String baseUrl = "https://uat.hmgwebservices.com"; // diff --git a/lib/ui/chat/chat_home.dart b/lib/ui/chat/chat_home.dart index 7dc63ae..3a64357 100644 --- a/lib/ui/chat/chat_home.dart +++ b/lib/ui/chat/chat_home.dart @@ -27,14 +27,14 @@ class ChatHome extends StatefulWidget { class _ChatHomeState extends State { int tabIndex = 0; PageController controller = PageController(); - late ChatProviderModel data; + late ChatProviderModel data; @override void initState() { super.initState(); + data = Provider.of(context, listen: false); if (chatHubConnection?.state == HubConnectionState.Connected) { - data = Provider.of(context, listen: false); data.registerEvents(); } } diff --git a/lib/ui/mazaya/mazaya_discover_screen.dart b/lib/ui/mazaya/mazaya_discover_screen.dart index cfb9cfe..225a5f3 100644 --- a/lib/ui/mazaya/mazaya_discover_screen.dart +++ b/lib/ui/mazaya/mazaya_discover_screen.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:convert'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; @@ -65,7 +66,7 @@ class _MazayaDiscoverScreenState extends State { // Fixed-category sections - to point a section at a different category, change only the id // passed here. Everything else (fetch, title, UI) reads off the _MazayaCategorySection object. - final _MazayaCategorySection _travelSection = _MazayaCategorySection('Q4'); + final _MazayaCategorySection _travelSection = _MazayaCategorySection('p03'); final _MazayaCategorySection _homeKitchenSection = _MazayaCategorySection( 'Bw', ); @@ -73,11 +74,33 @@ class _MazayaDiscoverScreenState extends State { @override void initState() { super.initState(); + selectedCity = AppState().selectedMazayaCity; _fetchCategories(); _fetchExclusiveOffers(); - _fetchLatestOnMazaya(); - _fetchCategorySection(_travelSection); - _fetchCategorySection(_homeKitchenSection); + _initCityAndFetchSections(); + } + + Future _initCityAndFetchSections() async { + if (selectedCity == null) { + String savedCityJson = await Utils.getStringFromPrefs("MAZAYA_SELECTED_CITY"); + if (savedCityJson.isNotEmpty && mounted) { + try { + WalaPlusCityModel city = WalaPlusCityModel.fromJson(jsonDecode(savedCityJson)); + if (!city.isAllCities) { + AppState().setSelectedMazayaCity = city; + selectedCity = city; + if (mounted) setState(() {}); + } + } catch (e) { + debugPrint("Error restoring saved city: $e"); + } + } + } + if (mounted) { + _fetchLatestOnMazaya(); + _fetchCategorySection(_travelSection); + _fetchCategorySection(_homeKitchenSection); + } } @override @@ -185,9 +208,15 @@ class _MazayaDiscoverScreenState extends State { // embedded in each retailer (kept as a fallback for when the id isn't in the top-level list). // fallbackTitle only shows while neither source has resolved a name yet. String _sectionTitle(_MazayaCategorySection section, String fallbackTitle) { + bool isAr = mounted ? AppState().isArabic(context) : false; for (WalaPlusCategoryModel c in _categories) { - if (c.id == section.categoryId && (c.name ?? '').isNotEmpty) { - return c.name!; + if (c.id == section.categoryId) { + if (isAr && c.countryNameAr != null && c.countryNameAr!.trim().isNotEmpty) { + return c.countryNameAr!.trim(); + } + if ((c.name ?? '').isNotEmpty) { + return c.name!; + } } } if (section.resolvedName != null && section.resolvedName!.isNotEmpty) { @@ -261,8 +290,8 @@ class _MazayaDiscoverScreenState extends State { ); } - void _openRetailersGrid({WalaPlusCategoryModel? category}) { - Navigator.pushNamed( + Future _openRetailersGrid({WalaPlusCategoryModel? category}) async { + await Navigator.pushNamed( context, AppRoutes.retailersListScreen, // Carries the currently selected city along so RetailersListScreen starts on it instead @@ -272,13 +301,19 @@ class _MazayaDiscoverScreenState extends State { if (selectedCity != null) 'city': selectedCity, }, ); + if (mounted && selectedCity?.cityId != AppState().selectedMazayaCity?.cityId) { + setState(() => selectedCity = AppState().selectedMazayaCity); + _fetchLatestOnMazaya(); + _fetchCategorySection(_travelSection); + _fetchCategorySection(_homeKitchenSection); + } } // Exclusive offers reuse the legacy Offers & Discounts API (see fetchExclusiveOffers in both // this screen and RetailersListScreen), so "See all" opens RetailersListScreen's exclusive // mode instead of a WalaPlus category. - void _openExclusiveOffersGrid() { - Navigator.pushNamed( + Future _openExclusiveOffersGrid() async { + await Navigator.pushNamed( context, AppRoutes.retailersListScreen, arguments: { @@ -286,13 +321,19 @@ class _MazayaDiscoverScreenState extends State { if (selectedCity != null) 'city': selectedCity, }, ); + if (mounted && selectedCity?.cityId != AppState().selectedMazayaCity?.cityId) { + setState(() => selectedCity = AppState().selectedMazayaCity); + _fetchLatestOnMazaya(); + _fetchCategorySection(_travelSection); + _fetchCategorySection(_homeKitchenSection); + } } // Tapping the search field opens the same "all categories / newest" data as "Latest on // Mazaya"'s See all, but with the category hero hidden and the search bar auto-focused with // the keyboard open (see RetailersListScreen's isSearchMode) instead of landing on Travel. - void _openSearchGrid() { - Navigator.pushNamed( + Future _openSearchGrid() async { + await Navigator.pushNamed( context, AppRoutes.retailersListScreen, arguments: { @@ -304,6 +345,12 @@ class _MazayaDiscoverScreenState extends State { if (selectedCity != null) 'city': selectedCity, }, ); + if (mounted && selectedCity?.cityId != AppState().selectedMazayaCity?.cityId) { + setState(() => selectedCity = AppState().selectedMazayaCity); + _fetchLatestOnMazaya(); + _fetchCategorySection(_travelSection); + _fetchCategorySection(_homeKitchenSection); + } } Future _onRefresh() async { @@ -326,6 +373,7 @@ class _MazayaDiscoverScreenState extends State { await Utils.removeStringFromPrefs("P_DEP_MOBILE_NUMBER"); await Utils.removeStringFromPrefs("P_DEPENDENT_NAME"); await Utils.removeStringFromPrefs("P_DEP_LOGIN_TYPE"); + await Utils.removeStringFromPrefs("MAZAYA_SELECTED_CITY"); } // Same app bar actions as the previous dependent-login landing page @@ -349,6 +397,8 @@ class _MazayaDiscoverScreenState extends State { AppState().setDependentDob = null; AppState().setDependentLoginType = null; AppState().setWalaplusDepInfoModel = null; + AppState().setSelectedMazayaCity = null; + await Utils.removeStringFromPrefs("MAZAYA_SELECTED_CITY"); AppState().setPostParamsInitConfig(); if (mounted) { Navigator.pushNamedAndRemoveUntil( @@ -407,11 +457,11 @@ class _MazayaDiscoverScreenState extends State { appBar: AppBarWidget( context, title: LocaleKeys.mazayaDeals.tr(), - showHomeButton: false, + showHomeButton: true, // Discover is the dependent-login landing page - no back button there (logout is still // reachable via the explicit logout action below). Employees reaching Discover from the // regular dashboard can still pop back normally. - showBackButton: !ApiConsts.isDependetLogin, + showBackButton: false, onBackTapped: () { if (Navigator.canPop(context)) { Navigator.pop(context); @@ -587,7 +637,17 @@ class _MazayaDiscoverScreenState extends State { context, selectedCityId: selectedCity?.cityId, onCitySelected: (city) { - setState(() => selectedCity = city); + WalaPlusCityModel? newCity = city.isAllCities ? null : city; + AppState().setSelectedMazayaCity = newCity; + if (newCity != null) { + Utils.saveStringFromPrefs( + "MAZAYA_SELECTED_CITY", + jsonEncode(newCity.toJson()), + ); + } else { + Utils.removeStringFromPrefs("MAZAYA_SELECTED_CITY"); + } + setState(() => selectedCity = newCity); _fetchLatestOnMazaya(); _fetchCategorySection(_travelSection); _fetchCategorySection(_homeKitchenSection); diff --git a/lib/ui/mazaya/retailer_details_screen.dart b/lib/ui/mazaya/retailer_details_screen.dart index 2c0f286..9b44817 100644 --- a/lib/ui/mazaya/retailer_details_screen.dart +++ b/lib/ui/mazaya/retailer_details_screen.dart @@ -843,10 +843,11 @@ class _RetailerDetailsScreenState extends State { // 5. Locations Section (Preview Cards + View All) _buildLocationsSection(isAr), - // 6. Good to Know Section - _buildGoodToKnowSection(isAr), - - 20.height, + // 6. Good to Know & Terms and Conditions Section (standard Mazaya only) + if (_retailer?.isExclusive != true) ...[ + _buildGoodToKnowSection(isAr), + 20.height, + ], ], ), ), @@ -1459,6 +1460,9 @@ class _RetailerDetailsScreenState extends State { } Widget _buildGoodToKnowSection(bool isAr) { + if (_retailer?.isExclusive == true) { + return const SizedBox.shrink(); + } return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -1490,9 +1494,7 @@ class _RetailerDetailsScreenState extends State { const Divider(height: 1, thickness: 1, color: Color(0xFFE2E8F0)), 14.height, InkWell( - onTap: () { - // Terms & conditions link will be provided later - }, + onTap:_openMerchantWebsite, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -1511,23 +1513,23 @@ class _RetailerDetailsScreenState extends State { 14.height, const Divider(height: 1, thickness: 1, color: Color(0xFFE2E8F0)), 14.height, - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - LocaleKeys.haveAQuestionAboutOffer.tr().toText13( - color: const Color(0xFF64748B), - ), - InkWell( - onTap: () { - // Get help link will be provided later - }, - child: LocaleKeys.getHelp.tr().toText13( - color: const Color(0xFF0D9488), - isBold: true, - ), - ), - ], - ), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // LocaleKeys.haveAQuestionAboutOffer.tr().toText13( + // color: const Color(0xFF64748B), + // ), + // InkWell( + // onTap: () { + // // Get help link will be provided later + // }, + // child: LocaleKeys.getHelp.tr().toText13( + // color: const Color(0xFF0D9488), + // isBold: true, + // ), + // ), + // ], + // ), ], ); } diff --git a/lib/ui/mazaya/retailers_list_screen.dart b/lib/ui/mazaya/retailers_list_screen.dart index 8860c24..7cc266c 100644 --- a/lib/ui/mazaya/retailers_list_screen.dart +++ b/lib/ui/mazaya/retailers_list_screen.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:convert'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -130,6 +131,8 @@ class _RetailersListScreenState extends State { // resetting back to "All Cities" until the user explicitly changes it on this page. if (args is Map && args['city'] is WalaPlusCityModel) { selectedCity = args['city'] as WalaPlusCityModel; + } else if (AppState().selectedMazayaCity != null) { + selectedCity = AppState().selectedMazayaCity; } } } @@ -519,7 +522,10 @@ class _RetailersListScreenState extends State { sortBy: _filterSortBy, radius: radiusParam, minDiscount: minDiscountParam, - cityId: selectedCity?.cityId, + cityId: + (selectedCity != null && !selectedCity!.isAllCities) + ? selectedCity!.cityId + : null, context: wantsNearest ? context : null, userReference: null, ); @@ -588,7 +594,10 @@ class _RetailersListScreenState extends State { sortBy: _filterSortBy, radius: radiusParam, minDiscount: minDiscountParam, - cityId: selectedCity?.cityId, + cityId: + (selectedCity != null && !selectedCity!.isAllCities) + ? selectedCity!.cityId + : null, context: wantsNearest ? context : null, userReference: null, ); @@ -1039,6 +1048,7 @@ class _RetailersListScreenState extends State { isLoadingMore: isLoadingMore, onTapRetailer: _openRetailer, onFavoriteTap: _toggleFavorite, + mainAxisExtent: isExclusiveMode ? 190 : null, ), ], ), @@ -1494,7 +1504,17 @@ class _RetailersListScreenState extends State { context, selectedCityId: selectedCity?.cityId, onCitySelected: (city) { - setState(() => selectedCity = city); + WalaPlusCityModel? newCity = city.isAllCities ? null : city; + AppState().setSelectedMazayaCity = newCity; + if (newCity != null) { + Utils.saveStringFromPrefs( + "MAZAYA_SELECTED_CITY", + jsonEncode(newCity.toJson()), + ); + } else { + Utils.removeStringFromPrefs("MAZAYA_SELECTED_CITY"); + } + setState(() => selectedCity = newCity); String effectiveCategoryId = _selectedSubcategoryId ?? (currentCategoryId.isEmpty @@ -1946,6 +1966,10 @@ class WalaPlusRetailerCard extends StatelessWidget { if (cityText.trim().isEmpty) { cityText = item.displayCity; } + bool hasChips = + offerTypes.isNotEmpty || + cityText.trim().isNotEmpty || + usageText.trim().isNotEmpty; return InkWell( borderRadius: BorderRadius.circular(18), @@ -2092,64 +2116,66 @@ class WalaPlusRetailerCard extends StatelessWidget { isBold: true, color: const Color(0xFF147D6B), ), - const SizedBox(height: 6), - // Fully-rounded pill badges (no icon, no border) matching the new design - type - // chips in blue (In-store) / green (Online), city in grey. - SizedBox( - height: 28, - child: ListView( - scrollDirection: Axis.horizontal, - physics: const BouncingScrollPhysics(), - children: [ - for (String offerType in offerTypes) ...[ - InfoChipWidget( - text: getTypeFilterTitle(offerType), - backgroundColor: - offerType == 'online' - ? const Color(0xFFEAF3EE) - : const Color(0x14062CFF), - textColor: - offerType == 'online' - ? const Color(0xFF147D6B) - : const Color(0xFF2A56B6), - borderColor: Colors.transparent, - borderWidth: 0, - isBold: false, - horizontalPadding: 10, - verticalPadding: 6, - borderRadius: 99, - ), - const SizedBox(width: 5), - ], - if (cityText.trim().isNotEmpty) ...[ - InfoChipWidget( - text: cityText, - backgroundColor: const Color(0xFFEFF2EF), - textColor: const Color(0xFF464746), - borderColor: Colors.transparent, - borderWidth: 0, - isBold: false, - horizontalPadding: 10, - verticalPadding: 6, - borderRadius: 99, - ), - const SizedBox(width: 5), + if (hasChips) ...[ + const SizedBox(height: 6), + // Fully-rounded pill badges (no icon, no border) matching the new design - type + // chips in blue (In-store) / green (Online), city in grey. + SizedBox( + height: 28, + child: ListView( + scrollDirection: Axis.horizontal, + physics: const BouncingScrollPhysics(), + children: [ + for (String offerType in offerTypes) ...[ + InfoChipWidget( + text: getTypeFilterTitle(offerType), + backgroundColor: + offerType == 'online' + ? const Color(0xFFEAF3EE) + : const Color(0x14062CFF), + textColor: + offerType == 'online' + ? const Color(0xFF147D6B) + : const Color(0xFF2A56B6), + borderColor: Colors.transparent, + borderWidth: 0, + isBold: false, + horizontalPadding: 10, + verticalPadding: 6, + borderRadius: 99, + ), + const SizedBox(width: 5), + ], + if (cityText.trim().isNotEmpty) ...[ + InfoChipWidget( + text: cityText, + backgroundColor: const Color(0xFFEFF2EF), + textColor: const Color(0xFF464746), + borderColor: Colors.transparent, + borderWidth: 0, + isBold: false, + horizontalPadding: 10, + verticalPadding: 6, + borderRadius: 99, + ), + const SizedBox(width: 5), + ], + if (usageText.trim().isNotEmpty) + InfoChipWidget( + text: usageText, + backgroundColor: const Color(0xFFFEF3C7), + textColor: const Color(0xFFB45309), + borderColor: Colors.transparent, + borderWidth: 0, + isBold: false, + horizontalPadding: 10, + verticalPadding: 6, + borderRadius: 99, + ), ], - if (usageText.trim().isNotEmpty) - InfoChipWidget( - text: usageText, - backgroundColor: const Color(0xFFFEF3C7), - textColor: const Color(0xFFB45309), - borderColor: Colors.transparent, - borderWidth: 0, - isBold: false, - horizontalPadding: 10, - verticalPadding: 6, - borderRadius: 99, - ), - ], + ), ), - ), + ], ], ), ), diff --git a/lib/ui/mazaya/saved_retailers_screen.dart b/lib/ui/mazaya/saved_retailers_screen.dart index 63484cc..073b906 100644 --- a/lib/ui/mazaya/saved_retailers_screen.dart +++ b/lib/ui/mazaya/saved_retailers_screen.dart @@ -260,7 +260,7 @@ class _SavedRetailersScreenState extends State { showHomeButton: false, // Reached from the Mazaya bottom nav - same as Discover, no back button for a // dependent-login session since this is one of their root tabs, not a pushed screen. - showBackButton: !ApiConsts.isDependetLogin, + showBackButton: false, ), bottomNavigationBar: const MazayaBottomNav(currentTab: MazayaTab.saved), body: Column( diff --git a/lib/ui/mazaya/widgets/wala_plus_retailer_grid.dart b/lib/ui/mazaya/widgets/wala_plus_retailer_grid.dart index 1afe71a..a28a60e 100644 --- a/lib/ui/mazaya/widgets/wala_plus_retailer_grid.dart +++ b/lib/ui/mazaya/widgets/wala_plus_retailer_grid.dart @@ -16,6 +16,7 @@ class WalaPlusRetailerGrid extends StatelessWidget { final void Function(WalaPlusRetailerModel item) onFavoriteTap; final bool isLoadingMore; final int shimmerItemCount; + final double? mainAxisExtent; const WalaPlusRetailerGrid({ Key? key, @@ -26,10 +27,33 @@ class WalaPlusRetailerGrid extends StatelessWidget { required this.onFavoriteTap, this.isLoadingMore = false, this.shimmerItemCount = 4, + this.mainAxisExtent, }) : super(key: key); + bool get _hasAnyChips { + for (WalaPlusRetailerModel r in retailers) { + if (r.normalizedTypes.isNotEmpty || + r.displayCity.trim().isNotEmpty || + r.displayUsage.trim().isNotEmpty) { + return true; + } + } + return false; + } + + double get _effectiveMainAxisExtent { + if (mainAxisExtent != null) return mainAxisExtent!; + if (retailers.isNotEmpty && !_hasAnyChips) return 190; + return 235; + } + SliverGridDelegateWithFixedCrossAxisCount get _gridDelegate => - SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: isTablet ? 4 : 2, mainAxisExtent: 235, crossAxisSpacing: 12, mainAxisSpacing: 16); + SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: isTablet ? 4 : 2, + mainAxisExtent: _effectiveMainAxisExtent, + crossAxisSpacing: 12, + mainAxisSpacing: 16, + ); @override Widget build(BuildContext context) { @@ -71,25 +95,28 @@ class WalaPlusRetailerGrid extends StatelessWidget { } Widget _buildShimmerCard() { + bool showChips = _effectiveMainAxisExtent > 200; return Container( decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20)), padding: const EdgeInsets.all(10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container(height: 120, width: double.infinity, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(14))), + Container(height: 110, width: double.infinity, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(14))), const SizedBox(height: 8), Container(height: 14, width: 110, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))), const SizedBox(height: 6), Container(height: 14, width: 80, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))), - const SizedBox(height: 6), - Row( - children: [ - Container(height: 28, width: 50, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(6))), - const SizedBox(width: 5), - Container(height: 28, width: 45, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(6))), - ], - ), + if (showChips) ...[ + const SizedBox(height: 6), + Row( + children: [ + Container(height: 28, width: 50, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(6))), + const SizedBox(width: 5), + Container(height: 28, width: 45, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(6))), + ], + ), + ], ], ), ); diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart index 0ae9bab..f84f2cc 100644 --- a/lib/ui/profile/family_members.dart +++ b/lib/ui/profile/family_members.dart @@ -203,11 +203,11 @@ class _FamilyMembersState extends State { padding: const EdgeInsets.symmetric(horizontal: 16), child: Row( children: [ - InkWell( + !fromMazaya? InkWell( borderRadius: BorderRadius.circular(20), onTap: () => Navigator.pop(context), child: const Padding(padding: EdgeInsets.all(8.0), child: Icon(Icons.arrow_back_ios_new_rounded, size: 20, color: Color(0xFF1E293B))), - ), + ):SizedBox(), const SizedBox(width: 8), // Same title style as the other Mazaya tabs' headers (Discover/Saved use // AppBarWidget's title.toText24(isBold: true, color: MyColors.darkTextColor)) - diff --git a/lib/ui/work_list/sheets/selected_item_sheet.dart b/lib/ui/work_list/sheets/selected_item_sheet.dart index 9b98c8b..2a85fa4 100644 --- a/lib/ui/work_list/sheets/selected_item_sheet.dart +++ b/lib/ui/work_list/sheets/selected_item_sheet.dart @@ -212,13 +212,19 @@ class SelectedItemSheet extends StatelessWidget { var requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; if (apiMode == "Delegate") { await WorkListApiClient().delegateITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", - isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); + //commented the previous one because we need the replacement in both cases + favoriteReplacements !=null ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); + // isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); } else if (apiMode == "RequestInformation") { await WorkListApiClient().informationITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", - isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); + //commented the previous one because we need the replacement in both cases + // isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); + favoriteReplacements !=null ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); } else if (apiMode == "Answer") { await WorkListApiClient().answerITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", - isITGRequest ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); + //commented the previous one because we need the replacement in both cases + favoriteReplacements !=null ? favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); + //favoriteReplacements!.userName! : actionHistoryList!.uSERNAME!, comment); } Utils.hideLoading(context); Navigator.pop(context, "delegate_reload");