feat: add Poultry Farm Inspection module with navigation and logic
This commit is contained in:
@@ -122,6 +122,15 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
var tmpRoles = result?.role
|
||||
?.where((element) => element == 'PoultryScience' || element == 'Steward')
|
||||
.toList();
|
||||
|
||||
/*var tmpRoles = result?.role?.where((element) {
|
||||
return element == 'PoultryScience' ||
|
||||
element == 'Steward' ||
|
||||
element == 'CityOperator' ||
|
||||
element == 'CityJahad' ||
|
||||
element.toLowerCase().contains("admin");
|
||||
}).toList();*/
|
||||
|
||||
await tokenStorageService.saveRoles(_module, tmpRoles ?? []);
|
||||
if (rememberMe.value) {
|
||||
await tokenStorageService.saveUserPass(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/common/fa_user_role.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/app_bar.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@@ -15,11 +14,7 @@ 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) {
|
||||
return Expanded(
|
||||
child: GridView.builder(
|
||||
@@ -38,15 +33,9 @@ class RolePage extends GetView<RoleLogic> {
|
||||
title: role.keys.first,
|
||||
onTap: () async {
|
||||
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);
|
||||
},
|
||||
);
|
||||
@@ -58,17 +47,9 @@ 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,
|
||||
@@ -84,6 +65,7 @@ Widget roleCard({
|
||||
child: Text(
|
||||
title,
|
||||
style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user