feat : action page
This commit is contained in:
BIN
assets/images/poultry_action.webp
Normal file
BIN
assets/images/poultry_action.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
BIN
assets/images/select_role.webp
Normal file
BIN
assets/images/select_role.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
@@ -0,0 +1,5 @@
|
|||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
|
class PoultryActionLogic extends GetxController {
|
||||||
|
RxList<String> actions = ['a'].obs;
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:rasadyar_chicken/presentation/pages/role/view.dart';
|
||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
import 'package:rasadyar_core/presentation/common/assets.gen.dart';
|
||||||
|
|
||||||
|
import '../../../widget/app_bar.dart';
|
||||||
|
import 'logic.dart';
|
||||||
|
|
||||||
|
class PoultryActionPage extends GetView<PoultryActionLogic> {
|
||||||
|
PoultryActionPage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: chickenAppBar(
|
||||||
|
hasBack: false,
|
||||||
|
hasFilter: false,
|
||||||
|
hasSearch: false,
|
||||||
|
isBase: false,
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Assets.images.poultryAction.image(
|
||||||
|
height: 212.h,
|
||||||
|
width: Get.width.w,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
ObxValue((data) {
|
||||||
|
return Expanded(
|
||||||
|
child: GridView.builder(
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 4,
|
||||||
|
mainAxisSpacing: 12.h,
|
||||||
|
crossAxisSpacing: 12.w,
|
||||||
|
childAspectRatio: 2,
|
||||||
|
),
|
||||||
|
itemCount: 4,
|
||||||
|
hitTestBehavior: HitTestBehavior.opaque,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return roleCard(
|
||||||
|
title: data[index],
|
||||||
|
onTap: () async {
|
||||||
|
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}, controller.actions),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart';
|
|
||||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart';
|
import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
|
||||||
@@ -10,7 +9,9 @@ class PoultryScienceProfileLogic extends GetxController {
|
|||||||
RxInt selectedInformationType = 0.obs;
|
RxInt selectedInformationType = 0.obs;
|
||||||
Rxn<Jalali> birthDate = Rxn<Jalali>();
|
Rxn<Jalali> birthDate = Rxn<Jalali>();
|
||||||
|
|
||||||
Rx<Resource<UserProfile>> userProfile = Rx<Resource<UserProfile>>(Resource.loading());
|
Rx<Resource<UserProfile>> userProfile = Rx<Resource<UserProfile>>(
|
||||||
|
Resource.loading(),
|
||||||
|
);
|
||||||
|
|
||||||
TextEditingController nameController = TextEditingController();
|
TextEditingController nameController = TextEditingController();
|
||||||
TextEditingController lastNameController = TextEditingController();
|
TextEditingController lastNameController = TextEditingController();
|
||||||
@@ -52,7 +53,8 @@ class PoultryScienceProfileLogic extends GetxController {
|
|||||||
lastNameController.text = data.data?.lastName ?? '';
|
lastNameController.text = data.data?.lastName ?? '';
|
||||||
nationalCodeController.text = data.data?.nationalCode ?? '';
|
nationalCodeController.text = data.data?.nationalCode ?? '';
|
||||||
nationalIdController.text = data.data?.nationalId ?? '';
|
nationalIdController.text = data.data?.nationalId ?? '';
|
||||||
birthdayController.text = data.data?.birthday?.toJalali.formatCompactDate() ?? '';
|
birthdayController.text =
|
||||||
|
data.data?.birthday?.toJalali.formatCompactDate() ?? '';
|
||||||
birthDate.value = data.data?.birthday?.toJalali;
|
birthDate.value = data.data?.birthday?.toJalali;
|
||||||
selectedProvince.value = IranProvinceCityModel(
|
selectedProvince.value = IranProvinceCityModel(
|
||||||
name: data.data?.province ?? '',
|
name: data.data?.province ?? '',
|
||||||
@@ -72,9 +74,9 @@ class PoultryScienceProfileLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getUserProfile() async {
|
Future<void> getUserProfile() async {
|
||||||
userProfile.value = Resource.loading();
|
/* userProfile.value = Resource.loading();
|
||||||
await safeCall<UserProfile?>(
|
await safeCall<UserProfile?>(
|
||||||
call: () async => await rootLogic.chickenRepository.getUserProfile(
|
call: () async => await rootLogic.poultryRepository.getUserProfile(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
),
|
),
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
@@ -83,11 +85,11 @@ class PoultryScienceProfileLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onError: (error, stackTrace) {},
|
onError: (error, stackTrace) {},
|
||||||
);
|
);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getCites() async {
|
Future<void> getCites() async {
|
||||||
await safeCall(
|
/* await safeCall(
|
||||||
call: () =>
|
call: () =>
|
||||||
rootLogic.chickenRepository.getCity(provinceName: selectedProvince.value?.name ?? ''),
|
rootLogic.chickenRepository.getCity(provinceName: selectedProvince.value?.name ?? ''),
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
@@ -95,11 +97,11 @@ class PoultryScienceProfileLogic extends GetxController {
|
|||||||
cites.value = result;
|
cites.value = result;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateUserProfile() async {
|
Future<void> updateUserProfile() async {
|
||||||
UserProfile userProfile = UserProfile(
|
/* UserProfile userProfile = UserProfile(
|
||||||
firstName: nameController.text,
|
firstName: nameController.text,
|
||||||
lastName: lastNameController.text,
|
lastName: lastNameController.text,
|
||||||
nationalCode: nationalCodeController.text,
|
nationalCode: nationalCodeController.text,
|
||||||
@@ -121,11 +123,11 @@ class PoultryScienceProfileLogic extends GetxController {
|
|||||||
onError: (error, stackTrace) {
|
onError: (error, stackTrace) {
|
||||||
isOnLoading.value = false;
|
isOnLoading.value = false;
|
||||||
},
|
},
|
||||||
);
|
);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updatePassword() async {
|
Future<void> updatePassword() async {
|
||||||
if (formKey.currentState?.validate() ?? false) {
|
/*if (formKey.currentState?.validate() ?? false) {
|
||||||
ChangePasswordRequestModel model = ChangePasswordRequestModel(
|
ChangePasswordRequestModel model = ChangePasswordRequestModel(
|
||||||
username: userProfile.value.data?.mobile,
|
username: userProfile.value.data?.mobile,
|
||||||
password: newPasswordController.text,
|
password: newPasswordController.text,
|
||||||
@@ -137,7 +139,7 @@ class PoultryScienceProfileLogic extends GetxController {
|
|||||||
model: model,
|
model: model,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearPasswordForm() {
|
void clearPasswordForm() {
|
||||||
|
|||||||
@@ -458,34 +458,6 @@ class PoultryScienceProfilePage extends GetView<PoultryScienceProfileLogic> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _provinceWidget() {
|
|
||||||
return Obx(() {
|
|
||||||
return OverlayDropdownWidget<IranProvinceCityModel>(
|
|
||||||
items: controller.rootLogic.provinces,
|
|
||||||
onChanged: (value) {
|
|
||||||
controller.selectedProvince.value = value;
|
|
||||||
},
|
|
||||||
selectedItem: controller.selectedProvince.value,
|
|
||||||
itemBuilder: (item) => Text(item.name ?? 'بدون نام'),
|
|
||||||
labelBuilder: (item) => Text(item?.name ?? 'انتخاب استان'),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _cityWidget() {
|
|
||||||
return ObxValue((data) {
|
|
||||||
return OverlayDropdownWidget<IranProvinceCityModel>(
|
|
||||||
items: data,
|
|
||||||
onChanged: (value) {
|
|
||||||
controller.selectedCity.value = value;
|
|
||||||
},
|
|
||||||
selectedItem: controller.selectedCity.value,
|
|
||||||
itemBuilder: (item) => Text(item.name ?? 'بدون نام'),
|
|
||||||
labelBuilder: (item) => Text(item?.name ?? 'انتخاب شهر'),
|
|
||||||
);
|
|
||||||
}, controller.cites);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget changePasswordBottomSheet() {
|
Widget changePasswordBottomSheet() {
|
||||||
return BaseBottomSheet(
|
return BaseBottomSheet(
|
||||||
height: 400.h,
|
height: 400.h,
|
||||||
|
|||||||
@@ -1,51 +1,33 @@
|
|||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_chicken/data/data_source/local/chicken_local.dart';
|
|
||||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart';
|
|
||||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
|
||||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
|
||||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
|
||||||
import 'package:rasadyar_chicken/data/repositories/poultry_science/poultry_science_repository.dart';
|
import 'package:rasadyar_chicken/data/repositories/poultry_science/poultry_science_repository.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/home/view.dart';
|
import 'package:rasadyar_chicken/presentation/pages/poultry_science/home/view.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/steward/buy/view.dart';
|
import 'package:rasadyar_chicken/presentation/pages/poultry_science/poultry_action/view.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/steward/home/view.dart';
|
|
||||||
import 'package:rasadyar_chicken/presentation/pages/steward/profile/view.dart';
|
import 'package:rasadyar_chicken/presentation/pages/steward/profile/view.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/steward/sale/view.dart';
|
|
||||||
import 'package:rasadyar_chicken/presentation/pages/steward/segmentation/view.dart';
|
|
||||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
|
||||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
||||||
|
|
||||||
class PoultryScienceRootLogic extends GetxController {
|
class PoultryScienceRootLogic extends GetxController {
|
||||||
RxInt currentPage = 2.obs;
|
RxInt currentPage = 1.obs;
|
||||||
List<Widget> pages = [BuyPage(), SalePage(), PoultryScienceHomePage(), SegmentationPage(), ProfilePage()];
|
List<Widget> pages = [
|
||||||
|
PoultryActionPage(),
|
||||||
|
PoultryScienceHomePage(),
|
||||||
|
ProfilePage(),
|
||||||
|
];
|
||||||
late DioRemote dioRemote;
|
late DioRemote dioRemote;
|
||||||
var tokenService = Get.find<TokenStorageService>();
|
var tokenService = Get.find<TokenStorageService>();
|
||||||
late PoultryScienceRepository poultryRepository;
|
late PoultryScienceRepository poultryRepository;
|
||||||
RxList<ErrorLocationType> errorLocationType = RxList();
|
RxList<ErrorLocationType> errorLocationType = RxList();
|
||||||
RxMap<int, dynamic> homeExpandedList = RxMap();
|
RxMap<int, dynamic> homeExpandedList = RxMap();
|
||||||
Rxn<InventoryModel> inventoryModel = Rxn<InventoryModel>();
|
|
||||||
RxList<IranProvinceCityModel> provinces = <IranProvinceCityModel>[].obs;
|
|
||||||
|
|
||||||
// Cancel tokens for API calls
|
|
||||||
CancelToken? _inventoryCancelToken;
|
|
||||||
CancelToken? _provincesCancelToken;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|
||||||
poultryRepository = diChicken.get<PoultryScienceRepository>();
|
poultryRepository = diChicken.get<PoultryScienceRepository>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
void onReady() {
|
|
||||||
super.onReady();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onClose() {
|
void onClose() {
|
||||||
super.onClose();
|
super.onClose();
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:rasadyar_chicken/chicken.dart';
|
|
||||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
@@ -43,7 +41,7 @@ class PoultryScienceRootPage extends GetView<PoultryScienceRootLogic> {
|
|||||||
backgroundColor: AppColor.bgLight,
|
backgroundColor: AppColor.bgLight,
|
||||||
body: IndexedStack(
|
body: IndexedStack(
|
||||||
children: [
|
children: [
|
||||||
Navigator(
|
/* Navigator(
|
||||||
key: Get.nestedKey(0),
|
key: Get.nestedKey(0),
|
||||||
onGenerateRoute: (settings) {
|
onGenerateRoute: (settings) {
|
||||||
final page = ChickenPages.pages.firstWhere(
|
final page = ChickenPages.pages.firstWhere(
|
||||||
@@ -66,18 +64,21 @@ class PoultryScienceRootPage extends GetView<PoultryScienceRootLogic> {
|
|||||||
|
|
||||||
return buildRouteFromGetPage(page);
|
return buildRouteFromGetPage(page);
|
||||||
},
|
},
|
||||||
|
),*/
|
||||||
|
Navigator(
|
||||||
|
key: Get.nestedKey(0),
|
||||||
|
onGenerateRoute: (settings) =>
|
||||||
|
GetPageRoute(page: () => controller.pages[0]),
|
||||||
|
),
|
||||||
|
Navigator(
|
||||||
|
key: Get.nestedKey(1),
|
||||||
|
onGenerateRoute: (settings) =>
|
||||||
|
GetPageRoute(page: () => controller.pages[1]),
|
||||||
),
|
),
|
||||||
Navigator(
|
Navigator(
|
||||||
key: Get.nestedKey(2),
|
key: Get.nestedKey(2),
|
||||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[2]),
|
onGenerateRoute: (settings) =>
|
||||||
),
|
GetPageRoute(page: () => controller.pages[1]),
|
||||||
Navigator(
|
|
||||||
key: Get.nestedKey(3),
|
|
||||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[3]),
|
|
||||||
),
|
|
||||||
Navigator(
|
|
||||||
key: Get.nestedKey(4),
|
|
||||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[4]),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
index: data.value,
|
index: data.value,
|
||||||
@@ -101,7 +102,7 @@ class PoultryScienceRootPage extends GetView<PoultryScienceRootLogic> {
|
|||||||
icon: Assets.vec.homeSvg.path,
|
icon: Assets.vec.homeSvg.path,
|
||||||
isSelected: controller.currentPage.value == 1,
|
isSelected: controller.currentPage.value == 1,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
/* Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
/* Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
||||||
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);*/
|
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);*/
|
||||||
controller.changePage(1);
|
controller.changePage(1);
|
||||||
},
|
},
|
||||||
@@ -111,7 +112,7 @@ class PoultryScienceRootPage extends GetView<PoultryScienceRootLogic> {
|
|||||||
icon: Assets.vec.profileCircleSvg.path,
|
icon: Assets.vec.profileCircleSvg.path,
|
||||||
isSelected: controller.currentPage.value == 2,
|
isSelected: controller.currentPage.value == 2,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
/* Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
/* Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
||||||
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
|
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
|
||||||
*/
|
*/
|
||||||
controller.changePage(2);
|
controller.changePage(2);
|
||||||
@@ -123,6 +124,4 @@ class PoultryScienceRootPage extends GetView<PoultryScienceRootLogic> {
|
|||||||
);
|
);
|
||||||
}, controller.currentPage);
|
}, controller.currentPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_chicken/data/common/fa_user_role.dart';
|
import 'package:rasadyar_chicken/data/common/fa_user_role.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
import 'package:rasadyar_chicken/presentation/widget/app_bar.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
@@ -10,111 +10,80 @@ class RolePage extends GetView<RoleLogic> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return BasePage(
|
return Scaffold(
|
||||||
hasSearch: true,
|
appBar: chickenAppBar(
|
||||||
hasBack: false,
|
hasBack: false,
|
||||||
isBase: true,
|
hasFilter: false,
|
||||||
routes: ['انتخاب نقش'],
|
hasSearch: false,
|
||||||
widgets: [
|
isBase: false,
|
||||||
ObxValue((data) {
|
),
|
||||||
return Expanded(
|
body: Column(
|
||||||
child: GridView.builder(
|
|
||||||
physics: BouncingScrollPhysics(),
|
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: 3,
|
|
||||||
mainAxisSpacing: 12.h,
|
|
||||||
crossAxisSpacing: 12.w,
|
|
||||||
childAspectRatio: 2,
|
|
||||||
),
|
|
||||||
itemCount: data.length,
|
|
||||||
hitTestBehavior: HitTestBehavior.opaque,
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
Map role = getFaUserRoleWithOnTap(data[index]);
|
|
||||||
return roleCard(
|
|
||||||
title: role.keys.first,
|
|
||||||
onTap: () async {
|
|
||||||
String route = role.values.first;
|
|
||||||
await controller.gService.saveSelectedRole(
|
|
||||||
Module.chicken,
|
|
||||||
route,
|
|
||||||
);
|
|
||||||
Get.offAllNamed(route);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}, controller.roles),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
/* return Scaffold(
|
|
||||||
body: Stack(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
Assets.rive.shapes.rive(fit: BoxFit.cover),
|
Assets.images.selectRole.image(
|
||||||
Positioned.fill(
|
height: 212.h,
|
||||||
child: BackdropFilter(
|
width: Get.width.w,
|
||||||
filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
|
fit: BoxFit.cover,
|
||||||
child: Container(color: Colors.white.withValues(alpha: 0.2)),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Container(
|
ObxValue((data) {
|
||||||
height: 400.h,
|
return Expanded(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
child: GridView.builder(
|
||||||
child: Card(
|
physics: BouncingScrollPhysics(),
|
||||||
child: Column(
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
children: [
|
crossAxisCount: 3,
|
||||||
SizedBox(height: 12.h),
|
mainAxisSpacing: 12.h,
|
||||||
Text(
|
crossAxisSpacing: 12.w,
|
||||||
'انتخاب نقش',
|
childAspectRatio: 2,
|
||||||
style: AppFonts.yekan20Bold.copyWith(color: AppColor.textColor),
|
),
|
||||||
),
|
itemCount: data.length,
|
||||||
ObxValue((data) {
|
hitTestBehavior: HitTestBehavior.opaque,
|
||||||
return Expanded(
|
itemBuilder: (BuildContext context, int index) {
|
||||||
child: GridView.builder(
|
Map role = getFaUserRoleWithOnTap(data[index]);
|
||||||
physics: BouncingScrollPhysics(),
|
return roleCard(
|
||||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
title: role.keys.first,
|
||||||
maxCrossAxisExtent: 250,
|
onTap: () async {
|
||||||
mainAxisSpacing: 12,
|
String route = role.values.first;
|
||||||
crossAxisSpacing: 12,
|
await controller.gService.saveSelectedRole(
|
||||||
childAspectRatio: 1.5,
|
Module.chicken,
|
||||||
),
|
route,
|
||||||
itemCount: data.length,
|
);
|
||||||
hitTestBehavior: HitTestBehavior.opaque,
|
Get.offAllNamed(route);
|
||||||
itemBuilder: (BuildContext context, int index) {
|
},
|
||||||
return roleCard(title: getFaUserRole(data[index]), onTap: () {});
|
);
|
||||||
},
|
},
|
||||||
),
|
|
||||||
);
|
|
||||||
}, controller.roles),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
),
|
}, controller.roles),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);*/
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget roleCard({required String title, Function()? onTap}) {
|
|
||||||
return Container(
|
|
||||||
width: 128.w,
|
|
||||||
height: 48.h,
|
|
||||||
margin: EdgeInsets.all(8.w),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(8.r),
|
|
||||||
border: Border.all(color: AppColor.blueNormal, width: 1.w),
|
|
||||||
),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: onTap,
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
title,
|
|
||||||
style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Widget roleCard({
|
||||||
|
required String title,
|
||||||
|
Function()? onTap,
|
||||||
|
int? width,
|
||||||
|
int? height,
|
||||||
|
}) {
|
||||||
|
return Container(
|
||||||
|
width: width?.w ?? 128.w,
|
||||||
|
height: height?.h ?? 48.h,
|
||||||
|
margin: EdgeInsets.all(8.w),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
border: Border.all(color: AppColor.blueNormal, width: 1.w),
|
||||||
|
),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: onTap,
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import 'package:rasadyar_chicken/presentation/pages/auth/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/auth/logic.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/auth/view.dart';
|
import 'package:rasadyar_chicken/presentation/pages/auth/view.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/home/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/poultry_science/home/logic.dart';
|
||||||
|
import 'package:rasadyar_chicken/presentation/pages/poultry_science/poultry_action/logic.dart';
|
||||||
|
import 'package:rasadyar_chicken/presentation/pages/poultry_science/profile/logic.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/view.dart';
|
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/view.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/role/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/role/logic.dart';
|
||||||
@@ -147,13 +149,11 @@ sealed class ChickenPages {
|
|||||||
middlewares: [AuthMiddleware()],
|
middlewares: [AuthMiddleware()],
|
||||||
binding: BindingsBuilder(() {
|
binding: BindingsBuilder(() {
|
||||||
Get.lazyPut(() => BaseLogic());
|
Get.lazyPut(() => BaseLogic());
|
||||||
|
Get.lazyPut(() => SearchLogic());
|
||||||
Get.lazyPut(() => PoultryScienceRootLogic());
|
Get.lazyPut(() => PoultryScienceRootLogic());
|
||||||
Get.lazyPut(() => PoultryScienceHomeLogic());
|
Get.lazyPut(() => PoultryScienceHomeLogic());
|
||||||
Get.lazyPut(() => BuyLogic());
|
Get.lazyPut(() => PoultryScienceProfileLogic());
|
||||||
Get.lazyPut(() => SaleLogic());
|
Get.lazyPut(() => PoultryActionLogic());
|
||||||
Get.lazyPut(() => ProfileLogic());
|
|
||||||
Get.lazyPut(() => SegmentationLogic());
|
|
||||||
Get.lazyPut(() => SearchLogic());
|
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import 'package:rasadyar_chicken/presentation/widget/search/logic.dart';
|
|||||||
import 'package:rasadyar_chicken/presentation/widget/search/view.dart';
|
import 'package:rasadyar_chicken/presentation/widget/search/view.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
class BasePage extends StatefulWidget {
|
class BasePage extends StatefulWidget {
|
||||||
const BasePage({
|
const BasePage({
|
||||||
super.key,
|
super.key,
|
||||||
this.routes,
|
this.routes,
|
||||||
|
|||||||
@@ -404,8 +404,14 @@ class $AssetsImagesGen {
|
|||||||
/// File path: assets/images/place_holder.png
|
/// File path: assets/images/place_holder.png
|
||||||
AssetGenImage get placeHolder => const AssetGenImage('assets/images/place_holder.png');
|
AssetGenImage get placeHolder => const AssetGenImage('assets/images/place_holder.png');
|
||||||
|
|
||||||
|
/// File path: assets/images/poultry_action.webp
|
||||||
|
AssetGenImage get poultryAction => const AssetGenImage('assets/images/poultry_action.webp');
|
||||||
|
|
||||||
|
/// File path: assets/images/select_role.webp
|
||||||
|
AssetGenImage get selectRole => const AssetGenImage('assets/images/select_role.webp');
|
||||||
|
|
||||||
/// List of all assets
|
/// List of all assets
|
||||||
List<AssetGenImage> get values => [chicken, innerSplash, outterSplash, placeHolder];
|
List<AssetGenImage> get values => [chicken, innerSplash, outterSplash, placeHolder, poultryAction, selectRole];
|
||||||
}
|
}
|
||||||
|
|
||||||
class $AssetsLogosGen {
|
class $AssetsLogosGen {
|
||||||
|
|||||||
Reference in New Issue
Block a user