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/utils/nested_keys_utils.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'; class SalePage extends GetView { SalePage({super.key}); @override Widget build(BuildContext context) { return ChickenBasePage( routes: controller.routesName, isBase: true, widgets: [ Row( mainAxisAlignment: MainAxisAlignment.center, spacing: 21, children: [ GlassMorphismCardIcon( title: 'فروش داخل استان', vecIcon: Assets.vec.map2Svg.path, onTap: () { Get.toNamed(ChickenRoutes.salesInProvinceSteward, id: stewardSecondKey); }, ), GlassMorphismCardIcon( title: 'فروش خارج استان', vecIcon: Assets.vec.saleOutProvinceSvg.path, onTap: () { Get.toNamed(ChickenRoutes.salesOutOfProvinceSteward, id: stewardSecondKey); }, ), ], ), ], ); } Widget addSaleOutOfTheProvinceBottomSheet() { return BaseBottomSheet( child: Column( children: [ const SizedBox(height: 20), Align( alignment: Alignment.centerRight, child: Text( 'ثبت فروش خارج استان', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), ), ), SizedBox(height: 4), RElevated(text: 'ثبت توزیع/ فروش', onPressed: () {}), ], ), ); } Widget _typeOuterInfoCard({ required String title, required String iconPath, required Color foregroundColor, VoidCallback? onTap, }) { return InkWell( onTap: onTap, child: Container( height: 180, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8), border: Border.all(width: 1, color: foregroundColor), ), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ Stack( clipBehavior: Clip.none, alignment: Alignment.center, children: [ Positioned( top: -41, child: SvgGenImage.vec(iconPath).svg( width: 45, height: 45, colorFilter: ColorFilter.mode(foregroundColor, BlendMode.srcIn), ), ), Assets.vec.shoppingBasketSvg.svg( width: 55, height: 60, colorFilter: ColorFilter.mode(foregroundColor, BlendMode.srcIn), fit: BoxFit.cover, ), ], ), const SizedBox(height: 15), Text( title, textAlign: TextAlign.right, style: AppFonts.yekan16Bold.copyWith(color: foregroundColor), ), ], ), ), ); } Widget summaryOfInformation(StewardFreeBarDashboard? model) { return Column( children: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: Row( children: [ Text( 'خلاصه اطلاعات', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), ), ], ), ), Container( height: 140, margin: const EdgeInsets.all(8), padding: const EdgeInsets.all(12), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8), border: Border.all(color: AppColor.blueNormal, width: 1), ), child: model == null ? const Center(child: CircularProgressIndicator()) : Column( crossAxisAlignment: CrossAxisAlignment.start, spacing: 10, children: [ const SizedBox(height: 12), buildRow('تعداد کل بارها', model.totalQuantity?.toString() ?? '0'), buildRow('تعداد کل', model.totalBars?.toString() ?? '0'), buildRow('وزن کل (کیلوگرم)', model.totalWeight?.toString() ?? '0'), ], ), ), ], ); } Widget buildRow(String title, String value) { return Padding( padding: const EdgeInsets.symmetric(vertical: 4.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Flexible( flex: 2, child: Text( title, textAlign: TextAlign.right, style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), ), ), Flexible( flex: 2, child: Text( value, textAlign: TextAlign.left, style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), ), ), ], ), ); } }