|
|
|
|
@ -14,6 +14,7 @@ import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/offers_and_discounts/wala_plus_category_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/offers_and_discounts/wala_plus_retailer_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/widgets/info_chip_widget.dart';
|
|
|
|
|
import 'package:shimmer/shimmer.dart';
|
|
|
|
|
|
|
|
|
|
class DashboardScreenForDependet extends StatefulWidget {
|
|
|
|
|
@ -105,17 +106,14 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
String dob = AppState().dependentDob ?? "";
|
|
|
|
|
String name = AppState().dependentName ?? "";
|
|
|
|
|
String mobile = AppState().postParamsObject?.mobileNumber ?? "";
|
|
|
|
|
String tokenID = (AppState().postParamsObject?.tokenID != null && AppState().postParamsObject!.tokenID!.isNotEmpty)
|
|
|
|
|
? AppState().postParamsObject!.tokenID!
|
|
|
|
|
: (AppState().authenticationTokenID ?? "");
|
|
|
|
|
String tokenID =
|
|
|
|
|
(AppState().postParamsObject?.tokenID != null && AppState().postParamsObject!.tokenID!.isNotEmpty) ? AppState().postParamsObject!.tokenID! : (AppState().authenticationTokenID ?? "");
|
|
|
|
|
if (tokenID.isEmpty) {
|
|
|
|
|
tokenID = await Utils.getStringFromPrefs("P_DEP_TOKEN_ID");
|
|
|
|
|
}
|
|
|
|
|
int sessionId = AppState().postParamsObject?.pSessionId ?? 0;
|
|
|
|
|
String email = AppState().postParamsObject?.pEmailAddress ?? "";
|
|
|
|
|
String deviceToken = AppState().getIsHuawei
|
|
|
|
|
? AppState().getHuaweiPushToken
|
|
|
|
|
: (AppState().getDeviceToken ?? "");
|
|
|
|
|
String deviceToken = AppState().getIsHuawei ? AppState().getHuaweiPushToken : (AppState().getDeviceToken ?? "");
|
|
|
|
|
|
|
|
|
|
await LoginApiClient().insertMobileLoginInfoDependent(
|
|
|
|
|
loginType: loginType,
|
|
|
|
|
@ -178,10 +176,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
List<WalaPlusCategoryModel> fullList = [];
|
|
|
|
|
bool hasAll = list.any((c) => (c.id == "all" || c.name?.toLowerCase() == "all" || c.name == "الجميع" || c.name == "الكل"));
|
|
|
|
|
if (!hasAll) {
|
|
|
|
|
fullList.add(WalaPlusCategoryModel(
|
|
|
|
|
id: "all",
|
|
|
|
|
name: LocaleKeys.allCategories.tr(),
|
|
|
|
|
));
|
|
|
|
|
fullList.add(WalaPlusCategoryModel(id: "all", name: LocaleKeys.allCategories.tr()));
|
|
|
|
|
}
|
|
|
|
|
fullList.addAll(list);
|
|
|
|
|
|
|
|
|
|
@ -201,10 +196,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
List<WalaPlusCategoryModel> fullList = [];
|
|
|
|
|
bool hasAll = retryList.any((c) => (c.id == "all" || c.name?.toLowerCase() == "all" || c.name == "الجميع" || c.name == "الكل"));
|
|
|
|
|
if (!hasAll) {
|
|
|
|
|
fullList.add(WalaPlusCategoryModel(
|
|
|
|
|
id: "all",
|
|
|
|
|
name: LocaleKeys.allCategories.tr(),
|
|
|
|
|
));
|
|
|
|
|
fullList.add(WalaPlusCategoryModel(id: "all", name: LocaleKeys.allCategories.tr()));
|
|
|
|
|
}
|
|
|
|
|
fullList.addAll(retryList);
|
|
|
|
|
setState(() {
|
|
|
|
|
@ -221,9 +213,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
|
|
|
|
|
if (mounted && categoriesList.isEmpty) {
|
|
|
|
|
setState(() {
|
|
|
|
|
categoriesList = [
|
|
|
|
|
WalaPlusCategoryModel(id: "all", name: LocaleKeys.allCategories.tr()),
|
|
|
|
|
];
|
|
|
|
|
categoriesList = [WalaPlusCategoryModel(id: "all", name: LocaleKeys.allCategories.tr())];
|
|
|
|
|
if (currentCategoryId.isEmpty) {
|
|
|
|
|
currentCategoryId = "all";
|
|
|
|
|
}
|
|
|
|
|
@ -322,10 +312,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> _onRefresh() async {
|
|
|
|
|
await Future.wait([
|
|
|
|
|
fetchCategories(),
|
|
|
|
|
fetchOffers(categoryId: currentCategoryId.isEmpty ? "all" : currentCategoryId),
|
|
|
|
|
]);
|
|
|
|
|
await Future.wait([fetchCategories(), fetchOffers(categoryId: currentCategoryId.isEmpty ? "all" : currentCategoryId)]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _runFilter([String? query]) {
|
|
|
|
|
@ -335,40 +322,36 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
List<WalaPlusRetailerModel> temp = retailersList;
|
|
|
|
|
|
|
|
|
|
if (selectedTypeFilter != "all" && selectedTypeFilter.isNotEmpty) {
|
|
|
|
|
temp = temp.where((WalaPlusRetailerModel item) {
|
|
|
|
|
String? norm = item.normalizedType;
|
|
|
|
|
if (selectedTypeFilter == "online") {
|
|
|
|
|
return norm == "online";
|
|
|
|
|
} else if (selectedTypeFilter == "instore") {
|
|
|
|
|
return norm == "instore";
|
|
|
|
|
} else {
|
|
|
|
|
return norm == selectedTypeFilter || (item.type?.trim().toLowerCase() == selectedTypeFilter);
|
|
|
|
|
}
|
|
|
|
|
}).toList();
|
|
|
|
|
temp =
|
|
|
|
|
temp.where((WalaPlusRetailerModel item) {
|
|
|
|
|
String? norm = item.normalizedType;
|
|
|
|
|
if (selectedTypeFilter == "online") {
|
|
|
|
|
return norm == "online";
|
|
|
|
|
} else if (selectedTypeFilter == "instore") {
|
|
|
|
|
return norm == "instore";
|
|
|
|
|
} else {
|
|
|
|
|
return norm == selectedTypeFilter || (item.type?.trim().toLowerCase() == selectedTypeFilter);
|
|
|
|
|
}
|
|
|
|
|
}).toList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (searchQuery.trim().isNotEmpty) {
|
|
|
|
|
String q = searchQuery.trim().toLowerCase();
|
|
|
|
|
temp = temp.where((WalaPlusRetailerModel item) {
|
|
|
|
|
String name = (item.name ?? "").toLowerCase();
|
|
|
|
|
String title = (item.offerTitle ?? "").toLowerCase();
|
|
|
|
|
String desc = (item.description ?? "").toLowerCase();
|
|
|
|
|
String city = item.displayCity.toLowerCase();
|
|
|
|
|
return name.contains(q) || title.contains(q) || desc.contains(q) || city.contains(q);
|
|
|
|
|
}).toList();
|
|
|
|
|
temp =
|
|
|
|
|
temp.where((WalaPlusRetailerModel item) {
|
|
|
|
|
String name = (item.name ?? "").toLowerCase();
|
|
|
|
|
String title = (item.offerTitle ?? "").toLowerCase();
|
|
|
|
|
String desc = (item.description ?? "").toLowerCase();
|
|
|
|
|
String city = item.displayCity.toLowerCase();
|
|
|
|
|
return name.contains(q) || title.contains(q) || desc.contains(q) || city.contains(q);
|
|
|
|
|
}).toList();
|
|
|
|
|
}
|
|
|
|
|
_filteredRetailersList = temp;
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void _openRetailer(WalaPlusRetailerModel item) {
|
|
|
|
|
Navigator.pushNamed(
|
|
|
|
|
context,
|
|
|
|
|
AppRoutes.walaPlusRetailerDetails,
|
|
|
|
|
arguments: item,
|
|
|
|
|
);
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.walaPlusRetailerDetails, arguments: item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _performLogout() {
|
|
|
|
|
@ -414,19 +397,11 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
},
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 8),
|
|
|
|
|
child: Icon(
|
|
|
|
|
isAr ? Icons.arrow_forward_ios_rounded : Icons.arrow_back_ios_new_rounded,
|
|
|
|
|
size: 20,
|
|
|
|
|
color: const Color(0xFF1E293B),
|
|
|
|
|
),
|
|
|
|
|
child: Icon(isAr ? Icons.arrow_forward_ios_rounded : Icons.arrow_back_ios_new_rounded, size: 20, color: const Color(0xFF1E293B)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
"assets/icons/mazaya_brand.svg",
|
|
|
|
|
height: 48,
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
),
|
|
|
|
|
SvgPicture.asset("assets/icons/mazaya_brand.svg", height: 48, fit: BoxFit.contain),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
@ -439,20 +414,13 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
width: 24,
|
|
|
|
|
height: 24,
|
|
|
|
|
color: const Color(0xFF1E293B),
|
|
|
|
|
errorBuilder: (context, error, stackTrace) => SvgPicture.asset(
|
|
|
|
|
'assets/icons/ic_dependents_top.svg',
|
|
|
|
|
width: 24,
|
|
|
|
|
height: 24,
|
|
|
|
|
colorFilter: const ColorFilter.mode(Color(0xFF1E293B), BlendMode.srcIn),
|
|
|
|
|
),
|
|
|
|
|
errorBuilder:
|
|
|
|
|
(context, error, stackTrace) =>
|
|
|
|
|
SvgPicture.asset('assets/icons/ic_dependents_top.svg', width: 24, height: 24, colorFilter: const ColorFilter.mode(Color(0xFF1E293B), BlendMode.srcIn)),
|
|
|
|
|
),
|
|
|
|
|
tooltip: LocaleKeys.addDependents.tr(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pushNamed(
|
|
|
|
|
context,
|
|
|
|
|
AppRoutes.familyMembers,
|
|
|
|
|
arguments: {'fromMazaya': true},
|
|
|
|
|
);
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.familyMembers, arguments: {'fromMazaya': true});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -490,10 +458,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
_buildBrowseCategoriesHeader(isAr),
|
|
|
|
|
|
|
|
|
|
// Categories Section
|
|
|
|
|
if (categoriesList.isNotEmpty)
|
|
|
|
|
_buildCategoriesList(isAr)
|
|
|
|
|
else
|
|
|
|
|
_buildCategoriesShimmer(),
|
|
|
|
|
if (categoriesList.isNotEmpty) _buildCategoriesList(isAr) else _buildCategoriesShimmer(),
|
|
|
|
|
|
|
|
|
|
// Type Filter Chips (All, In Store, Online)
|
|
|
|
|
_buildTypeFilterChips(isAr),
|
|
|
|
|
@ -507,12 +472,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
GridView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
|
crossAxisCount: 2,
|
|
|
|
|
childAspectRatio: 0.72,
|
|
|
|
|
crossAxisSpacing: 12,
|
|
|
|
|
mainAxisSpacing: 16,
|
|
|
|
|
),
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 0.85, crossAxisSpacing: 12, mainAxisSpacing: 16),
|
|
|
|
|
itemCount: _filteredRetailersList.length,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return _buildOfferCard(_filteredRetailersList[index], isAr);
|
|
|
|
|
@ -520,26 +480,10 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
),
|
|
|
|
|
if (isLoadingMore) ...[
|
|
|
|
|
16.height,
|
|
|
|
|
Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
"assets/images/logos/loading_mohemm_logo.gif",
|
|
|
|
|
height: 48.0,
|
|
|
|
|
width: 48.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Center(child: Padding(padding: const EdgeInsets.symmetric(vertical: 12), child: Image.asset("assets/images/logos/loading_mohemm_logo.gif", height: 48.0, width: 48.0))),
|
|
|
|
|
],
|
|
|
|
|
] else
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 40),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: LocaleKeys.noOffersAvailable.tr().toText14(
|
|
|
|
|
color: const Color(0xFF64748B),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(padding: const EdgeInsets.only(top: 40), child: Center(child: LocaleKeys.noOffersAvailable.tr().toText14(color: const Color(0xFF64748B)))),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -557,23 +501,13 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
color: const Color(0xFFFFFFFF),
|
|
|
|
|
borderRadius: BorderRadius.circular(16),
|
|
|
|
|
border: Border.all(color: const Color(0xFFE8E8E8), width: 1.0),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: const Color(0xFF000000).withOpacity(0.0314),
|
|
|
|
|
offset: const Offset(0, 2),
|
|
|
|
|
blurRadius: 5,
|
|
|
|
|
spreadRadius: 0,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
boxShadow: [BoxShadow(color: const Color(0xFF000000).withOpacity(0.0314), offset: const Offset(0, 2), blurRadius: 5, spreadRadius: 0)],
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.search.tr().toText12(
|
|
|
|
|
isBold: true,
|
|
|
|
|
color: const Color(0xFF2A333C),
|
|
|
|
|
),
|
|
|
|
|
LocaleKeys.search.tr().toText12(isBold: true, color: const Color(0xFF2A333C)),
|
|
|
|
|
const SizedBox(height: 2),
|
|
|
|
|
TextField(
|
|
|
|
|
controller: _searchController,
|
|
|
|
|
@ -582,19 +516,10 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
isDense: true,
|
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
|
hintText: LocaleKeys.searchItems.tr(),
|
|
|
|
|
hintStyle: const TextStyle(
|
|
|
|
|
color: Color(0xFFACAFB1),
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
height: 1.2,
|
|
|
|
|
),
|
|
|
|
|
hintStyle: const TextStyle(color: Color(0xFFACAFB1), fontSize: 14, fontWeight: FontWeight.w400, height: 1.2),
|
|
|
|
|
border: InputBorder.none,
|
|
|
|
|
),
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
color: Color(0xFF2A333C),
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
),
|
|
|
|
|
style: const TextStyle(color: Color(0xFF2A333C), fontSize: 14, fontWeight: FontWeight.w400),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -602,13 +527,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildBrowseCategoriesHeader(bool isAr) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 22, bottom: 14),
|
|
|
|
|
child: LocaleKeys.browseCategories.tr().toText18(
|
|
|
|
|
isBold: true,
|
|
|
|
|
color: const Color(0xFF1E293B),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
return Padding(padding: const EdgeInsets.only(top: 22, bottom: 14), child: LocaleKeys.browseCategories.tr().toText18(isBold: true, color: const Color(0xFF1E293B)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildCategoriesList(bool isAr) {
|
|
|
|
|
@ -623,8 +542,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
separatorBuilder: (_, __) => const SizedBox(width: 14),
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
WalaPlusCategoryModel item = categoriesList[index];
|
|
|
|
|
bool isSelected = (item.id == "all" && (currentCategoryId == "all" || currentCategoryId.isEmpty)) ||
|
|
|
|
|
(currentCategoryId.isNotEmpty && currentCategoryId == item.id);
|
|
|
|
|
bool isSelected = (item.id == "all" && (currentCategoryId == "all" || currentCategoryId.isEmpty)) || (currentCategoryId.isNotEmpty && currentCategoryId == item.id);
|
|
|
|
|
String title = (item.id == "all") ? LocaleKeys.allCategories.tr() : (item.name ?? "");
|
|
|
|
|
|
|
|
|
|
return InkWell(
|
|
|
|
|
@ -691,22 +609,13 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(6),
|
|
|
|
|
color: isSelected ? MyColors.darkIconColor : MyColors.lightGreyEAColor,
|
|
|
|
|
),
|
|
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(6), color: isSelected ? MyColors.darkIconColor : MyColors.lightGreyEAColor),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Icon(
|
|
|
|
|
icon,
|
|
|
|
|
size: 14,
|
|
|
|
|
color: isSelected ? MyColors.white : MyColors.black,
|
|
|
|
|
),
|
|
|
|
|
Icon(icon, size: 14, color: isSelected ? MyColors.white : MyColors.black),
|
|
|
|
|
const SizedBox(width: 5),
|
|
|
|
|
title.toText12(
|
|
|
|
|
color: isSelected ? MyColors.white : MyColors.black,
|
|
|
|
|
),
|
|
|
|
|
title.toText12(color: isSelected ? MyColors.white : MyColors.black),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -723,26 +632,14 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
const double borderWidthVal = 2.8;
|
|
|
|
|
const Color activeBorderColor = Color(0xFF00A86B);
|
|
|
|
|
|
|
|
|
|
bool isAll = (item.id == "all" ||
|
|
|
|
|
item.id == "0" ||
|
|
|
|
|
(item.name ?? "").toLowerCase() == "all" ||
|
|
|
|
|
item.name == "الجميع" ||
|
|
|
|
|
item.name == "الكل");
|
|
|
|
|
bool isAll = (item.id == "all" || item.id == "0" || (item.name ?? "").toLowerCase() == "all" || item.name == "الجميع" || item.name == "الكل");
|
|
|
|
|
|
|
|
|
|
Widget imageContent;
|
|
|
|
|
|
|
|
|
|
if (isAll) {
|
|
|
|
|
imageContent = Image.asset(
|
|
|
|
|
'assets/images/cat_all.png',
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
errorBuilder: (_, __, ___) => _getFallbackCategoryAsset(item),
|
|
|
|
|
);
|
|
|
|
|
imageContent = Image.asset('assets/images/cat_all.png', width: double.infinity, height: double.infinity, fit: BoxFit.cover, errorBuilder: (_, __, ___) => _getFallbackCategoryAsset(item));
|
|
|
|
|
} else {
|
|
|
|
|
String categoryImageUrl = item.categoryImageUrl.isNotEmpty
|
|
|
|
|
? item.categoryImageUrl
|
|
|
|
|
: (item.image?.trim() ?? "");
|
|
|
|
|
String categoryImageUrl = item.categoryImageUrl.isNotEmpty ? item.categoryImageUrl : (item.image?.trim() ?? "");
|
|
|
|
|
|
|
|
|
|
if (categoryImageUrl.isNotEmpty) {
|
|
|
|
|
if (categoryImageUrl.toLowerCase().endsWith('.svg') || item.isSvg) {
|
|
|
|
|
@ -751,22 +648,10 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
placeholderBuilder: (_) => const Center(
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: 20,
|
|
|
|
|
height: 20,
|
|
|
|
|
child: CircularProgressIndicator(strokeWidth: 2, color: Color(0xFF00A86B)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
placeholderBuilder: (_) => const Center(child: SizedBox(width: 20, height: 20, child: CircularProgressIndicator(strokeWidth: 2, color: Color(0xFF00A86B)))),
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
imageContent = Image.network(
|
|
|
|
|
categoryImageUrl,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
errorBuilder: (_, __, ___) => _getFallbackCategoryAsset(item),
|
|
|
|
|
);
|
|
|
|
|
imageContent = Image.network(categoryImageUrl, width: double.infinity, height: double.infinity, fit: BoxFit.cover, errorBuilder: (_, __, ___) => _getFallbackCategoryAsset(item));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
imageContent = _getFallbackCategoryAsset(item);
|
|
|
|
|
@ -779,19 +664,9 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.transparent,
|
|
|
|
|
borderRadius: BorderRadius.circular(borderRadiusVal),
|
|
|
|
|
border: isSelected
|
|
|
|
|
? Border.all(
|
|
|
|
|
color: activeBorderColor,
|
|
|
|
|
width: borderWidthVal,
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
),
|
|
|
|
|
child: ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
|
isSelected ? (borderRadiusVal - borderWidthVal) : borderRadiusVal,
|
|
|
|
|
),
|
|
|
|
|
child: imageContent,
|
|
|
|
|
border: isSelected ? Border.all(color: activeBorderColor, width: borderWidthVal) : null,
|
|
|
|
|
),
|
|
|
|
|
child: ClipRRect(borderRadius: BorderRadius.circular(isSelected ? (borderRadiusVal - borderWidthVal) : borderRadiusVal), child: imageContent),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -799,59 +674,20 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
String name = (item.name ?? "").toLowerCase();
|
|
|
|
|
|
|
|
|
|
if (item.id == "all" || item.id == "0" || name == "all" || name == "الكل" || name == "الجميع") {
|
|
|
|
|
return Image.asset(
|
|
|
|
|
'assets/images/cat_all.png',
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
errorBuilder: (_, __, ___) => _buildFallbackCategoryIconWidget(item),
|
|
|
|
|
);
|
|
|
|
|
return Image.asset('assets/images/cat_all.png', width: double.infinity, height: double.infinity, fit: BoxFit.cover, errorBuilder: (_, __, ___) => _buildFallbackCategoryIconWidget(item));
|
|
|
|
|
} else if (name.contains("shop") || name.contains("retail") || name.contains("تسوق") || name.contains("تجزئة")) {
|
|
|
|
|
return Image.asset(
|
|
|
|
|
'assets/images/cat_retail.png',
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
errorBuilder: (_, __, ___) => _buildFallbackCategoryIconWidget(item),
|
|
|
|
|
);
|
|
|
|
|
} else if (name.contains("food") ||
|
|
|
|
|
name.contains("restaurant") ||
|
|
|
|
|
name.contains("مطاعم") ||
|
|
|
|
|
name.contains("أغذية") ||
|
|
|
|
|
name.contains("cafe") ||
|
|
|
|
|
name.contains("مقهى")) {
|
|
|
|
|
return Image.asset(
|
|
|
|
|
'assets/images/cat_food.png',
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
errorBuilder: (_, __, ___) => _buildFallbackCategoryIconWidget(item),
|
|
|
|
|
);
|
|
|
|
|
} else if (name.contains("fitness") ||
|
|
|
|
|
name.contains("wellness") ||
|
|
|
|
|
name.contains("sport") ||
|
|
|
|
|
name.contains("gym") ||
|
|
|
|
|
name.contains("رياضة") ||
|
|
|
|
|
name.contains("لياقة") ||
|
|
|
|
|
name.contains("صحة")) {
|
|
|
|
|
return Image.asset(
|
|
|
|
|
'assets/images/cat_fitness.png',
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
errorBuilder: (_, __, ___) => _buildFallbackCategoryIconWidget(item),
|
|
|
|
|
);
|
|
|
|
|
return Image.asset('assets/images/cat_retail.png', width: double.infinity, height: double.infinity, fit: BoxFit.cover, errorBuilder: (_, __, ___) => _buildFallbackCategoryIconWidget(item));
|
|
|
|
|
} else if (name.contains("food") || name.contains("restaurant") || name.contains("مطاعم") || name.contains("أغذية") || name.contains("cafe") || name.contains("مقهى")) {
|
|
|
|
|
return Image.asset('assets/images/cat_food.png', width: double.infinity, height: double.infinity, fit: BoxFit.cover, errorBuilder: (_, __, ___) => _buildFallbackCategoryIconWidget(item));
|
|
|
|
|
} else if (name.contains("fitness") || name.contains("wellness") || name.contains("sport") || name.contains("gym") || name.contains("رياضة") || name.contains("لياقة") || name.contains("صحة")) {
|
|
|
|
|
return Image.asset('assets/images/cat_fitness.png', width: double.infinity, height: double.infinity, fit: BoxFit.cover, errorBuilder: (_, __, ___) => _buildFallbackCategoryIconWidget(item));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _buildFallbackCategoryIconWidget(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildFallbackCategoryIconWidget(WalaPlusCategoryModel item) {
|
|
|
|
|
return Container(
|
|
|
|
|
color: Colors.transparent,
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: _getFallbackCategoryIcon(item, const Color(0xFF168A89)),
|
|
|
|
|
);
|
|
|
|
|
return Container(color: Colors.transparent, alignment: Alignment.center, child: _getFallbackCategoryIcon(item, const Color(0xFF168A89)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _getFallbackCategoryIcon(WalaPlusCategoryModel item, Color iconColor) {
|
|
|
|
|
@ -885,11 +721,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
iconData = Icons.home_rounded;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Icon(
|
|
|
|
|
iconData,
|
|
|
|
|
color: color,
|
|
|
|
|
size: 26,
|
|
|
|
|
);
|
|
|
|
|
return Icon(iconData, color: color, size: 26);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String _getDiscountBadge(WalaPlusRetailerModel item) {
|
|
|
|
|
@ -911,23 +743,12 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildMerchantMIcon() {
|
|
|
|
|
return Container(
|
|
|
|
|
color: const Color(0xFFED1C24),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: "M".toText10(
|
|
|
|
|
isBold: true,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
return Container(color: const Color(0xFFED1C24), alignment: Alignment.center, child: "M".toText10(isBold: true, color: Colors.white));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildOfferCard(WalaPlusRetailerModel item, bool isAr) {
|
|
|
|
|
String? bannerUrl = (item.imageThumb != null && item.imageThumb!.isNotEmpty)
|
|
|
|
|
? item.imageThumb
|
|
|
|
|
: item.image;
|
|
|
|
|
String? logoUrl = (item.logoThumb != null && item.logoThumb!.isNotEmpty)
|
|
|
|
|
? item.logoThumb
|
|
|
|
|
: item.logo;
|
|
|
|
|
String? bannerUrl = (item.imageThumb != null && item.imageThumb!.isNotEmpty) ? item.imageThumb : item.image;
|
|
|
|
|
String? logoUrl = (item.logoThumb != null && item.logoThumb!.isNotEmpty) ? item.logoThumb : item.logo;
|
|
|
|
|
|
|
|
|
|
String discountText = _getDiscountBadge(item);
|
|
|
|
|
|
|
|
|
|
@ -947,9 +768,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
String validityText = item.getDisplayValidity();
|
|
|
|
|
String usageText = "";
|
|
|
|
|
if (item.displayUsage.isNotEmpty) {
|
|
|
|
|
usageText = item.displayUsage
|
|
|
|
|
.replaceAll('usage:', LocaleKeys.usageLabel.tr())
|
|
|
|
|
.replaceAll('Usage :', LocaleKeys.usageLabel.tr());
|
|
|
|
|
usageText = item.displayUsage.replaceAll('usage:', LocaleKeys.usageLabel.tr()).replaceAll('Usage :', LocaleKeys.usageLabel.tr());
|
|
|
|
|
}
|
|
|
|
|
String cityText = item.getDisplayCity(isAr: isAr);
|
|
|
|
|
if (cityText.trim().isEmpty) {
|
|
|
|
|
@ -963,14 +782,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: const Color(0xFF0D1720).withOpacity(0.0392),
|
|
|
|
|
offset: const Offset(0, 5),
|
|
|
|
|
blurRadius: 18,
|
|
|
|
|
spreadRadius: 0,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
boxShadow: [BoxShadow(color: const Color(0xFF0D1720).withOpacity(0.0392), offset: const Offset(0, 5), blurRadius: 18, spreadRadius: 0)],
|
|
|
|
|
),
|
|
|
|
|
padding: const EdgeInsets.all(10),
|
|
|
|
|
child: Column(
|
|
|
|
|
@ -980,7 +792,7 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.circular(14),
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 105,
|
|
|
|
|
height: 120,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Stack(
|
|
|
|
|
fit: StackFit.expand,
|
|
|
|
|
@ -988,17 +800,11 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
// Banner Image
|
|
|
|
|
(bannerUrl != null && bannerUrl.isNotEmpty)
|
|
|
|
|
? Image.network(
|
|
|
|
|
bannerUrl,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
errorBuilder: (_, __, ___) => Container(
|
|
|
|
|
color: const Color(0xFFF1F5F9),
|
|
|
|
|
child: const Icon(Icons.image_outlined, color: Color(0xFF94A3B8), size: 32),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
color: const Color(0xFFF1F5F9),
|
|
|
|
|
child: const Icon(Icons.image_outlined, color: Color(0xFF94A3B8), size: 32),
|
|
|
|
|
),
|
|
|
|
|
bannerUrl,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
errorBuilder: (_, __, ___) => Container(color: const Color(0xFFF1F5F9), child: const Icon(Icons.image_outlined, color: Color(0xFF94A3B8), size: 32)),
|
|
|
|
|
)
|
|
|
|
|
: Container(color: const Color(0xFFF1F5F9), child: const Icon(Icons.image_outlined, color: Color(0xFF94A3B8), size: 32)),
|
|
|
|
|
|
|
|
|
|
// Gradient overlay at bottom of image
|
|
|
|
|
Positioned(
|
|
|
|
|
@ -1007,42 +813,19 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
right: 0,
|
|
|
|
|
height: 50,
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
gradient: LinearGradient(
|
|
|
|
|
begin: Alignment.bottomCenter,
|
|
|
|
|
end: Alignment.topCenter,
|
|
|
|
|
colors: [
|
|
|
|
|
Colors.black.withOpacity(0.75),
|
|
|
|
|
Colors.transparent,
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
decoration: BoxDecoration(gradient: LinearGradient(begin: Alignment.bottomCenter, end: Alignment.topCenter, colors: [Colors.black.withOpacity(0.75), Colors.transparent])),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
// Discount badge at top right (flush with edge, pill on start side)
|
|
|
|
|
if (discountText.isNotEmpty)
|
|
|
|
|
PositionedDirectional(
|
|
|
|
|
top: 8,
|
|
|
|
|
top: 20,
|
|
|
|
|
end: 0,
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: const EdgeInsetsDirectional.only(
|
|
|
|
|
start: 14,
|
|
|
|
|
end: 10,
|
|
|
|
|
top: 4,
|
|
|
|
|
bottom: 4,
|
|
|
|
|
),
|
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
|
color: Color(0xFFED1C24),
|
|
|
|
|
borderRadius: BorderRadiusDirectional.only(
|
|
|
|
|
topStart: Radius.circular(20),
|
|
|
|
|
bottomStart: Radius.circular(20),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: discountText.toText14(
|
|
|
|
|
isBold: true,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
padding: const EdgeInsetsDirectional.only(start: 14, end: 10, top: 4, bottom: 4),
|
|
|
|
|
decoration: const BoxDecoration(color: Color(0xFFED1C24), borderRadius: BorderRadiusDirectional.only(topStart: Radius.circular(20), bottomStart: Radius.circular(20))),
|
|
|
|
|
child: discountText.toText14(isBold: true, color: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
@ -1056,27 +839,12 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
Container(
|
|
|
|
|
width: 18,
|
|
|
|
|
height: 18,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(4),
|
|
|
|
|
),
|
|
|
|
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4)),
|
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
child: (logoUrl != null && logoUrl.isNotEmpty)
|
|
|
|
|
? Image.network(
|
|
|
|
|
logoUrl,
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
errorBuilder: (_, __, ___) => _buildMerchantMIcon(),
|
|
|
|
|
)
|
|
|
|
|
: _buildMerchantMIcon(),
|
|
|
|
|
child: (logoUrl != null && logoUrl.isNotEmpty) ? Image.network(logoUrl, fit: BoxFit.contain, errorBuilder: (_, __, ___) => _buildMerchantMIcon()) : _buildMerchantMIcon(),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 5),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: (item.name ?? "").toText11(
|
|
|
|
|
isBold: true,
|
|
|
|
|
maxLine: 1,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(child: (item.name ?? "").toText11(isBold: true, maxLine: 1, color: Colors.white)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -1088,25 +856,11 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
|
|
|
|
|
// Retailer Name / Bundle Title
|
|
|
|
|
(item.name ?? "").toText13(
|
|
|
|
|
isBold: true,
|
|
|
|
|
maxlines: 1,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
color: const Color(0xFF1E293B),
|
|
|
|
|
),
|
|
|
|
|
if (offerSubtitle.isNotEmpty) ...[
|
|
|
|
|
const SizedBox(height: 2),
|
|
|
|
|
offerSubtitle.toText11(
|
|
|
|
|
maxLine: 1,
|
|
|
|
|
color: const Color(0xFF64748B),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
(item.name ?? "").toText14(isBold: true, maxlines: 1, overflow: TextOverflow.ellipsis, color: const Color(0xFF1E293B)),
|
|
|
|
|
if (offerSubtitle.isNotEmpty) ...[const SizedBox(height: 2), offerSubtitle.toText14(maxlines: 1, overflow: TextOverflow.ellipsis, isBold: true, color: const Color(0xFF1E293B))],
|
|
|
|
|
|
|
|
|
|
// Badges Row: Type, Validity, Location & Usage
|
|
|
|
|
if ((typeText != null && typeText.trim().isNotEmpty) ||
|
|
|
|
|
validityText.trim().isNotEmpty ||
|
|
|
|
|
cityText.trim().isNotEmpty ||
|
|
|
|
|
usageText.trim().isNotEmpty) ...[
|
|
|
|
|
if ((typeText != null && typeText.trim().isNotEmpty) || validityText.trim().isNotEmpty || cityText.trim().isNotEmpty || usageText.trim().isNotEmpty) ...[
|
|
|
|
|
const SizedBox(height: 6),
|
|
|
|
|
Wrap(
|
|
|
|
|
spacing: 5,
|
|
|
|
|
@ -1114,80 +868,30 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
// Type Chip (Online or In Store)
|
|
|
|
|
if (typeText != null && typeText.trim().isNotEmpty)
|
|
|
|
|
Container(
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 2.5),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: isOnline ? const Color(0xFFEFF6FF) : const Color(0xFFF5F3FF),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Icon(
|
|
|
|
|
isOnline ? Icons.language_rounded : Icons.storefront_rounded,
|
|
|
|
|
size: 10,
|
|
|
|
|
color: isOnline ? const Color(0xFF2563EB) : const Color(0xFF7C3AED),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 3),
|
|
|
|
|
typeText.toText10(
|
|
|
|
|
isBold: true,
|
|
|
|
|
color: isOnline ? const Color(0xFF2563EB) : const Color(0xFF7C3AED),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
InfoChipWidget(
|
|
|
|
|
text: typeText,
|
|
|
|
|
icon: isOnline ? Icons.language_rounded : Icons.storefront_rounded,
|
|
|
|
|
backgroundColor: isOnline ? const Color(0xFFEFF6FF) : const Color(0xFFF5F3FF),
|
|
|
|
|
textColor: isOnline ? const Color(0xFF2563EB) : const Color(0xFF7C3AED),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
// Validity badge
|
|
|
|
|
if (validityText.trim().isNotEmpty)
|
|
|
|
|
Container(
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 2.5),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: const Color(0xFFE6F7F0),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
child: validityText.toText10(
|
|
|
|
|
isBold: true,
|
|
|
|
|
color: const Color(0xFF00A651),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (validityText.trim().isNotEmpty) InfoChipWidget(text: validityText, backgroundColor: const Color(0xFFE6F7F0), textColor: const Color(0xFF00A651)),
|
|
|
|
|
|
|
|
|
|
// Location Badge
|
|
|
|
|
if (cityText.trim().isNotEmpty)
|
|
|
|
|
Container(
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 2.5),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: const Color(0xFFF3F4F6),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
const Icon(
|
|
|
|
|
Icons.location_on_rounded,
|
|
|
|
|
size: 10,
|
|
|
|
|
color: Color(0xFF64748B),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 2.5),
|
|
|
|
|
cityText.toText10(
|
|
|
|
|
color: const Color(0xFF4B5563),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
InfoChipWidget(
|
|
|
|
|
text: cityText,
|
|
|
|
|
svgIcon: "assets/icons/location.svg",
|
|
|
|
|
isBold: false,
|
|
|
|
|
backgroundColor: const Color(0xFFF3F4F6),
|
|
|
|
|
textColor: const Color(0xFF4B5563),
|
|
|
|
|
iconColor: const Color(0xFF64748B),
|
|
|
|
|
iconTextGap: 2.5,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
// Usage badge
|
|
|
|
|
if (usageText.trim().isNotEmpty)
|
|
|
|
|
Container(
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 2.5),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: const Color(0xFFFEF3C7),
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
child: usageText.toText10(
|
|
|
|
|
isBold: true,
|
|
|
|
|
color: const Color(0xFFB45309),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (usageText.trim().isNotEmpty) InfoChipWidget(text: usageText, backgroundColor: const Color(0xFFFEF3C7), textColor: const Color(0xFFB45309)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -1204,78 +908,28 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
child: GridView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
|
crossAxisCount: 2,
|
|
|
|
|
childAspectRatio: 0.72,
|
|
|
|
|
crossAxisSpacing: 12,
|
|
|
|
|
mainAxisSpacing: 16,
|
|
|
|
|
),
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 0.72, crossAxisSpacing: 12, mainAxisSpacing: 16),
|
|
|
|
|
itemCount: 4,
|
|
|
|
|
itemBuilder: (_, __) {
|
|
|
|
|
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),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
height: 105,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(14),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(height: 105, 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),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(height: 14, width: 110, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))),
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
Container(
|
|
|
|
|
height: 12,
|
|
|
|
|
width: 80,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(4),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(height: 12, width: 80, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))),
|
|
|
|
|
const SizedBox(height: 6),
|
|
|
|
|
Wrap(
|
|
|
|
|
spacing: 5,
|
|
|
|
|
runSpacing: 4,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
height: 16,
|
|
|
|
|
width: 50,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: 16,
|
|
|
|
|
width: 45,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: 16,
|
|
|
|
|
width: 45,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(height: 16, width: 50, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10))),
|
|
|
|
|
Container(height: 16, width: 45, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10))),
|
|
|
|
|
Container(height: 16, width: 45, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10))),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -1306,32 +960,11 @@ class _DashboardScreenForDependetState extends State<DashboardScreenForDependet>
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
width: 84,
|
|
|
|
|
height: 84,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(18),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(width: 84, height: 84, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(18))),
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
Container(
|
|
|
|
|
width: 65,
|
|
|
|
|
height: 11,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(4),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(width: 65, height: 11, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))),
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
Container(
|
|
|
|
|
width: 42,
|
|
|
|
|
height: 11,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(4),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(width: 42, height: 11, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(4))),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|