BASE: Add Necessary Assets.

This commit is contained in:
2025-11-28 11:57:51 +05:00
parent c798279f7d
commit e55892f36e
21 changed files with 452 additions and 61 deletions

View File

@@ -1,5 +1,8 @@
import 'dart:developer';
import 'package:customer/constant/constant.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../controllers/service_list_controller.dart';
import '../../controllers/theme_controller.dart';
@@ -25,8 +28,8 @@ class ServiceListScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("eMart".tr, style: AppThemeData.semiBoldTextStyle(fontSize: 22, color: themeController.isDark.value ? AppThemeData.grey50 : AppThemeData.grey900)),
Text("All Your Needs in One App!".tr, style: AppThemeData.regularTextStyle(fontSize: 14, color: themeController.isDark.value ? AppThemeData.grey100 : AppThemeData.grey700)),
Image.asset("assets/images/fondex_logo.png",
height: 32.r, width: 124.r, fit: BoxFit.contain),
],
),
),
@@ -37,45 +40,140 @@ class ServiceListScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
controller.serviceListBanner.isEmpty
? SizedBox()
: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.r),
child: BannerView(
bannerList: controller.serviceListBanner,
),
),
// Main Cards Section
_mainCardsSection(),
SizedBox(height: 15.h),
// Other Services Section Title
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.r),
child: Text(
"Другие услуги",
style: TextStyle(
fontFamily: AppThemeData.bold,
fontWeight: FontWeight.w700,
fontSize: 20.sp,
color: AppThemeData.darkGrey,
),
),
),
SizedBox(height: 10.h),
_otherServicesCardMaker(
image: "assets/images/delivery_img.png",
title: "Курьерская доставка",
subtitle: "Доставляем безопасно",
),
_otherServicesCardMaker(
image: "assets/images/keys_img.png",
title: "Аренда",
subtitle: "Огромный выбор объявлений!",
),
_otherServicesCardMaker(
image: "assets/images/cosmetics_img.png",
title: "Косметика",
subtitle: "Более 1000 товаров",
),
_otherServicesCardMaker(
image: "assets/images/products_img.png",
title: "Продукты питания",
subtitle: "Более 1000 товаров",
),
SizedBox(height: 45.h),
const SizedBox(height: 12),
controller.serviceListBanner.isEmpty ? SizedBox() : BannerView(bannerList: controller.serviceListBanner),
controller.serviceListBanner.isEmpty
? SizedBox()
: BannerView(
bannerList: controller.serviceListBanner,
),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Explore Our Services".tr, style: AppThemeData.semiBoldTextStyle(fontSize: 20, color: themeController.isDark.value ? AppThemeData.grey50 : AppThemeData.grey900)),
Text(
"Explore Our Services".tr,
style: AppThemeData.semiBoldTextStyle(
fontSize: 20,
color:
themeController.isDark.value
? AppThemeData.grey50
: AppThemeData.grey900,
),
),
const SizedBox(height: 12),
GridView.builder(
itemCount: controller.sectionList.length,
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, mainAxisSpacing: 12, crossAxisSpacing: 12, mainAxisExtent: 130),
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
mainAxisSpacing: 12,
crossAxisSpacing: 12,
mainAxisExtent: 130,
),
itemBuilder: (context, index) {
final section = controller.sectionList[index];
return GestureDetector(
onTap: () => controller.onServiceTap(context, section),
onTap:
() => controller.onServiceTap(
context,
section,
),
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(colors: Constant.sectionColor[index % Constant.sectionColor.length], begin: Alignment.topCenter, end: Alignment.bottomCenter),
gradient: LinearGradient(
colors:
Constant.sectionColor[index %
Constant.sectionColor.length],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(top: 10, left: 5, right: 5),
padding: const EdgeInsets.only(
top: 10,
left: 5,
right: 5,
),
child: Text(
section.name ?? '',
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: AppThemeData.semiBoldTextStyle(fontSize: 14, color: AppThemeData.grey900),
style:
AppThemeData.semiBoldTextStyle(
fontSize: 14,
color: AppThemeData.grey900,
),
),
),
const Spacer(),
NetworkImageWidget(imageUrl: section.sectionImage ?? '', width: 80, height: 60, fit: BoxFit.contain),
NetworkImageWidget(
imageUrl:
section.sectionImage ?? '',
width: 80,
height: 60,
fit: BoxFit.contain,
),
],
),
),
@@ -92,6 +190,238 @@ class ServiceListScreen extends StatelessWidget {
},
);
}
Widget _otherServicesCardMaker({
required String image,
required String title,
required String subtitle,
}) {
return InkWell(
onTap: () {
log("Other Service Card Tapped: $title");
},
child: Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16.r).copyWith(bottom: 10.r),
padding: EdgeInsets.only(left: 6.r, right: 12.r, top: 6.r, bottom: 6.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.r),
color: AppThemeData.grey50,
),
child: Row(
spacing: 15.r,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Row(
spacing: 10.r,
children: [
Container(
height: 52.r,
width: 52.r,
decoration: BoxDecoration(
color: AppThemeData.cardColor,
borderRadius: BorderRadius.circular(14.r),
),
child: Image.asset(
image,
height: 62.r,
width: 62.r,
fit: BoxFit.contain,
),
),
Expanded(
child: Column(
spacing: 2.r,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
overflow: TextOverflow.ellipsis,
fontFamily: AppThemeData.semiBold,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
color: AppThemeData.darkGrey,
),
),
Text(
subtitle,
style: TextStyle(
overflow: TextOverflow.ellipsis,
fontFamily: AppThemeData.semiBold,
fontSize: 13.sp,
fontWeight: FontWeight.w400,
color: AppThemeData.darkGrey,
),
),
],
),
),
],
),
),
Icon(
Icons.arrow_forward_ios,
size: 18.r,
color: AppThemeData.darkGrey,
),
],
),
),
);
}
Widget _mainCardsSection() {
return Container(
padding: EdgeInsets.symmetric(vertical: 16.r, horizontal: 16.r),
decoration: BoxDecoration(
color: AppThemeData.grey50,
borderRadius: BorderRadius.circular(16.r),
),
child: Row(
spacing: 12.r,
children: [
// Food & Garderobe Cards
Column(
spacing: 12.r,
children: [
_mainCardsMaker(
title: "Еда и доставка",
image: "assets/images/food_img.png",
// onTap: () {
// log("Main Card Tapped");
onTap: () async {},
// },
),
_mainCardsMaker(
title: "Обновить гардероб",
image: "assets/images/garderob_img.png",
onTap: () {
log("Main Card Tapped");
},
),
],
),
// Taxi Card
InkWell(
onTap: () {
log("Taxi Card Tapped");
// push(context, DashBoardCabService(user: null));
},
child: Container(
height: 192.h,
width: 166.w,
padding: EdgeInsets.only(top: 12.r, right: 12.r),
decoration: BoxDecoration(
color: AppThemeData.yellow,
borderRadius: BorderRadius.circular(16.r),
),
child: Column(
children: [
Expanded(
child: Padding(
padding: EdgeInsets.only(left: 12.r),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
maxLines: 2,
"Позвать такси",
style: TextStyle(
overflow: TextOverflow.ellipsis,
fontFamily: AppThemeData.bold,
fontSize: 18.sp,
fontWeight: FontWeight.w700,
color: AppThemeData.grey50,
),
),
),
Container(
height: 36.r,
width: 36.r,
decoration: BoxDecoration(
color: AppThemeData.grey50.withValues(alpha: 0.3),
borderRadius: BorderRadius.circular(8.r),
),
child: Icon(
Icons.arrow_outward_rounded,
size: 20.r,
color: AppThemeData.grey50,
),
),
],
),
),
),
Image.asset(
"assets/images/taxi_img.png",
height: 119.r,
width: 156.r,
fit: BoxFit.contain,
),
],
),
),
),
],
),
);
}
Widget _mainCardsMaker({
required String title,
required String image,
required VoidCallback onTap,
}) {
return InkWell(
onTap: onTap,
child: Container(
height: 93.h,
width: 165.w,
padding: EdgeInsets.only(left: 12.r),
decoration: BoxDecoration(
color: AppThemeData.cardColor,
borderRadius: BorderRadius.circular(16.r),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: Padding(
padding: EdgeInsets.only(bottom: 12.r, top: 12.r),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
maxLines: 2,
title,
style: TextStyle(
overflow: TextOverflow.ellipsis,
fontFamily: AppThemeData.bold,
fontSize: 14.sp,
fontWeight: FontWeight.w700,
color: AppThemeData.darkGrey,
),
),
Icon(
Icons.arrow_outward_rounded,
size: 24.r,
color: AppThemeData.darkGrey,
),
],
),
),
),
Image.asset(image, height: 71.r, width: 71.r, fit: BoxFit.contain),
],
),
),
);
}
}
class BannerView extends StatelessWidget {
@@ -132,7 +462,13 @@ class BannerView extends StatelessWidget {
itemBuilder: (context, index) {
return ClipRRect(
borderRadius: BorderRadius.circular(12),
child: SizedBox(width: MediaQuery.of(context).size.width * 0.8, child: NetworkImageWidget(imageUrl: bannerList[index].toString(), fit: BoxFit.fill)),
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.8,
child: NetworkImageWidget(
imageUrl: bannerList[index].toString(),
fit: BoxFit.fill,
),
),
);
},
),
@@ -142,7 +478,18 @@ class BannerView extends StatelessWidget {
return Row(
children: List.generate(bannerList.length, (index) {
final isSelected = currentPage.value == index;
return Expanded(child: Container(height: 4, decoration: BoxDecoration(color: isSelected ? AppThemeData.grey300 : AppThemeData.grey100, borderRadius: BorderRadius.circular(5))));
return Expanded(
child: Container(
height: 4,
decoration: BoxDecoration(
color:
isSelected
? AppThemeData.grey300
: AppThemeData.grey100,
borderRadius: BorderRadius.circular(5),
),
),
);
}),
);
}),