feat : profile with logic

This commit is contained in:
2025-07-08 16:06:10 +03:30
parent a9b012b016
commit 146ea28e77
17 changed files with 1531 additions and 61 deletions

View File

@@ -8,6 +8,7 @@ import 'package:rasadyar_chicken/data/repositories/chicken_repository.dart';
import 'package:rasadyar_chicken/data/repositories/chicken_repository_imp.dart';
import 'package:rasadyar_chicken/presentation/pages/buy/view.dart';
import 'package:rasadyar_chicken/presentation/pages/home/view.dart';
import 'package:rasadyar_chicken/presentation/pages/profile/view.dart';
import 'package:rasadyar_chicken/presentation/pages/sale/view.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
@@ -22,14 +23,10 @@ class RootLogic extends GetxController {
SalePage(),
HomePage(),
Container(color: Colors.blue),
Container(color: Colors.amber),
ProfilePage(),
];
final defaultRoutes = <int, String>{
0: ChickenRoutes.buy,
1: ChickenRoutes.sale,
};
final defaultRoutes = <int, String>{0: ChickenRoutes.buy, 1: ChickenRoutes.sale};
List<String> routesName = ['رصدطیور'];
@@ -65,7 +62,8 @@ class RootLogic extends GetxController {
Future<void> getInventory() async {
await safeCall<List<InventoryModel>?>(
call: () async => await chickenRepository.getInventory(token: tokenService.accessToken.value!),
call: () async =>
await chickenRepository.getInventory(token: tokenService.accessToken.value!),
onSuccess: (result) {
if (result != null) {
inventoryModel.value = result.first;