feat : new bottom sheet V1
This commit is contained in:
@@ -11,48 +11,42 @@ class RootPage extends GetView<RootLogic> {
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
ObxValue(
|
||||
(currentIndex) => IndexedStack(
|
||||
index: currentIndex.value,
|
||||
children: controller.pages,
|
||||
),
|
||||
controller.currentIndex,
|
||||
),
|
||||
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: ObxValue(
|
||||
(index) => BottomNavigation1(
|
||||
items: [
|
||||
BottomNavigation1Item(
|
||||
icon: Assets.vecMapSvg,
|
||||
label: 'نقشه',
|
||||
isSelected: controller.currentIndex.value == 0,
|
||||
onTap: () {
|
||||
controller.changePage(0);
|
||||
},
|
||||
// سایر محتواها (مثلا صفحات اصلی)
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Column(
|
||||
children: [
|
||||
const Spacer(),
|
||||
Container(
|
||||
height: 100,
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.blueNormal,
|
||||
borderRadius: BorderRadius.vertical(
|
||||
top: Radius.circular(40),
|
||||
),
|
||||
),
|
||||
BottomNavigation1Item(
|
||||
icon: Assets.vecSettingSvg,
|
||||
label: 'اقدام',
|
||||
isSelected: controller.currentIndex.value == 1,
|
||||
onTap: () {
|
||||
controller.changePage(1);
|
||||
},
|
||||
child: SingleChildScrollView(
|
||||
clipBehavior: Clip.none,
|
||||
scrollDirection: Axis.horizontal,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Row(
|
||||
children: List.generate(
|
||||
50,
|
||||
(index) => ObxValue((data) {
|
||||
return BottomNavigation1ItemTST(
|
||||
icon: Assets.vecMapSvg,
|
||||
label: 'item$index',
|
||||
isSelected: controller.currentIndex.value == index,
|
||||
onTap: () => controller.changePage(index),
|
||||
);
|
||||
}, controller.currentIndex),
|
||||
),
|
||||
),
|
||||
),
|
||||
BottomNavigation1Item(
|
||||
icon: Assets.vecProfileCircleSvg,
|
||||
label: 'پروفایل',
|
||||
isSelected: controller.currentIndex.value == 2,
|
||||
onTap: () {
|
||||
controller.changePage(2);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
controller.currentIndex,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -60,3 +54,68 @@ class RootPage extends GetView<RootLogic> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BottomNavigation1ItemTST extends StatelessWidget {
|
||||
final String icon;
|
||||
final String label;
|
||||
final bool isSelected;
|
||||
final Function() onTap;
|
||||
|
||||
const BottomNavigation1ItemTST({
|
||||
super.key,
|
||||
required this.icon,
|
||||
required this.label,
|
||||
required this.isSelected,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: 80,
|
||||
height: 130,
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
alignment: Alignment.bottomCenter,
|
||||
children: [
|
||||
AnimatedPositioned(
|
||||
duration: const Duration(milliseconds: 400),
|
||||
width: 80,
|
||||
height: 80,
|
||||
bottom: isSelected ? 50 : 0,
|
||||
child: InkWell(
|
||||
splashColor: Colors.transparent,
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: 80,
|
||||
height: 80,
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? AppColor.greenNormal : Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
border:
|
||||
isSelected
|
||||
? Border.all(width: 2, color: Colors.white)
|
||||
: null,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
vecWidget(icon, width: 32, height: 32, color: Colors.white),
|
||||
const SizedBox(height: 7),
|
||||
Text(
|
||||
label,
|
||||
style: AppFonts.yekan14.copyWith(color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user