Files
rasadyar_application/features/inspection/lib/presentation/root/view.dart
2025-04-28 12:29:13 +03:30

122 lines
3.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
class RootPage extends GetView<RootLogic> {
const RootPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
// سایر محتواها (مثلا صفحات اصلی)
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),
),
),
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),
),
),
),
),
],
),
),
],
),
);
}
}
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),
),
],
),
),
),
),
],
),
);
}
}