refactor: optimize module navigation delay and clean up unused code in splash and auth logic

fix : role access to chicken app
This commit is contained in:
2025-12-29 11:21:54 +03:30
parent 12cdc1a5e8
commit 57704399b9
12 changed files with 111 additions and 1942 deletions

View File

@@ -14,8 +14,40 @@ class RolePage extends GetView<RoleLogic> {
isBase: true,
child: Column(
children: [
Assets.images.selectRole.image(height: 212.h, width: Get.width.w, fit: BoxFit.cover),
Assets.images.selectRole.image(
height: 212.h,
width: Get.width.w,
fit: BoxFit.cover,
),
ObxValue((data) {
if (data.isEmpty) {
return Expanded(
child: Center(
child: Padding(
padding: EdgeInsets.all(24.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.info_outline,
size: 64.w,
color: AppColor.darkGreyDark,
),
SizedBox(height: 16.h),
Text(
'شما دسترسی به هیچ رولی ندارید',
textAlign: TextAlign.center,
style: AppFonts.yekan16Bold.copyWith(
color: AppColor.darkGreyDark,
),
),
SizedBox(height: 8.h),
],
),
),
),
);
}
return Expanded(
child: GridView.builder(
physics: BouncingScrollPhysics(),
@@ -34,9 +66,15 @@ class RolePage extends GetView<RoleLogic> {
onTap: () async {
try {
String route = role.values.first;
await controller.gService.saveRoute(Module.chicken, route);
await controller.gService.saveRoute(
Module.chicken,
route,
);
await controller.gService.saveRole(Module.chicken, data[index]);
await controller.gService.saveRole(
Module.chicken,
data[index],
);
Get.offAllNamed(route);
} catch (e) {
eLog(
@@ -55,7 +93,12 @@ class RolePage extends GetView<RoleLogic> {
}
}
Widget roleCard({required String title, Function()? onTap, int? width, int? height}) {
Widget roleCard({
required String title,
Function()? onTap,
int? width,
int? height,
}) {
return Container(
width: width?.w ?? 128.w,
height: height?.h ?? 48.h,