feat : sale out province
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
class SalesOutOfProvinceLogic extends GetxController {
|
class SalesOutOfProvinceLogic extends GetxController {
|
||||||
|
RxBool isExpanded = false.obs;
|
||||||
|
RxList<int> isExpandedList = <int>[].obs;
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
@@ -14,7 +15,10 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
iconTitle: Assets.vec.chickenSvg.path,
|
iconTitle: Assets.vec.chickenSvg.path,
|
||||||
titleTextStyle: AppFonts.yekan16Bold.copyWith(color: Colors.white),
|
titleTextStyle: AppFonts.yekan16Bold.copyWith(color: Colors.white),
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
hasBack: false,
|
hasBack: true,
|
||||||
|
onBackPressed: () {
|
||||||
|
Get.back(id: 1);
|
||||||
|
},
|
||||||
leadingWidth: 155,
|
leadingWidth: 155,
|
||||||
leading: Row(
|
leading: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@@ -43,9 +47,181 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Container(color: Colors.amber),
|
body: ListView.separated(
|
||||||
|
padding: EdgeInsets.fromLTRB(8, 8, 18, 80),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return ObxValue(
|
||||||
|
(data) => GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
if(data.contains(index)){
|
||||||
|
controller.isExpandedList.remove(index);
|
||||||
|
}else{
|
||||||
|
controller.isExpandedList.add(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: Duration(milliseconds: 400),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
height: data.contains(index)? 210 : 56,
|
||||||
|
child: Stack(
|
||||||
|
clipBehavior: Clip.none,
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
children: [
|
||||||
|
AnimatedContainer(
|
||||||
|
width: Get.width - 30,
|
||||||
|
duration: Duration(milliseconds: 400),
|
||||||
|
height: data.contains(index) ? 210 : 56,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.transparent,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(width: 0.5, color: AppColor.darkGreyNormal),
|
||||||
|
),
|
||||||
|
child: AnimatedCrossFade(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
firstChild: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'1403/5/5',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'افلاک',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'kg 200 مرغ گرم ',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||||
|
),
|
||||||
|
|
||||||
|
Text(
|
||||||
|
'لرستان-خرم آباد',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||||
|
),
|
||||||
|
|
||||||
|
Icon(CupertinoIcons.chevron_down,size: 12,)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
secondChild: Container(
|
||||||
|
padding: EdgeInsets.fromLTRB(8, 12, 14, 12),
|
||||||
|
|
||||||
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||||
|
child: Column(
|
||||||
|
spacing: 8,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Assets.vec.editSvg.svg(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||||
|
),
|
||||||
|
|
||||||
|
Text(
|
||||||
|
'لرستان - خرم آباد',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan16.copyWith(color: AppColor.greenDark),
|
||||||
|
),
|
||||||
|
|
||||||
|
Assets.vec.trashSvg.svg(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
colorFilter: ColorFilter.mode(AppColor.error, BlendMode.srcIn),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 32,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 4),
|
||||||
|
decoration: ShapeDecoration(
|
||||||
|
color: AppColor.blueLight,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: buildRow('تاریخ', '07:15:00 - 1402/07/01'),
|
||||||
|
),
|
||||||
|
|
||||||
|
buildRow('مشخصات فروشنده', 'افلاک - 09203659874'),
|
||||||
|
buildRow('وزن خریداری شده', '200 کیلوگرم'),
|
||||||
|
buildRow('لاشه خریداری شده', '200 عدد'),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Icon(CupertinoIcons.chevron_up,size: 12,)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
crossFadeState: data.contains(index)?CrossFadeState.showSecond:CrossFadeState.showFirst,
|
||||||
|
duration: Duration(milliseconds: 200),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
right: -12,
|
||||||
|
child: Container(
|
||||||
|
width: index < 999 ? 24 : null,
|
||||||
|
height: index < 999 ? 24 : null,
|
||||||
|
padding: EdgeInsets.all(2),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.greenLightHover,
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
border: Border.all(width: 0.50, color: AppColor.greenDarkActive),
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text((index + 1).toString(), style: AppFonts.yekan12.copyWith(color: Colors.black)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
controller.isExpandedList,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (context, index) => SizedBox(height: 8),
|
||||||
|
itemCount: 5,
|
||||||
|
),
|
||||||
floatingActionButton: RFab.add(onPressed: () {}),
|
floatingActionButton: RFab.add(onPressed: () {}),
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
|
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:rasadyar_chicken/presentation/pages/entering_the_warehouse/view.
|
|||||||
import 'package:rasadyar_chicken/presentation/pages/home/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/home/logic.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/home/view.dart';
|
import 'package:rasadyar_chicken/presentation/pages/home/view.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/out_of_province/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/out_of_province/logic.dart';
|
||||||
|
import 'package:rasadyar_chicken/presentation/pages/out_of_province/view.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/root/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/root/logic.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/root/view.dart';
|
import 'package:rasadyar_chicken/presentation/pages/root/view.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/sales_in_province/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/sales_in_province/logic.dart';
|
||||||
@@ -28,6 +29,7 @@ sealed class ChickenPages {
|
|||||||
Get.lazyPut(()=>HomeLogic());
|
Get.lazyPut(()=>HomeLogic());
|
||||||
Get.lazyPut(()=>SalesInProvinceLogic());
|
Get.lazyPut(()=>SalesInProvinceLogic());
|
||||||
Get.lazyPut(()=>OutOfProvinceLogic());
|
Get.lazyPut(()=>OutOfProvinceLogic());
|
||||||
|
Get.lazyPut(()=>SalesOutOfProvinceLogic());
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -59,6 +61,20 @@ sealed class ChickenPages {
|
|||||||
Get.put(RootLogic());
|
Get.put(RootLogic());
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GetPage(
|
||||||
|
name: ChickenRoutes.outOfProvince,
|
||||||
|
page: () => OutOfProvincePage(),
|
||||||
|
middlewares: [AuthMiddleware()],
|
||||||
|
binding: BindingsBuilder(() {
|
||||||
|
Get.put(OutOfProvinceLogic());
|
||||||
|
Get.put(SalesOutOfProvinceLogic());
|
||||||
|
Get.put(RootLogic());
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
|
||||||
GetPage(
|
GetPage(
|
||||||
name: ChickenRoutes.salesOutOfProvince,
|
name: ChickenRoutes.salesOutOfProvince,
|
||||||
page: () => SalesOutOfProvincePage(),
|
page: () => SalesOutOfProvincePage(),
|
||||||
|
|||||||
Reference in New Issue
Block a user