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,

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class AppFonts {
AppFonts._(); // Private constructor to prevent instantiation
@@ -173,6 +174,15 @@ class AppFonts {
height: _height,
);
static const TextStyle yekan14Bold = TextStyle(
fontFamily: yekan,
fontWeight: bold, // Use bold weight
fontSize: 13,
height: _height,
);
static const TextStyle yekan13Bold = TextStyle(
fontFamily: yekan,
fontWeight: bold, // Use bold weight
@@ -180,10 +190,18 @@ class AppFonts {
height: _height,
);
static const TextStyle yekan10Bold = TextStyle(
static TextStyle yekan12Bold = TextStyle(
fontFamily: yekan,
fontWeight: bold, // Use bold weight
fontSize: 10,
fontSize: 12.sp,
height: _height,
);
static TextStyle yekan10Bold = TextStyle(
fontFamily: yekan,
fontWeight: bold, // Use bold weight
fontSize: 10.sp,
height: _height,
);
}

View File

@@ -1,82 +0,0 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
class BottomNavigation1 extends StatefulWidget {
const BottomNavigation1({super.key, required this.items});
final List<BottomNavigation1Item> items;
@override
State<BottomNavigation1> createState() => _BottomNavigation1State();
}
class _BottomNavigation1State extends State<BottomNavigation1> {
@override
Widget build(BuildContext context) {
return Container(
height: 90,
padding: EdgeInsets.fromLTRB(50, 10, 50, 10),
decoration: BoxDecoration(
color: AppColor.blueNormal,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(50),
topRight: Radius.circular(50),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget.items,
),
);
}
}
class BottomNavigation1Item extends StatelessWidget {
final String icon;
final String label;
final bool isSelected;
final Function() onTap;
const BottomNavigation1Item({
super.key,
required this.icon,
required this.label,
required this.isSelected,
required this.onTap,
});
@override
Widget build(BuildContext context) {
return Container(
width: 80,
height: 80,
padding: const EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: isSelected ? Colors.white.withAlpha(208) : Colors.transparent,
borderRadius: BorderRadius.circular(10),
),
child: InkWell(
onTap: onTap,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgGenImage.vec(icon).svg(
width: 32,
height: 32,
colorFilter: ColorFilter.mode(
isSelected ? AppColor.blueNormal : Colors.white,
BlendMode.srcIn)
),
const SizedBox(height: 5),
Text(
label,
style: AppFonts.yekan10.copyWith(
color: isSelected ? AppColor.blueNormal : Colors.white,
),
),
],
),
),
);
}
}

View File

@@ -0,0 +1,69 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
class RBottomNavigation extends StatefulWidget {
const RBottomNavigation({super.key, required this.items});
final List<RBottomNavigationItem> items;
@override
State<RBottomNavigation> createState() => _RBottomNavigationState();
}
class _RBottomNavigationState extends State<RBottomNavigation> {
@override
Widget build(BuildContext context) {
return Container(
height: 100.h,
padding: EdgeInsets.symmetric(horizontal: 11.w, vertical: 18.h),
decoration: BoxDecoration(
color: AppColor.blueNormal,
borderRadius: const BorderRadius.only(topLeft: Radius.circular(32), topRight: Radius.circular(32)),
),
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: widget.items),
);
}
}
class RBottomNavigationItem extends StatelessWidget {
final String icon;
final String label;
final bool isSelected;
final Function() onTap;
const RBottomNavigationItem({
super.key,
required this.icon,
required this.label,
required this.isSelected,
required this.onTap,
});
@override
Widget build(BuildContext context) {
return Container(
width: 70.w,
height: 70.h,
padding: const EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: isSelected ? Colors.white.withAlpha(208) : Colors.transparent,
borderRadius: BorderRadius.circular(10),
),
child: InkWell(
onTap: onTap,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgGenImage.vec(icon).svg(
width: 40.w,
height: 40.h,
colorFilter: ColorFilter.mode(isSelected ? AppColor.blueNormal : Colors.white, BlendMode.srcIn),
),
SizedBox(height: 5.h),
Text(label, style: AppFonts.yekan10.copyWith(color: isSelected ? AppColor.blueNormal : Colors.white)),
],
),
),
);
}
}

View File

@@ -1,5 +1,5 @@
export 'app_bar/r_app_bar.dart';
export 'bottom_navigation/bottom_navigation_1.dart';
export 'bottom_navigation/r_bottom_navigation.dart';
export 'bottom_navigation/wave_bottom_navigation.dart';
export 'buttons/elevated.dart';
export 'buttons/outline_elevated.dart';

View File

@@ -44,23 +44,23 @@ class RootPage extends GetView<RootLogic> {
sizing: StackFit.expand,
),
extendBody: true,
bottomNavigationBar: BottomNavigation1(
bottomNavigationBar: RBottomNavigation(
items: [
BottomNavigation1Item(
RBottomNavigationItem(
icon: Assets.vec.filterSvg.path,
label: 'درخواست‌ها',
isSelected: currentIndex.value == 0,
onTap: () => controller.changePage(0),
),
BottomNavigation1Item(
RBottomNavigationItem(
icon: Assets.vec.mapSvg.path,
label: 'نقشه',
isSelected: currentIndex.value == 1,
onTap: () => controller.changePage(1),
),
BottomNavigation1Item(
RBottomNavigationItem(
icon: Assets.vec.profileUserSvg.path,
label: 'پروفایل',
isSelected: currentIndex.value == 2,