fix : new bottom sheet

This commit is contained in:
2025-06-30 08:51:11 +03:30
parent cae4ed4e06
commit 898f870b54
6 changed files with 157 additions and 234 deletions

View File

@@ -14,89 +14,69 @@ class RootPage extends GetView<RootLogic> {
body: IndexedStack(
children: [
Navigator(
key: Get.nestedKey(0),
onGenerateRoute: (settings) =>
GetPageRoute(page: () => controller.pages[0]),
key: Get.nestedKey(0),
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[0]),
),
Navigator(
key: Get.nestedKey(1),
onGenerateRoute: (settings) {
final page = ChickenPages.pages.firstWhere(
(e) => e.name == settings.name,
orElse: () => ChickenPages.pages.firstWhere(
(e) => e.name == ChickenRoutes.outOfProvince,
),
(e) => e.name == settings.name,
orElse: () => ChickenPages.pages.firstWhere((e) => e.name == ChickenRoutes.outOfProvince),
);
return buildRouteFromGetPage(page);
},
),
Navigator(
key: Get.nestedKey(2),
onGenerateRoute: (settings) =>
GetPageRoute(page: () => controller.pages[2]),
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[2]),
),
Navigator(
key: Get.nestedKey(3),
onGenerateRoute: (settings) =>
GetPageRoute(page: () => controller.pages[3]),
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[3]),
),
Navigator(
key: Get.nestedKey(4),
onGenerateRoute: (settings) =>
GetPageRoute(page: () => controller.pages[4]),
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[4]),
),
],
index: data.value,
),
bottomNavigationBar: WaveBottomNavigation(
initPage: controller.currentPage.value,
bottomNavigationBar: RBottomNavigation(
items: [
WaveBottomNavigationItem(
title: 'خرید',
icon: Assets.vec.buySvg.svg(
width: 32,
height: 32,
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
),
RBottomNavigationItem(
label: 'خرید',
icon: Assets.vec.buySvg.path,
isSelected: controller.currentPage.value == 0,
onTap: () => controller.changePage(0),
),
WaveBottomNavigationItem(
title: 'فروش',
icon: Assets.vec.saleSvg.svg(
width: 32,
height: 32,
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
),
RBottomNavigationItem(
label: 'فروش',
icon: Assets.vec.saleSvg.path,
isSelected: controller.currentPage.value == 1,
onTap: () => controller.changePage(1),
),
WaveBottomNavigationItem(
title: 'خانه',
icon: Assets.vec.homeSvg.svg(
width: 32,
height: 32,
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
),
RBottomNavigationItem(
label: 'خانه',
icon: Assets.vec.homeSvg.path,
isSelected: controller.currentPage.value == 2,
onTap: () => controller.changePage(2),
),
WaveBottomNavigationItem(
title: 'قطعه بندی',
icon: Assets.vec.convertCubeSvg.svg(
width: 32,
height: 32,
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
),
RBottomNavigationItem(
label: 'قطعه بندی',
icon: Assets.vec.convertCubeSvg.path,
isSelected: controller.currentPage.value == 3,
onTap: () => controller.changePage(3),
),
WaveBottomNavigationItem(
title: 'پروفایل',
icon: Assets.vec.userSvg.svg(
width: 32,
height: 32,
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
),
RBottomNavigationItem(
label: 'پروفایل',
icon: Assets.vec.profileCircleSvg.path,
isSelected: controller.currentPage.value == 4,
onTap: () => controller.changePage(4),
),
],
onPageChanged: (index) {
controller.changePage(index);
},
),
);
}, controller.currentPage);
@@ -106,10 +86,7 @@ class RootPage extends GetView<RootLogic> {
return Container(
height: 70,
width: Get.width / 2,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
clipBehavior: Clip.hardEdge,
child: Row(
children: [
@@ -130,9 +107,7 @@ class RootPage extends GetView<RootLogic> {
Text(
'بارهای امروز',
textAlign: TextAlign.right,
style: AppFonts.yekan14.copyWith(
color: AppColor.blueNormal,
),
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
),
],
),
@@ -182,26 +157,19 @@ class RootPage extends GetView<RootLogic> {
height: 82,
decoration: BoxDecoration(
color: bgLabelColor,
borderRadius: BorderRadius.only(
topRight: Radius.circular(8),
bottomRight: Radius.circular(8),
),
borderRadius: BorderRadius.only(topRight: Radius.circular(8), bottomRight: Radius.circular(8)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 4,
children: [
SvgGenImage.vec(iconPath).svg(
width: 24,
height: 24,
colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn),
),
SvgGenImage.vec(
iconPath,
).svg(width: 24, height: 24, colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn)),
Text(
title,
textAlign: TextAlign.right,
style: AppFonts.yekan14.copyWith(
color: AppColor.mediumGreyDarkActive,
),
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
),
],
),
@@ -212,10 +180,7 @@ class RootPage extends GetView<RootLogic> {
child: Container(
decoration: BoxDecoration(
color: bgDescriptionColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8),
),
borderRadius: BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -224,16 +189,12 @@ class RootPage extends GetView<RootLogic> {
Text(
description,
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(
color: AppColor.mediumGreyDarkActive,
),
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
),
Text(
unit,
textAlign: TextAlign.center,
style: AppFonts.yekan12.copyWith(
color: AppColor.mediumGreyDarkActive,
),
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
),
],
),
@@ -278,23 +239,17 @@ class RootPage extends GetView<RootLogic> {
Text(
title,
textAlign: TextAlign.right,
style: AppFonts.yekan14.copyWith(
color: AppColor.mediumGreyDarkActive,
),
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
),
Text(
description,
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(
color: AppColor.mediumGreyDarkActive,
),
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
),
Text(
unit,
textAlign: TextAlign.center,
style: AppFonts.yekan12.copyWith(
color: AppColor.mediumGreyDarkActive,
),
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
),
],
),
@@ -313,11 +268,9 @@ class RootPage extends GetView<RootLogic> {
),
),
child: Center(
child: SvgGenImage.vec(iconPath).svg(
width: 24,
height: 24,
colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn),
),
child: SvgGenImage.vec(
iconPath,
).svg(width: 24, height: 24, colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn)),
),
),
),
@@ -326,11 +279,7 @@ class RootPage extends GetView<RootLogic> {
);
}
Widget widelyUsed({
required String title,
required String iconPath,
required VoidCallback onTap,
}) {
Widget widelyUsed({required String title, required String iconPath, required VoidCallback onTap}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
@@ -342,18 +291,14 @@ class RootPage extends GetView<RootLogic> {
padding: EdgeInsets.all(4),
decoration: ShapeDecoration(
color: const Color(0xFFBECDFF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
),
child: Container(
width: 40,
height: 40,
decoration: ShapeDecoration(
color: AppColor.blueNormal,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
),
child: SvgGenImage.vec(iconPath).svg(
width: 24,
@@ -363,10 +308,7 @@ class RootPage extends GetView<RootLogic> {
),
),
),
Text(
title,
style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal),
),
Text(title, style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
],
);
}
@@ -383,24 +325,16 @@ class RootPage extends GetView<RootLogic> {
padding: EdgeInsets.all(4),
decoration: ShapeDecoration(
color: const Color(0xFFD9F7F0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
),
child: Assets.vec.messageAddSvg.svg(
width: 40,
height: 40,
colorFilter: ColorFilter.mode(
AppColor.greenNormal,
BlendMode.srcIn,
),
colorFilter: ColorFilter.mode(AppColor.greenNormal, BlendMode.srcIn),
fit: BoxFit.cover,
),
),
Text(
'افزودن',
style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover),
),
Text('افزودن', style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover)),
],
);
}
@@ -547,9 +481,7 @@ class RootPage extends GetView<RootLogic> {
child: Text(
title,
textAlign: TextAlign.right,
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
),
),
Flexible(
@@ -557,9 +489,7 @@ class RootPage extends GetView<RootLogic> {
child: Text(
value,
textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
),
),
],
@@ -585,30 +515,18 @@ class RootPage extends GetView<RootLogic> {
Text(
'اطلاعات ارسالی',
textAlign: TextAlign.right,
style: AppFonts.yekan16Bold.copyWith(
color: AppColor.blueNormal,
),
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
),
const SizedBox(height: 12),
buildRow(
'فروش و توزیع داخل استان (کیلوگرم)',
model.stewardAllocationsWeight!.toInt().toString(),
),
buildRow(
'فروش و توزیع خارج استان (کیلوگرم)',
model.freeSalesWeight!.toInt().toString(),
),
buildRow('فروش و توزیع داخل استان (کیلوگرم)', model.stewardAllocationsWeight!.toInt().toString()),
buildRow('فروش و توزیع خارج استان (کیلوگرم)', model.freeSalesWeight!.toInt().toString()),
],
)
: const Center(child: CircularProgressIndicator()),
);
}
Widget cardWidget({
required String title,
required String iconPath,
required VoidCallback onTap,
}) {
Widget cardWidget({required String title, required String iconPath, required VoidCallback onTap}) {
return Container(
width: Get.width / 4,
height: 130,