fix : new bottom sheet
This commit is contained in:
@@ -14,89 +14,69 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
body: IndexedStack(
|
body: IndexedStack(
|
||||||
children: [
|
children: [
|
||||||
Navigator(
|
Navigator(
|
||||||
key: Get.nestedKey(0),
|
key: Get.nestedKey(0),
|
||||||
onGenerateRoute: (settings) =>
|
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[0]),
|
||||||
GetPageRoute(page: () => controller.pages[0]),
|
|
||||||
),
|
),
|
||||||
Navigator(
|
Navigator(
|
||||||
key: Get.nestedKey(1),
|
key: Get.nestedKey(1),
|
||||||
onGenerateRoute: (settings) {
|
onGenerateRoute: (settings) {
|
||||||
final page = ChickenPages.pages.firstWhere(
|
final page = ChickenPages.pages.firstWhere(
|
||||||
(e) => e.name == settings.name,
|
(e) => e.name == settings.name,
|
||||||
orElse: () => ChickenPages.pages.firstWhere(
|
orElse: () => ChickenPages.pages.firstWhere((e) => e.name == ChickenRoutes.outOfProvince),
|
||||||
(e) => e.name == ChickenRoutes.outOfProvince,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return buildRouteFromGetPage(page);
|
return buildRouteFromGetPage(page);
|
||||||
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Navigator(
|
Navigator(
|
||||||
key: Get.nestedKey(2),
|
key: Get.nestedKey(2),
|
||||||
onGenerateRoute: (settings) =>
|
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[2]),
|
||||||
GetPageRoute(page: () => controller.pages[2]),
|
|
||||||
),
|
),
|
||||||
Navigator(
|
Navigator(
|
||||||
key: Get.nestedKey(3),
|
key: Get.nestedKey(3),
|
||||||
onGenerateRoute: (settings) =>
|
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[3]),
|
||||||
GetPageRoute(page: () => controller.pages[3]),
|
|
||||||
),
|
),
|
||||||
Navigator(
|
Navigator(
|
||||||
key: Get.nestedKey(4),
|
key: Get.nestedKey(4),
|
||||||
onGenerateRoute: (settings) =>
|
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[4]),
|
||||||
GetPageRoute(page: () => controller.pages[4]),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
index: data.value,
|
index: data.value,
|
||||||
),
|
),
|
||||||
bottomNavigationBar: WaveBottomNavigation(
|
|
||||||
initPage: controller.currentPage.value,
|
bottomNavigationBar: RBottomNavigation(
|
||||||
items: [
|
items: [
|
||||||
WaveBottomNavigationItem(
|
RBottomNavigationItem(
|
||||||
title: 'خرید',
|
label: 'خرید',
|
||||||
icon: Assets.vec.buySvg.svg(
|
icon: Assets.vec.buySvg.path,
|
||||||
width: 32,
|
isSelected: controller.currentPage.value == 0,
|
||||||
height: 32,
|
onTap: () => controller.changePage(0),
|
||||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
WaveBottomNavigationItem(
|
RBottomNavigationItem(
|
||||||
title: 'فروش',
|
label: 'فروش',
|
||||||
icon: Assets.vec.saleSvg.svg(
|
icon: Assets.vec.saleSvg.path,
|
||||||
width: 32,
|
isSelected: controller.currentPage.value == 1,
|
||||||
height: 32,
|
onTap: () => controller.changePage(1),
|
||||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
WaveBottomNavigationItem(
|
RBottomNavigationItem(
|
||||||
title: 'خانه',
|
label: 'خانه',
|
||||||
icon: Assets.vec.homeSvg.svg(
|
icon: Assets.vec.homeSvg.path,
|
||||||
width: 32,
|
isSelected: controller.currentPage.value == 2,
|
||||||
height: 32,
|
onTap: () => controller.changePage(2),
|
||||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
WaveBottomNavigationItem(
|
RBottomNavigationItem(
|
||||||
title: 'قطعه بندی',
|
label: 'قطعه بندی',
|
||||||
icon: Assets.vec.convertCubeSvg.svg(
|
icon: Assets.vec.convertCubeSvg.path,
|
||||||
width: 32,
|
isSelected: controller.currentPage.value == 3,
|
||||||
height: 32,
|
onTap: () => controller.changePage(3),
|
||||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
WaveBottomNavigationItem(
|
RBottomNavigationItem(
|
||||||
title: 'پروفایل',
|
label: 'پروفایل',
|
||||||
icon: Assets.vec.userSvg.svg(
|
icon: Assets.vec.profileCircleSvg.path,
|
||||||
width: 32,
|
isSelected: controller.currentPage.value == 4,
|
||||||
height: 32,
|
onTap: () => controller.changePage(4),
|
||||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
onPageChanged: (index) {
|
|
||||||
controller.changePage(index);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}, controller.currentPage);
|
}, controller.currentPage);
|
||||||
@@ -106,10 +86,7 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
return Container(
|
return Container(
|
||||||
height: 70,
|
height: 70,
|
||||||
width: Get.width / 2,
|
width: Get.width / 2,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -130,9 +107,7 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
Text(
|
Text(
|
||||||
'بارهای امروز',
|
'بارهای امروز',
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||||
color: AppColor.blueNormal,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -182,26 +157,19 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
height: 82,
|
height: 82,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: bgLabelColor,
|
color: bgLabelColor,
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(topRight: Radius.circular(8), bottomRight: Radius.circular(8)),
|
||||||
topRight: Radius.circular(8),
|
|
||||||
bottomRight: Radius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
spacing: 4,
|
spacing: 4,
|
||||||
children: [
|
children: [
|
||||||
SvgGenImage.vec(iconPath).svg(
|
SvgGenImage.vec(
|
||||||
width: 24,
|
iconPath,
|
||||||
height: 24,
|
).svg(width: 24, height: 24, colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn)),
|
||||||
colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn),
|
|
||||||
),
|
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||||
color: AppColor.mediumGreyDarkActive,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -212,10 +180,7 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: bgDescriptionColor,
|
color: bgDescriptionColor,
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)),
|
||||||
topLeft: Radius.circular(8),
|
|
||||||
bottomLeft: Radius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@@ -224,16 +189,12 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
Text(
|
Text(
|
||||||
description,
|
description,
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: AppFonts.yekan16.copyWith(
|
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||||
color: AppColor.mediumGreyDarkActive,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
unit,
|
unit,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan12.copyWith(
|
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||||
color: AppColor.mediumGreyDarkActive,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -278,23 +239,17 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||||
color: AppColor.mediumGreyDarkActive,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
description,
|
description,
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: AppFonts.yekan16.copyWith(
|
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||||
color: AppColor.mediumGreyDarkActive,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
unit,
|
unit,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan12.copyWith(
|
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||||
color: AppColor.mediumGreyDarkActive,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -313,11 +268,9 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: SvgGenImage.vec(iconPath).svg(
|
child: SvgGenImage.vec(
|
||||||
width: 24,
|
iconPath,
|
||||||
height: 24,
|
).svg(width: 24, height: 24, colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn)),
|
||||||
colorFilter: ColorFilter.mode(iconColor, BlendMode.srcIn),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -326,11 +279,7 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget widelyUsed({
|
Widget widelyUsed({required String title, required String iconPath, required VoidCallback onTap}) {
|
||||||
required String title,
|
|
||||||
required String iconPath,
|
|
||||||
required VoidCallback onTap,
|
|
||||||
}) {
|
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
@@ -342,18 +291,14 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
padding: EdgeInsets.all(4),
|
padding: EdgeInsets.all(4),
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
color: const Color(0xFFBECDFF),
|
color: const Color(0xFFBECDFF),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
color: AppColor.blueNormal,
|
color: AppColor.blueNormal,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
child: SvgGenImage.vec(iconPath).svg(
|
child: SvgGenImage.vec(iconPath).svg(
|
||||||
width: 24,
|
width: 24,
|
||||||
@@ -363,10 +308,7 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(title, style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
||||||
title,
|
|
||||||
style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -383,24 +325,16 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
padding: EdgeInsets.all(4),
|
padding: EdgeInsets.all(4),
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
color: const Color(0xFFD9F7F0),
|
color: const Color(0xFFD9F7F0),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
child: Assets.vec.messageAddSvg.svg(
|
child: Assets.vec.messageAddSvg.svg(
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
colorFilter: ColorFilter.mode(
|
colorFilter: ColorFilter.mode(AppColor.greenNormal, BlendMode.srcIn),
|
||||||
AppColor.greenNormal,
|
|
||||||
BlendMode.srcIn,
|
|
||||||
),
|
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text('افزودن', style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover)),
|
||||||
'افزودن',
|
|
||||||
style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -547,9 +481,7 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
title,
|
title,
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
@@ -557,9 +489,7 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
value,
|
value,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan14.copyWith(
|
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -585,30 +515,18 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
Text(
|
Text(
|
||||||
'اطلاعات ارسالی',
|
'اطلاعات ارسالی',
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: AppFonts.yekan16Bold.copyWith(
|
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||||
color: AppColor.blueNormal,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
buildRow(
|
buildRow('فروش و توزیع داخل استان (کیلوگرم)', model.stewardAllocationsWeight!.toInt().toString()),
|
||||||
'فروش و توزیع داخل استان (کیلوگرم)',
|
buildRow('فروش و توزیع خارج استان (کیلوگرم)', model.freeSalesWeight!.toInt().toString()),
|
||||||
model.stewardAllocationsWeight!.toInt().toString(),
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
'فروش و توزیع خارج استان (کیلوگرم)',
|
|
||||||
model.freeSalesWeight!.toInt().toString(),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: const Center(child: CircularProgressIndicator()),
|
: const Center(child: CircularProgressIndicator()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget cardWidget({
|
Widget cardWidget({required String title, required String iconPath, required VoidCallback onTap}) {
|
||||||
required String title,
|
|
||||||
required String iconPath,
|
|
||||||
required VoidCallback onTap,
|
|
||||||
}) {
|
|
||||||
return Container(
|
return Container(
|
||||||
width: Get.width / 4,
|
width: Get.width / 4,
|
||||||
height: 130,
|
height: 130,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
|
||||||
class AppFonts {
|
class AppFonts {
|
||||||
AppFonts._(); // Private constructor to prevent instantiation
|
AppFonts._(); // Private constructor to prevent instantiation
|
||||||
@@ -173,6 +174,15 @@ class AppFonts {
|
|||||||
height: _height,
|
height: _height,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
static const TextStyle yekan14Bold = TextStyle(
|
||||||
|
fontFamily: yekan,
|
||||||
|
fontWeight: bold, // Use bold weight
|
||||||
|
fontSize: 13,
|
||||||
|
height: _height,
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
static const TextStyle yekan13Bold = TextStyle(
|
static const TextStyle yekan13Bold = TextStyle(
|
||||||
fontFamily: yekan,
|
fontFamily: yekan,
|
||||||
fontWeight: bold, // Use bold weight
|
fontWeight: bold, // Use bold weight
|
||||||
@@ -180,10 +190,18 @@ class AppFonts {
|
|||||||
height: _height,
|
height: _height,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const TextStyle yekan10Bold = TextStyle(
|
static TextStyle yekan12Bold = TextStyle(
|
||||||
fontFamily: yekan,
|
fontFamily: yekan,
|
||||||
fontWeight: bold, // Use bold weight
|
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,
|
height: _height,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
export 'app_bar/r_app_bar.dart';
|
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 'bottom_navigation/wave_bottom_navigation.dart';
|
||||||
export 'buttons/elevated.dart';
|
export 'buttons/elevated.dart';
|
||||||
export 'buttons/outline_elevated.dart';
|
export 'buttons/outline_elevated.dart';
|
||||||
|
|||||||
@@ -44,23 +44,23 @@ class RootPage extends GetView<RootLogic> {
|
|||||||
sizing: StackFit.expand,
|
sizing: StackFit.expand,
|
||||||
),
|
),
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
bottomNavigationBar: BottomNavigation1(
|
bottomNavigationBar: RBottomNavigation(
|
||||||
items: [
|
items: [
|
||||||
BottomNavigation1Item(
|
RBottomNavigationItem(
|
||||||
icon: Assets.vec.filterSvg.path,
|
icon: Assets.vec.filterSvg.path,
|
||||||
label: 'درخواستها',
|
label: 'درخواستها',
|
||||||
isSelected: currentIndex.value == 0,
|
isSelected: currentIndex.value == 0,
|
||||||
onTap: () => controller.changePage(0),
|
onTap: () => controller.changePage(0),
|
||||||
),
|
),
|
||||||
|
|
||||||
BottomNavigation1Item(
|
RBottomNavigationItem(
|
||||||
icon: Assets.vec.mapSvg.path,
|
icon: Assets.vec.mapSvg.path,
|
||||||
label: 'نقشه',
|
label: 'نقشه',
|
||||||
isSelected: currentIndex.value == 1,
|
isSelected: currentIndex.value == 1,
|
||||||
onTap: () => controller.changePage(1),
|
onTap: () => controller.changePage(1),
|
||||||
),
|
),
|
||||||
|
|
||||||
BottomNavigation1Item(
|
RBottomNavigationItem(
|
||||||
icon: Assets.vec.profileUserSvg.path,
|
icon: Assets.vec.profileUserSvg.path,
|
||||||
label: 'پروفایل',
|
label: 'پروفایل',
|
||||||
isSelected: currentIndex.value == 2,
|
isSelected: currentIndex.value == 2,
|
||||||
|
|||||||
Reference in New Issue
Block a user