ui updates

wala_plus_with_dialog_removal
Sultan khan 2 days ago
parent f483c858ef
commit c32b155718

@ -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_information_list_model.dart';
import 'package:mohem_flutter_app/models/member_login_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/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/post_params_model.dart';
import 'package:mohem_flutter_app/models/privilege_list_model.dart'; import 'package:mohem_flutter_app/models/privilege_list_model.dart';
import 'package:mohem_flutter_app/models/worklist_response_model.dart'; import 'package:mohem_flutter_app/models/worklist_response_model.dart';
@ -140,6 +141,12 @@ class AppState {
set setIsEmpLastLoginToDevice(bool? val) => _isEmpLastLoginToDevice = val; set setIsEmpLastLoginToDevice(bool? val) => _isEmpLastLoginToDevice = val;
WalaPlusCityModel? _selectedMazayaCity;
WalaPlusCityModel? get selectedMazayaCity => _selectedMazayaCity;
set setSelectedMazayaCity(WalaPlusCityModel? city) => _selectedMazayaCity = city;
void setPostParamsInitConfig() { void setPostParamsInitConfig() {
isAuthenticated = false; isAuthenticated = false;
isLogged = false; isLogged = false;
@ -151,6 +158,7 @@ class AppState {
_dependentDob = null; _dependentDob = null;
_authenticationTokenID = null; _authenticationTokenID = null;
_isEmpLastLoginToDevice = null; _isEmpLastLoginToDevice = null;
_selectedMazayaCity = null;
_postParamsInitConfig.pLegislationCode = null; _postParamsInitConfig.pLegislationCode = null;
_postParams = _postParamsInitConfig; _postParams = _postParamsInitConfig;
} }

@ -4,12 +4,12 @@ class ApiConsts {
// static String baseUrl = "http://10.201.214.101:2027"; // Local server // 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://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 = "http://10.201.204.101:2024";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://hmgwebservices.com"; // Live server // 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 ssoBaseUrl = "https://sso.hmg.com"; // New Live server
// //
// static String baseUrl = "https://uat.hmgwebservices.com"; // // static String baseUrl = "https://uat.hmgwebservices.com"; //

@ -27,14 +27,14 @@ class ChatHome extends StatefulWidget {
class _ChatHomeState extends State<ChatHome> { class _ChatHomeState extends State<ChatHome> {
int tabIndex = 0; int tabIndex = 0;
PageController controller = PageController(); PageController controller = PageController();
late ChatProviderModel data; late ChatProviderModel data;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
data = Provider.of<ChatProviderModel>(context, listen: false);
if (chatHubConnection?.state == HubConnectionState.Connected) { if (chatHubConnection?.state == HubConnectionState.Connected) {
data = Provider.of<ChatProviderModel>(context, listen: false);
data.registerEvents(); data.registerEvents();
} }
} }

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -65,7 +66,7 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
// Fixed-category sections - to point a section at a different category, change only the id // 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. // 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( final _MazayaCategorySection _homeKitchenSection = _MazayaCategorySection(
'Bw', 'Bw',
); );
@ -73,11 +74,33 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
selectedCity = AppState().selectedMazayaCity;
_fetchCategories(); _fetchCategories();
_fetchExclusiveOffers(); _fetchExclusiveOffers();
_fetchLatestOnMazaya(); _initCityAndFetchSections();
_fetchCategorySection(_travelSection); }
_fetchCategorySection(_homeKitchenSection);
Future<void> _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 @override
@ -185,9 +208,15 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
// embedded in each retailer (kept as a fallback for when the id isn't in the top-level list). // 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. // fallbackTitle only shows while neither source has resolved a name yet.
String _sectionTitle(_MazayaCategorySection section, String fallbackTitle) { String _sectionTitle(_MazayaCategorySection section, String fallbackTitle) {
bool isAr = mounted ? AppState().isArabic(context) : false;
for (WalaPlusCategoryModel c in _categories) { for (WalaPlusCategoryModel c in _categories) {
if (c.id == section.categoryId && (c.name ?? '').isNotEmpty) { if (c.id == section.categoryId) {
return c.name!; 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) { if (section.resolvedName != null && section.resolvedName!.isNotEmpty) {
@ -261,8 +290,8 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
); );
} }
void _openRetailersGrid({WalaPlusCategoryModel? category}) { Future<void> _openRetailersGrid({WalaPlusCategoryModel? category}) async {
Navigator.pushNamed( await Navigator.pushNamed(
context, context,
AppRoutes.retailersListScreen, AppRoutes.retailersListScreen,
// Carries the currently selected city along so RetailersListScreen starts on it instead // Carries the currently selected city along so RetailersListScreen starts on it instead
@ -272,13 +301,19 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
if (selectedCity != null) 'city': selectedCity, 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 // Exclusive offers reuse the legacy Offers & Discounts API (see fetchExclusiveOffers in both
// this screen and RetailersListScreen), so "See all" opens RetailersListScreen's exclusive // this screen and RetailersListScreen), so "See all" opens RetailersListScreen's exclusive
// mode instead of a WalaPlus category. // mode instead of a WalaPlus category.
void _openExclusiveOffersGrid() { Future<void> _openExclusiveOffersGrid() async {
Navigator.pushNamed( await Navigator.pushNamed(
context, context,
AppRoutes.retailersListScreen, AppRoutes.retailersListScreen,
arguments: <String, dynamic>{ arguments: <String, dynamic>{
@ -286,13 +321,19 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
if (selectedCity != null) 'city': selectedCity, 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 // 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 // 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. // the keyboard open (see RetailersListScreen's isSearchMode) instead of landing on Travel.
void _openSearchGrid() { Future<void> _openSearchGrid() async {
Navigator.pushNamed( await Navigator.pushNamed(
context, context,
AppRoutes.retailersListScreen, AppRoutes.retailersListScreen,
arguments: <String, dynamic>{ arguments: <String, dynamic>{
@ -304,6 +345,12 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
if (selectedCity != null) 'city': selectedCity, if (selectedCity != null) 'city': selectedCity,
}, },
); );
if (mounted && selectedCity?.cityId != AppState().selectedMazayaCity?.cityId) {
setState(() => selectedCity = AppState().selectedMazayaCity);
_fetchLatestOnMazaya();
_fetchCategorySection(_travelSection);
_fetchCategorySection(_homeKitchenSection);
}
} }
Future<void> _onRefresh() async { Future<void> _onRefresh() async {
@ -326,6 +373,7 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
await Utils.removeStringFromPrefs("P_DEP_MOBILE_NUMBER"); await Utils.removeStringFromPrefs("P_DEP_MOBILE_NUMBER");
await Utils.removeStringFromPrefs("P_DEPENDENT_NAME"); await Utils.removeStringFromPrefs("P_DEPENDENT_NAME");
await Utils.removeStringFromPrefs("P_DEP_LOGIN_TYPE"); await Utils.removeStringFromPrefs("P_DEP_LOGIN_TYPE");
await Utils.removeStringFromPrefs("MAZAYA_SELECTED_CITY");
} }
// Same app bar actions as the previous dependent-login landing page // Same app bar actions as the previous dependent-login landing page
@ -349,6 +397,8 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
AppState().setDependentDob = null; AppState().setDependentDob = null;
AppState().setDependentLoginType = null; AppState().setDependentLoginType = null;
AppState().setWalaplusDepInfoModel = null; AppState().setWalaplusDepInfoModel = null;
AppState().setSelectedMazayaCity = null;
await Utils.removeStringFromPrefs("MAZAYA_SELECTED_CITY");
AppState().setPostParamsInitConfig(); AppState().setPostParamsInitConfig();
if (mounted) { if (mounted) {
Navigator.pushNamedAndRemoveUntil( Navigator.pushNamedAndRemoveUntil(
@ -407,11 +457,11 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
appBar: AppBarWidget( appBar: AppBarWidget(
context, context,
title: LocaleKeys.mazayaDeals.tr(), title: LocaleKeys.mazayaDeals.tr(),
showHomeButton: false, showHomeButton: true,
// Discover is the dependent-login landing page - no back button there (logout is still // 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 // reachable via the explicit logout action below). Employees reaching Discover from the
// regular dashboard can still pop back normally. // regular dashboard can still pop back normally.
showBackButton: !ApiConsts.isDependetLogin, showBackButton: false,
onBackTapped: () { onBackTapped: () {
if (Navigator.canPop(context)) { if (Navigator.canPop(context)) {
Navigator.pop(context); Navigator.pop(context);
@ -587,7 +637,17 @@ class _MazayaDiscoverScreenState extends State<MazayaDiscoverScreen> {
context, context,
selectedCityId: selectedCity?.cityId, selectedCityId: selectedCity?.cityId,
onCitySelected: (city) { 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(); _fetchLatestOnMazaya();
_fetchCategorySection(_travelSection); _fetchCategorySection(_travelSection);
_fetchCategorySection(_homeKitchenSection); _fetchCategorySection(_homeKitchenSection);

@ -843,10 +843,11 @@ class _RetailerDetailsScreenState extends State<RetailerDetailsScreen> {
// 5. Locations Section (Preview Cards + View All) // 5. Locations Section (Preview Cards + View All)
_buildLocationsSection(isAr), _buildLocationsSection(isAr),
// 6. Good to Know Section // 6. Good to Know & Terms and Conditions Section (standard Mazaya only)
_buildGoodToKnowSection(isAr), if (_retailer?.isExclusive != true) ...[
_buildGoodToKnowSection(isAr),
20.height, 20.height,
],
], ],
), ),
), ),
@ -1459,6 +1460,9 @@ class _RetailerDetailsScreenState extends State<RetailerDetailsScreen> {
} }
Widget _buildGoodToKnowSection(bool isAr) { Widget _buildGoodToKnowSection(bool isAr) {
if (_retailer?.isExclusive == true) {
return const SizedBox.shrink();
}
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -1490,9 +1494,7 @@ class _RetailerDetailsScreenState extends State<RetailerDetailsScreen> {
const Divider(height: 1, thickness: 1, color: Color(0xFFE2E8F0)), const Divider(height: 1, thickness: 1, color: Color(0xFFE2E8F0)),
14.height, 14.height,
InkWell( InkWell(
onTap: () { onTap:_openMerchantWebsite,
// Terms & conditions link will be provided later
},
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -1511,23 +1513,23 @@ class _RetailerDetailsScreenState extends State<RetailerDetailsScreen> {
14.height, 14.height,
const Divider(height: 1, thickness: 1, color: Color(0xFFE2E8F0)), const Divider(height: 1, thickness: 1, color: Color(0xFFE2E8F0)),
14.height, 14.height,
Row( // Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ // children: [
LocaleKeys.haveAQuestionAboutOffer.tr().toText13( // LocaleKeys.haveAQuestionAboutOffer.tr().toText13(
color: const Color(0xFF64748B), // color: const Color(0xFF64748B),
), // ),
InkWell( // InkWell(
onTap: () { // onTap: () {
// Get help link will be provided later // // Get help link will be provided later
}, // },
child: LocaleKeys.getHelp.tr().toText13( // child: LocaleKeys.getHelp.tr().toText13(
color: const Color(0xFF0D9488), // color: const Color(0xFF0D9488),
isBold: true, // isBold: true,
), // ),
), // ),
], // ],
), // ),
], ],
); );
} }

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -130,6 +131,8 @@ class _RetailersListScreenState extends State<RetailersListScreen> {
// resetting back to "All Cities" until the user explicitly changes it on this page. // resetting back to "All Cities" until the user explicitly changes it on this page.
if (args is Map && args['city'] is WalaPlusCityModel) { if (args is Map && args['city'] is WalaPlusCityModel) {
selectedCity = args['city'] as WalaPlusCityModel; selectedCity = args['city'] as WalaPlusCityModel;
} else if (AppState().selectedMazayaCity != null) {
selectedCity = AppState().selectedMazayaCity;
} }
} }
} }
@ -519,7 +522,10 @@ class _RetailersListScreenState extends State<RetailersListScreen> {
sortBy: _filterSortBy, sortBy: _filterSortBy,
radius: radiusParam, radius: radiusParam,
minDiscount: minDiscountParam, minDiscount: minDiscountParam,
cityId: selectedCity?.cityId, cityId:
(selectedCity != null && !selectedCity!.isAllCities)
? selectedCity!.cityId
: null,
context: wantsNearest ? context : null, context: wantsNearest ? context : null,
userReference: null, userReference: null,
); );
@ -588,7 +594,10 @@ class _RetailersListScreenState extends State<RetailersListScreen> {
sortBy: _filterSortBy, sortBy: _filterSortBy,
radius: radiusParam, radius: radiusParam,
minDiscount: minDiscountParam, minDiscount: minDiscountParam,
cityId: selectedCity?.cityId, cityId:
(selectedCity != null && !selectedCity!.isAllCities)
? selectedCity!.cityId
: null,
context: wantsNearest ? context : null, context: wantsNearest ? context : null,
userReference: null, userReference: null,
); );
@ -1039,6 +1048,7 @@ class _RetailersListScreenState extends State<RetailersListScreen> {
isLoadingMore: isLoadingMore, isLoadingMore: isLoadingMore,
onTapRetailer: _openRetailer, onTapRetailer: _openRetailer,
onFavoriteTap: _toggleFavorite, onFavoriteTap: _toggleFavorite,
mainAxisExtent: isExclusiveMode ? 190 : null,
), ),
], ],
), ),
@ -1494,7 +1504,17 @@ class _RetailersListScreenState extends State<RetailersListScreen> {
context, context,
selectedCityId: selectedCity?.cityId, selectedCityId: selectedCity?.cityId,
onCitySelected: (city) { 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 = String effectiveCategoryId =
_selectedSubcategoryId ?? _selectedSubcategoryId ??
(currentCategoryId.isEmpty (currentCategoryId.isEmpty
@ -1946,6 +1966,10 @@ class WalaPlusRetailerCard extends StatelessWidget {
if (cityText.trim().isEmpty) { if (cityText.trim().isEmpty) {
cityText = item.displayCity; cityText = item.displayCity;
} }
bool hasChips =
offerTypes.isNotEmpty ||
cityText.trim().isNotEmpty ||
usageText.trim().isNotEmpty;
return InkWell( return InkWell(
borderRadius: BorderRadius.circular(18), borderRadius: BorderRadius.circular(18),
@ -2092,64 +2116,66 @@ class WalaPlusRetailerCard extends StatelessWidget {
isBold: true, isBold: true,
color: const Color(0xFF147D6B), color: const Color(0xFF147D6B),
), ),
const SizedBox(height: 6), if (hasChips) ...<Widget>[
// Fully-rounded pill badges (no icon, no border) matching the new design - type const SizedBox(height: 6),
// chips in blue (In-store) / green (Online), city in grey. // Fully-rounded pill badges (no icon, no border) matching the new design - type
SizedBox( // chips in blue (In-store) / green (Online), city in grey.
height: 28, SizedBox(
child: ListView( height: 28,
scrollDirection: Axis.horizontal, child: ListView(
physics: const BouncingScrollPhysics(), scrollDirection: Axis.horizontal,
children: <Widget>[ physics: const BouncingScrollPhysics(),
for (String offerType in offerTypes) ...<Widget>[ children: <Widget>[
InfoChipWidget( for (String offerType in offerTypes) ...<Widget>[
text: getTypeFilterTitle(offerType), InfoChipWidget(
backgroundColor: text: getTypeFilterTitle(offerType),
offerType == 'online' backgroundColor:
? const Color(0xFFEAF3EE) offerType == 'online'
: const Color(0x14062CFF), ? const Color(0xFFEAF3EE)
textColor: : const Color(0x14062CFF),
offerType == 'online' textColor:
? const Color(0xFF147D6B) offerType == 'online'
: const Color(0xFF2A56B6), ? const Color(0xFF147D6B)
borderColor: Colors.transparent, : const Color(0xFF2A56B6),
borderWidth: 0, borderColor: Colors.transparent,
isBold: false, borderWidth: 0,
horizontalPadding: 10, isBold: false,
verticalPadding: 6, horizontalPadding: 10,
borderRadius: 99, verticalPadding: 6,
), borderRadius: 99,
const SizedBox(width: 5), ),
], const SizedBox(width: 5),
if (cityText.trim().isNotEmpty) ...<Widget>[ ],
InfoChipWidget( if (cityText.trim().isNotEmpty) ...<Widget>[
text: cityText, InfoChipWidget(
backgroundColor: const Color(0xFFEFF2EF), text: cityText,
textColor: const Color(0xFF464746), backgroundColor: const Color(0xFFEFF2EF),
borderColor: Colors.transparent, textColor: const Color(0xFF464746),
borderWidth: 0, borderColor: Colors.transparent,
isBold: false, borderWidth: 0,
horizontalPadding: 10, isBold: false,
verticalPadding: 6, horizontalPadding: 10,
borderRadius: 99, verticalPadding: 6,
), borderRadius: 99,
const SizedBox(width: 5), ),
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,
),
],
), ),
), ],
], ],
), ),
), ),

@ -260,7 +260,7 @@ class _SavedRetailersScreenState extends State<SavedRetailersScreen> {
showHomeButton: false, showHomeButton: false,
// Reached from the Mazaya bottom nav - same as Discover, no back button for a // 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. // 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), bottomNavigationBar: const MazayaBottomNav(currentTab: MazayaTab.saved),
body: Column( body: Column(

@ -16,6 +16,7 @@ class WalaPlusRetailerGrid extends StatelessWidget {
final void Function(WalaPlusRetailerModel item) onFavoriteTap; final void Function(WalaPlusRetailerModel item) onFavoriteTap;
final bool isLoadingMore; final bool isLoadingMore;
final int shimmerItemCount; final int shimmerItemCount;
final double? mainAxisExtent;
const WalaPlusRetailerGrid({ const WalaPlusRetailerGrid({
Key? key, Key? key,
@ -26,10 +27,33 @@ class WalaPlusRetailerGrid extends StatelessWidget {
required this.onFavoriteTap, required this.onFavoriteTap,
this.isLoadingMore = false, this.isLoadingMore = false,
this.shimmerItemCount = 4, this.shimmerItemCount = 4,
this.mainAxisExtent,
}) : super(key: key); }) : 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 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -71,25 +95,28 @@ class WalaPlusRetailerGrid extends StatelessWidget {
} }
Widget _buildShimmerCard() { Widget _buildShimmerCard() {
bool showChips = _effectiveMainAxisExtent > 200;
return Container( return Container(
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20)), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20)),
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
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), const SizedBox(height: 8),
Container(height: 14, width: 110, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))), Container(height: 14, width: 110, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))),
const SizedBox(height: 6), const SizedBox(height: 6),
Container(height: 14, width: 80, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))), Container(height: 14, width: 80, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))),
const SizedBox(height: 6), if (showChips) ...<Widget>[
Row( const SizedBox(height: 6),
children: <Widget>[ Row(
Container(height: 28, width: 50, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(6))), children: <Widget>[
const SizedBox(width: 5), Container(height: 28, width: 50, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(6))),
Container(height: 28, width: 45, 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))),
), ],
),
],
], ],
), ),
); );

