feat : sale in provence

This commit is contained in:
2025-07-07 16:07:52 +03:30
parent eede1f4b29
commit 93ec5774c8
23 changed files with 529 additions and 713 deletions

View File

@@ -1,7 +1,6 @@
import 'package:rasadyar_auth/data/utils/safe_call.dart';
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
import 'package:rasadyar_chicken/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.dart';
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart';
@@ -9,19 +8,21 @@ import 'package:rasadyar_chicken/presentation/pages/root/logic.dart';
import 'package:rasadyar_core/core.dart';
class SaleLogic extends GetxController {
var rootLogic = Get.find<RootLogic>();
Rxn<List<AllocatedMadeModel>?> allocatedMadeModel =
Rxn<List<AllocatedMadeModel>?>();
Rxn<List<AllocatedMadeModel>?> allocatedMadeModel = Rxn<List<AllocatedMadeModel>?>();
RxList<ProductModel> rolesProductsModel = RxList<ProductModel>();
RxList<GuildModel> guildsModel = <GuildModel>[].obs;
Rxn<StewardFreeBarDashboard> stewardFreeDashboard =
Rxn<StewardFreeBarDashboard>();
Rxn<StewardFreeBarDashboard> stewardFreeDashboard = Rxn<StewardFreeBarDashboard>();
RootLogic rootLogic = Get.find<RootLogic>();
late List<String> routesName;
@override
void onInit() {
super.onInit();
routesName = [...rootLogic.routesName, 'فروش'].toList();
getStewardDashBord();
getRolesProducts();
}
@@ -30,12 +31,7 @@ class SaleLogic extends GetxController {
safeCall(
call: () async => await rootLogic.chickenRepository.getAllocatedMade(
token: rootLogic.tokenService.accessToken.value!,
queryParameters: buildQueryParams(
page: 1,
pageSize: 20,
search: 'filter',
role: 'Steward',
),
queryParameters: buildQueryParams(page: 1, pageSize: 20, search: 'filter', role: 'Steward'),
),
onSuccess: (result) {
if (result != null) {
@@ -78,8 +74,7 @@ class SaleLogic extends GetxController {
safeCall(
call: () async => await rootLogic.chickenRepository.confirmAllAllocation(
token: rootLogic.tokenService.accessToken.value!,
allocationTokens:
allocatedMadeModel.value?.map((e) => e.key!).toList() ?? [],
allocationTokens: allocatedMadeModel.value?.map((e) => e.key!).toList() ?? [],
),
onSuccess: (result) {
getAllocatedMade();

View File

@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_chicken/chicken.dart';
import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
import 'package:rasadyar_chicken/presentation/widget/sale_buy_card_item.dart';
import 'package:rasadyar_core/core.dart';
import 'logic.dart';
@@ -10,64 +12,41 @@ class SalePage extends GetView<SaleLogic> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColor.bgLight,
appBar: RAppBar(
title: 'رصدطیور',
iconTitle: Assets.vec.chickenSvg.path,
titleTextStyle: AppFonts.yekan16Bold.copyWith(color: Colors.white),
centerTitle: true,
hasBack: false,
leadingWidth: 130,
leading: Row(
mainAxisSize: MainAxisSize.min,
spacing: 6,
return BasePage(
routes: controller.routesName,
isBase: true,
widgets: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Assets.vec.cubeSearchSvg.svg(
width: 24,
height: 24,
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
),
Text('خارج استان', style: AppFonts.yekan16Bold.copyWith(color: Colors.white)),
],
),
),
body: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
spacing: 8,
Wrap(
alignment: WrapAlignment.center,
spacing: 14.w,
children: [
Expanded(
child: _typeOuterInfoCard(
title: 'خرید',
iconPath: Assets.vec.cubeBottomRotationSvg.path,
foregroundColor: AppColor.blueNormal,
onTap: () {
Get.toNamed(ChickenRoutes.buysOutOfProvince, id: 1);
},
),
saleOrBuyItemCard(
title: 'داخل استان',
iconPath: Assets.vec.cubeSvg.path,
onTap: () {
Get.toNamed(ChickenRoutes.salesInProvince, id: 1);
},
),
Expanded(
child: _typeOuterInfoCard(
title: 'فروش',
iconPath: Assets.vec.cubeTopRotationSvg.path,
foregroundColor: AppColor.greenDark,
onTap: () {
iLog('فروش');
Get.toNamed(ChickenRoutes.salesOutOfProvince, id: 1);
},
),
saleOrBuyItemCard(
title: 'خارج استان',
iconPath: Assets.vec.truckFastSvg.path,
onTap: () {
Get.toNamed(ChickenRoutes.salesOutOfProvince, id: 1);
},
),
],
),
),
],
),
],
),
],
);
}
Widget addSaleOutOfTheProvinceBottomSheet() {
return BaseBottomSheet(
child: Column(