refactor: update data source and repository structure by removing unused files, enhancing model integration, and adjusting import paths for better organization

This commit is contained in:
2025-12-07 12:33:39 +03:30
parent c28a4a3177
commit 02686115cb
129 changed files with 5269 additions and 545 deletions

View File

@@ -0,0 +1,60 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
import 'package:rasadyar_chicken/data/models/response/broadcast_price/broadcast_price.dart';
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository.dart';
import 'package:rasadyar_chicken/features/common/profile/view.dart';
import 'package:rasadyar_chicken/presentation/routes/pages.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
import 'package:rasadyar_core/core.dart';
class KillHouseRootLogic extends GetxController {
RxInt currentPage = 1.obs;
var tokenService = Get.find<TokenStorageService>();
late KillHouseRepository killHouseRepository;
@override
void onInit() {
super.onInit();
killHouseRepository = diChicken.get<KillHouseRepository>();
}
final pages = [
Navigator(
key: Get.nestedKey(killHouseActionKey),
onGenerateRoute: (settings) {
final page = ChickenPages.pages.firstWhere(
(e) => e.name == settings.name,
orElse: () => ChickenPages.pages.firstWhere(
(e) => e.name == ChickenRoutes.actionKillHouse,
),
);
return buildRouteFromGetPage(page);
},
),
Container(color: Colors.deepPurpleAccent.withAlpha(50)),
ProfilePage(),
];
@override
void onReady() {
// TODO: implement onReady
super.onReady();
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
}
void changePage(int i) {
currentPage.value = i;
}
}

View File

@@ -0,0 +1,77 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
class KillHouseRootPage extends GetView<KillHouseRootLogic> {
const KillHouseRootPage({super.key});
@override
Widget build(BuildContext context) {
return ObxValue((data) {
return ChickenBasePage(
isBase: true,
isFullScreen: true,
scrollable: true,
child: Stack(
children: [
IndexedStack(children: controller.pages, index: data.value),
Positioned(
right: 0,
left: 0,
bottom: 0,
child: RBottomNavigation(
mainAxisAlignment: MainAxisAlignment.spaceAround,
items: [
RBottomNavigationItem(
label: 'عملیات',
icon: Assets.vec.settingSvg.path,
isSelected: controller.currentPage.value == 0,
onTap: () {
/* Get.nestedKey(
poultrySecondKey,
)?.currentState?.popUntil((route) => route.isFirst);
Get.nestedKey(
poultryFirstKey,
)?.currentState?.popUntil((route) => route.isFirst);*/
controller.changePage(0);
},
),
RBottomNavigationItem(
label: 'خانه',
icon: Assets.vec.homeSvg.path,
isSelected: controller.currentPage.value == 1,
onTap: () {
/* Get.nestedKey(
poultryFirstKey,
)?.currentState?.popUntil((route) => route.isFirst);
Get.nestedKey(
poultryThirdKey,
)?.currentState?.popUntil((route) => route.isFirst);*/
controller.changePage(1);
},
),
RBottomNavigationItem(
label: 'پروفایل',
icon: Assets.vec.profileCircleSvg.path,
isSelected: controller.currentPage.value == 2,
onTap: () {
/* Get.nestedKey(
poultryFirstKey,
)?.currentState?.popUntil((route) => route.isFirst);
Get.nestedKey(
poultrySecondKey,
)?.currentState?.popUntil((route) => route.isFirst);*/
controller.changePage(2);
},
),
],
),
),
],
),
);
}, controller.currentPage);
}
}