77 lines
2.0 KiB
Dart
77 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:rasadyar_core/core.dart';
|
|
|
|
import 'logic.dart';
|
|
|
|
class ActionPage extends GetView<ActionLogic> {
|
|
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,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|