diff --git a/features/supervision/lib/presentation/action/logic.dart b/features/supervision/lib/presentation/action/logic.dart new file mode 100644 index 0000000..33d2701 --- /dev/null +++ b/features/supervision/lib/presentation/action/logic.dart @@ -0,0 +1,36 @@ +import 'package:get/get.dart'; +import 'package:rasadyar_core/presentation/common/assets.dart'; + +class ActionLogic extends GetxController { + RxInt selectedIndex = 0.obs; + + List headersTitle = [ + 'کاربران', + 'سوابق بازرسی من', + 'آمار', + 'خروج از سامانه' + + ]; + + + List headersIcons = [ + Assets.vecProfileUserSvg, + Assets.vecCalendarSearchSvg, + Assets.vecDiagramSvg, + Assets.vecLogoutSvg, + + + ]; + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } +} diff --git a/features/supervision/lib/presentation/action/view.dart b/features/supervision/lib/presentation/action/view.dart new file mode 100644 index 0000000..239ba02 --- /dev/null +++ b/features/supervision/lib/presentation/action/view.dart @@ -0,0 +1,76 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +class ActionPage extends GetView { + const ActionPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.bgLight, + body: SafeArea( + child: Column( + children: [ + SizedBox(height: 20), + ObxValue((data) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: List.generate(4, (index) { + return headerWidget( + icon: controller.headersIcons[index], + title: controller.headersTitle[index], + onTap: () { + controller.selectedIndex.value = index; + }, + isSelected: controller.selectedIndex.value == index, + ); + }), + ); + }, controller.selectedIndex), + ], + ), + ), + ); + } + + Widget headerWidget({ + required String icon, + required String title, + required VoidCallback onTap, + bool isSelected = false, + }) { + return GestureDetector( + onTap: onTap, + child: Column( + spacing: 8, + children: [ + Container( + width: 48, + height: 48, + padding: EdgeInsets.all(8), + decoration: ShapeDecoration( + color: isSelected ? AppColor.blueLightActive : AppColor.blueLight, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + child: vecWidget( + icon, + width: 40, + height: 40, + color: AppColor.blueNormal, + ), + ), + Text( + title, + style: AppFonts.yekan12.copyWith( + color: isSelected ? AppColor.blueNormalActive : AppColor.blueNormal, + ), + ), + ], + ), + ); + } +} diff --git a/features/supervision/lib/presentation/root/logic.dart b/features/supervision/lib/presentation/root/logic.dart index 82d44bc..4d76474 100644 --- a/features/supervision/lib/presentation/root/logic.dart +++ b/features/supervision/lib/presentation/root/logic.dart @@ -1,19 +1,19 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:supervision/presentation/actions/view.dart'; +import 'package:supervision/presentation/action/view.dart'; import 'package:supervision/presentation/filter/view.dart'; class RootLogic extends GetxController { RxInt currentIndex = 0.obs; List pages = [ SupervisionFilterPage(), - ActionsPage(), + ActionPage(), Placeholder(color: Colors.amber), ]; @override void onReady() { - // TODO: implement onReady + super.onReady(); } diff --git a/features/supervision/lib/presentation/routes/app_pages.dart b/features/supervision/lib/presentation/routes/app_pages.dart index d0fd20c..07404d2 100644 --- a/features/supervision/lib/presentation/routes/app_pages.dart +++ b/features/supervision/lib/presentation/routes/app_pages.dart @@ -1,5 +1,5 @@ import 'package:rasadyar_core/core.dart'; -import 'package:supervision/presentation/actions/logic.dart'; +import 'package:supervision/presentation/action/logic.dart'; import 'package:supervision/presentation/add_supervision/logic.dart'; import 'package:supervision/presentation/add_supervision/view.dart'; import 'package:supervision/presentation/display_information/logic.dart'; @@ -24,7 +24,7 @@ sealed class SupervisionPages { Get.put(RootLogic()); Get.put(SupervisionFilterLogic()); Get.lazyPut(() => LocationDetailsLogic(), fenix: true); - Get.lazyPut(() => ActionsLogic(), fenix: true); + Get.lazyPut(() => ActionLogic(), fenix: true); }), ),