Merge branch 'wala_plus_with_dialog_removal' of http://34.17.182.140/Haroon6138/mohemm-flutter-app into wala_plus_with_dialog_removal

* 'wala_plus_with_dialog_removal' of http://34.17.182.140/Haroon6138/mohemm-flutter-app:
  chip set

# Conflicts:
#	lib/ui/landing/dashboard_screen_for_dependet.dart
wala_plus_with_dialog_removal
Sultan khan 4 weeks ago
commit 5a96d64d9c

@ -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 ser343622ver // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// 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"; //

@ -313,6 +313,11 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
String catParam = (isFavoriteOnly || targetCategoryId == "all" || targetCategoryId == "0") ? "" : targetCategoryId; String catParam = (isFavoriteOnly || targetCategoryId == "all" || targetCategoryId == "0") ? "" : targetCategoryId;
String? offerTypeParam = isFavoriteOnly ? null : OffersAndDiscountsApiClient.mapOfferTypeFilter(selectedTypeFilter); String? offerTypeParam = isFavoriteOnly ? null : OffersAndDiscountsApiClient.mapOfferTypeFilter(selectedTypeFilter);
String? queryParam = searchQuery.trim().isNotEmpty ? searchQuery.trim() : null; String? queryParam = searchQuery.trim().isNotEmpty ? searchQuery.trim() : null;
int? radiusParam = _radiusFromFilterDistance(_filterDistance);
int? minDiscountParam = _filterMinDiscount == 'any' ? null : int.tryParse(_filterMinDiscount);
print(
"Fetching WalaPlus retailers: category='$catParam', offerType='$offerTypeParam', query='$queryParam', sortBy='$_filterSortBy', radius=$radiusParam, minDiscount=$minDiscountParam, page=1, per_page=$pageSize",
);
int? radiusParam = isFavoriteOnly ? null : _radiusFromFilterDistance(_filterDistance); int? radiusParam = isFavoriteOnly ? null : _radiusFromFilterDistance(_filterDistance);
int? minDiscountParam = (isFavoriteOnly || _filterMinDiscount == 'any') ? null : int.tryParse(_filterMinDiscount); int? minDiscountParam = (isFavoriteOnly || _filterMinDiscount == 'any') ? null : int.tryParse(_filterMinDiscount);
String? userRef = isFavoriteOnly ? _getUserReferenceForFavorites() : null; String? userRef = isFavoriteOnly ? _getUserReferenceForFavorites() : null;
@ -605,10 +610,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
_changeLanguage(const Locale("ar", "SA")); _changeLanguage(const Locale("ar", "SA"));
} }
}, },
child: const Padding( child: const Padding(padding: EdgeInsets.all(3), child: Icon(Icons.language_rounded, size: 24, color: Color(0xFF1E293B))),
padding: EdgeInsets.all(3),
child: Icon(Icons.language_rounded, size: 24, color: Color(0xFF1E293B)),
),
), ),
); );
} }
@ -643,10 +645,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
_performLogout(); _performLogout();
} }
}, },
child: const Padding( child: const Padding(padding: EdgeInsets.symmetric(horizontal: 4, vertical: 8), child: Icon(Icons.arrow_back_ios_new_rounded, size: 20, color: Color(0xFF1E293B))),
padding: EdgeInsets.symmetric(horizontal: 4, vertical: 8),
child: Icon(Icons.arrow_back_ios_new_rounded, size: 20, color: Color(0xFF1E293B)),
),
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
], ],
@ -656,8 +655,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
Row( Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (ApiConsts.isDependetLogin) if (ApiConsts.isDependetLogin) _buildLanguageIconButton(isAr),
_buildLanguageIconButton(isAr),
if (!ApiConsts.isDependetLogin) ...[ if (!ApiConsts.isDependetLogin) ...[
const SizedBox(width: 4), const SizedBox(width: 4),
Tooltip( Tooltip(
@ -669,12 +667,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.all(3), padding: const EdgeInsets.all(3),
child: SvgPicture.asset( child: SvgPicture.asset('assets/icons/ic_dependents_top.svg', width: 24, height: 24, colorFilter: const ColorFilter.mode(Color(0xFF1E293B), BlendMode.srcIn)),
'assets/icons/ic_dependents_top.svg',
width: 24,
height: 24,
colorFilter: const ColorFilter.mode(Color(0xFF1E293B), BlendMode.srcIn),
),
), ),
), ),
), ),
@ -692,11 +685,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.all(3), padding: const EdgeInsets.all(3),
child: Icon( child: Icon(isFavoriteOnly ? Icons.favorite_rounded : Icons.favorite_border_rounded, size: 24, color: isFavoriteOnly ? Colors.black : const Color(0xFF1E293B)),
isFavoriteOnly ? Icons.favorite_rounded : Icons.favorite_border_rounded,
size: 24,
color: isFavoriteOnly ? Colors.black : const Color(0xFF1E293B),
),
), ),
), ),
), ),
@ -705,10 +694,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
InkWell( InkWell(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
onTap: _performLogout, onTap: _performLogout,
child: Padding( child: Padding(padding: const EdgeInsets.all(3), child: SvgPicture.asset('assets/images/drawer/logout.svg', height: 20, width: 20)),
padding: const EdgeInsets.all(3),
child: SvgPicture.asset('assets/images/drawer/logout.svg', height: 20, width: 20),
),
), ),
], ],
], ],
@ -951,8 +937,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemCount: 4, itemCount: 4,
separatorBuilder: (BuildContext _, int __) => const SizedBox(width: 8), separatorBuilder: (BuildContext _, int __) => const SizedBox(width: 8),
itemBuilder: itemBuilder: (BuildContext _, int __) => Container(width: 70, height: 32, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(6))),
(BuildContext _, int __) => Container(width: 70, height: 32, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(6))),
), ),
) )
: ListView.separated( : ListView.separated(
@ -1022,11 +1007,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
child: Container( child: Container(
height: 44, height: 44,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: isSelected ? darkBg : Colors.white, border: Border.all(color: isSelected ? darkBg : borderColor)),
borderRadius: BorderRadius.circular(8),
color: isSelected ? darkBg : Colors.white,
border: Border.all(color: isSelected ? darkBg : borderColor),
),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
@ -1043,10 +1024,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
Widget sectionHeader(String title, {String? hint}) { Widget sectionHeader(String title, {String? hint}) {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[title.toText14(isBold: true, color: darkBg), if (hint != null) hint.toText12(color: const Color(0xFF94A3B8))],
title.toText14(isBold: true, color: darkBg),
if (hint != null) hint.toText12(color: const Color(0xFF94A3B8)),
],
); );
} }
@ -1060,7 +1038,12 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Center( Center(
child: Container(width: 44, height: 4.5, margin: const EdgeInsets.only(bottom: 16), decoration: BoxDecoration(color: const Color(0xFFCBD5E1), borderRadius: BorderRadius.circular(2.5))), child: Container(
width: 44,
height: 4.5,
margin: const EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(color: const Color(0xFFCBD5E1), borderRadius: BorderRadius.circular(2.5)),
),
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -1445,12 +1428,18 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
children: <Widget>[ children: <Widget>[
// One Type Chip per distinct type - Online (green) and/or In Store (blue). // One Type Chip per distinct type - Online (green) and/or In Store (blue).
// Same pill styling (padding/border/icon size) as the retailer details screen.
for (String offerType in offerTypes) ...<Widget>[ for (String offerType in offerTypes) ...<Widget>[
InfoChipWidget( InfoChipWidget(
text: _getTypeFilterTitle(offerType), text: _getTypeFilterTitle(offerType),
icon: _getTypeFilterIcon(offerType), icon: _getTypeFilterIcon(offerType),
backgroundColor: offerType == 'online' ? const Color(0xFFE6F7F0) : const Color(0xFFEFF6FF), backgroundColor: offerType == 'online' ? const Color(0xFFE6F7F0) : const Color(0xFFEFF6FF),
textColor: offerType == 'online' ? const Color(0xFF00A651) : const Color(0xFF2563EB), textColor: offerType == 'online' ? const Color(0xFF00A651) : const Color(0xFF2563EB),
borderColor: offerType == 'online' ? const Color(0xFF00A651) : const Color(0xFF3B82F6),
horizontalPadding: 10,
verticalPadding: 5,
borderRadius: 12,
iconSize: 14,
), ),
const SizedBox(width: 5), const SizedBox(width: 5),
], ],
@ -1459,18 +1448,21 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
if (cityText.trim().isNotEmpty) ...<Widget>[ if (cityText.trim().isNotEmpty) ...<Widget>[
InfoChipWidget( InfoChipWidget(
text: cityText, text: cityText,
svgIcon: "assets/icons/location.svg", icon: Icons.location_on_outlined,
isBold: false, backgroundColor: const Color(0xFFF8FAFC),
backgroundColor: const Color(0xFFF3F4F6), textColor: const Color(0xFF475569),
textColor: const Color(0xFF4B5563), borderColor: const Color(0xFFCBD5E1),
iconColor: const Color(0xFF64748B), horizontalPadding: 10,
iconTextGap: 2.5, verticalPadding: 5,
borderRadius: 12,
iconSize: 14,
), ),
const SizedBox(width: 5), const SizedBox(width: 5),
], ],
// Usage badge // Usage badge
if (usageText.trim().isNotEmpty) InfoChipWidget(text: usageText, backgroundColor: const Color(0xFFFEF3C7), textColor: const Color(0xFFB45309)), if (usageText.trim().isNotEmpty)
InfoChipWidget(text: usageText, backgroundColor: const Color(0xFFFEF3C7), textColor: const Color(0xFFB45309), horizontalPadding: 10, verticalPadding: 5, borderRadius: 12),
], ],
), ),
), ),

Loading…
Cancel
Save