@ -203,11 +203,11 @@ class _FamilyMembersState extends State<FamilyMembers> {
padding: const EdgeInsets.symmetric(horizontal: 16), padding: const EdgeInsets.symmetric(horizontal: 16),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
InkWell( !fromMazaya? InkWell(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
onTap: () => Navigator.pop(context), 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))), 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), const SizedBox(width: 8),
// Same title style as the other Mazaya tabs' headers (Discover/Saved use // Same title style as the other Mazaya tabs' headers (Discover/Saved use
// AppBarWidget's title.toText24(isBold: true, color: MyColors.darkTextColor)) - // AppBarWidget's title.toText24(isBold: true, color: MyColors.darkTextColor)) -

@ -212,13 +212,19 @@ class SelectedItemSheet extends StatelessWidget {
var requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!]; var requestDetails = AppState().requestAllList![AppState().itgWorkListIndex!];
if (apiMode == "Delegate") { if (apiMode == "Delegate") {
await WorkListApiClient().delegateITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", 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") { } else if (apiMode == "RequestInformation") {
await WorkListApiClient().informationITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", 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") { } else if (apiMode == "Answer") {
await WorkListApiClient().answerITGRequest(requestDetails.requestType!, requestDetails.iD, requestDetails.itemID, AppState().memberInformationList?.eMPLOYEENUMBER ?? "", 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); Utils.hideLoading(context);
Navigator.pop(context, "delegate_reload"); Navigator.pop(context, "delegate_reload");

Loading…
Cancel
Save