chip color change

master
FaizHashmi 2 weeks ago
parent ecf1c7c948
commit d6fdcb214d

@ -292,10 +292,10 @@ class OffersAndDiscountsApiClient {
if (sortBy != null && sortBy.trim().isNotEmpty) {
postParams["WP_Sort_By"] = sortBy.trim();
}
// null (radius/minDiscount unset) means "Any"/"All" was selected - _cleanWalaPlusParams
// strips null entries below so the param is simply omitted from the request.
postParams["WP_Radius"] = radius;
postParams["WP_Min_Discount"] = minDiscount;
// Backend contract declares these as non-nullable int DataMembers, so "Any"/"All" (null
// here) must be sent as a concrete 0, not omitted.
postParams["WP_Radius"] = radius ?? 0;
postParams["WP_Min_Discount"] = minDiscount ?? 0;
if (geoLocation != null && geoLocation.isNotEmpty) {
postParams["WP_Geo_Location"] = geoLocation;
@ -318,6 +318,8 @@ class OffersAndDiscountsApiClient {
postParams["WP_User_Reference"] = null;
}
log("postParams: ${postParams.toString()}");
return await ApiClient().postJsonForObject(
(response) {
if (response != null) {
@ -352,12 +354,7 @@ class OffersAndDiscountsApiClient {
);
}
Future<WalaPlusRetailerModel?> getWalaPlusRetailerById({
required String retailerId,
BuildContext? context,
String? mobileNumber,
String? userReference,
}) async {
Future<WalaPlusRetailerModel?> getWalaPlusRetailerById({required String retailerId, BuildContext? context, String? mobileNumber, String? userReference}) async {
String url = ApiConsts.walaPlusRetailersByID;
String pUserName = _resolveUserName();
String pMobileNumber = _resolveMobileNumber(overrideMobile: mobileNumber);
@ -557,13 +554,7 @@ class OffersAndDiscountsApiClient {
);
}
Future<GenericResponseModel?> addWalaPlusFavorite({
Object? retailerId,
List<String>? retailerIds,
BuildContext? context,
String? mobileNumber,
String? userReference,
}) async {
Future<GenericResponseModel?> addWalaPlusFavorite({Object? retailerId, List<String>? retailerIds, BuildContext? context, String? mobileNumber, String? userReference}) async {
String url = ApiConsts.walaPlusFavoritesAdd;
String pUserName = _resolveUserName();
String pMobileNumber = _resolveMobileNumber(overrideMobile: mobileNumber);
@ -622,13 +613,7 @@ class OffersAndDiscountsApiClient {
);
}
Future<GenericResponseModel?> removeWalaPlusFavorite({
Object? retailerId,
List<String>? retailerIds,
BuildContext? context,
String? mobileNumber,
String? userReference,
}) async {
Future<GenericResponseModel?> removeWalaPlusFavorite({Object? retailerId, List<String>? retailerIds, BuildContext? context, String? mobileNumber, String? userReference}) async {
String url = ApiConsts.walaPlusFavoritesRemove;
String pUserName = _resolveUserName();
String pMobileNumber = _resolveMobileNumber(overrideMobile: mobileNumber);

@ -4,16 +4,16 @@ 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 ser343622ver
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"; //
// UAT ser343622ver
// UAT server
// static String baseUrl = "http://10.20.200.111:1010/";
// static String baseUrl = "https://mohemm.hmg.com"; // New Live server
//static String eLearningBaseUrl = "https://elearning.hmg.com/moodle_dev/api/"; // Elearning server UAT

@ -326,7 +326,10 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
sortBy: isFavoriteOnly ? null : _filterSortBy,
radius: radiusParam,
minDiscount: minDiscountParam,
context: (!isFavoriteOnly && wantsNearest) ? context : null,
// Same as getWalaPlusRetailerById: always pass context whenever we have one so
// WP_Geo_Location is attempted - don't gate it on wantsNearest, that only matters for
// whether we block the fetch to prompt for permission first (see the gate above).
context: isFavoriteOnly ? null : context,
userReference: userRef,
);
@ -386,7 +389,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
sortBy: isFavoriteOnly ? null : _filterSortBy,
radius: radiusParam,
minDiscount: minDiscountParam,
context: (!isFavoriteOnly && wantsNearest) ? context : null,
context: isFavoriteOnly ? null : context,
userReference: userRef,
);
@ -1002,12 +1005,16 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
child: Container(
height: 44,
alignment: Alignment.center,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: isSelected ? darkBg : Colors.white, border: Border.all(color: isSelected ? darkBg : borderColor)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: isSelected ? darkBg : MyColors.lightGreyEAColor,
border: Border.all(color: isSelected ? darkBg : MyColors.lightGreyEAColor),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (icon != null) ...<Widget>[Icon(icon, size: 14, color: isSelected ? Colors.white : const Color(0xFF64748B)), const SizedBox(width: 5)],
Flexible(child: label.toText13(isBold: true, color: isSelected ? Colors.white : darkBg, maxlines: 1)),
if (icon != null) ...<Widget>[Icon(icon, size: 14, color: isSelected ? Colors.white : MyColors.black), const SizedBox(width: 5)],
Flexible(child: label.toText13(isBold: true, color: isSelected ? Colors.white : MyColors.black, maxlines: 1)),
if (isSelected) ...<Widget>[const SizedBox(width: 5), const Icon(Icons.check, size: 14, color: Colors.white)],
],
),

Loading…
Cancel
Save