fix: ui changes steward
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
Widget labelItem({required String label, String? value, String? unit}) {
|
||||
Widget labelItem({required String label, String? value, String? unit, VoidCallback? onTap}) {
|
||||
String getLabelText(String? value, String? unit) {
|
||||
if (value != null && unit != null) {
|
||||
return '$value ($unit)';
|
||||
@@ -12,44 +12,47 @@ Widget labelItem({required String label, String? value, String? unit}) {
|
||||
}
|
||||
}
|
||||
|
||||
return Container(
|
||||
height: 49.h,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.fromLTRB(8.w, 7.h, 8.w, 7.h),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: const Color(0xFFB9B9B9)),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 6,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.unselectTextColor),
|
||||
),
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
height: 49.h,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.fromLTRB(8.w, 7.h, 8.w, 7.h),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: const Color(0xFFB9B9B9)),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 6,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
spacing: 4,
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.unselectTextColor),
|
||||
),
|
||||
|
||||
Assets.vec.arrowLeftSvg.svg(
|
||||
width: 10.w,
|
||||
height: 10.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.unselectTextColor, BlendMode.srcIn),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
getLabelText(value, unit),
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.iconColor),
|
||||
),
|
||||
],
|
||||
Assets.vec.arrowLeftSvg.svg(
|
||||
width: 10.w,
|
||||
height: 10.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.unselectTextColor, BlendMode.srcIn),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
getLabelText(value, unit),
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.iconColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.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';
|
||||
|
||||
import 'logic.dart';
|
||||
@@ -30,60 +31,57 @@ class WidelyUsedWidget extends StatelessWidget {
|
||||
children: [
|
||||
widelyUsed(
|
||||
title: 'خرید خارج استان',
|
||||
iconPath: Assets.vec.truckFastSvg.path,
|
||||
iconPath: Assets.vec.map1Svg.path,
|
||||
isOnEdit: false,
|
||||
|
||||
cardColor: AppColor.greenLightActive,
|
||||
labelColor: AppColor.greenNormal,
|
||||
textColor: AppColor.greenDarkHover,
|
||||
onTap: () async {
|
||||
controller.rootLogic.currentPage.value = 0;
|
||||
controller.rootLogic.currentPage.refresh();
|
||||
await Future.delayed(Duration(milliseconds: 100));
|
||||
Get.toNamed(ChickenRoutes.buysOutOfProvinceSteward, id: 0);
|
||||
Get.toNamed(ChickenRoutes.buysOutOfProvinceSteward, id: stewardFirstKey);
|
||||
},
|
||||
),
|
||||
|
||||
widelyUsed(
|
||||
title: 'خرید داخل استان',
|
||||
iconPath: Assets.vec.cubeSvg.path,
|
||||
iconPath: Assets.vec.buyOutProvinceSvg.path,
|
||||
cardColor: AppColor.greenLightActive,
|
||||
labelColor: AppColor.greenNormal,
|
||||
textColor: AppColor.greenDarkHover,
|
||||
onTap: () async {
|
||||
controller.rootLogic.currentPage.value = 0;
|
||||
controller.rootLogic.currentPage.refresh();
|
||||
await Future.delayed(Duration(milliseconds: 100));
|
||||
Get.toNamed(ChickenRoutes.buysInProvinceSteward, id: 0);
|
||||
Get.toNamed(ChickenRoutes.buysInProvinceSteward, id: stewardFirstKey);
|
||||
},
|
||||
isOnEdit: false,
|
||||
),
|
||||
|
||||
widelyUsed(
|
||||
title: 'فروش خارج استان',
|
||||
iconPath: Assets.vec.truckFastSvg.path,
|
||||
iconPath: Assets.vec.map2Svg.path,
|
||||
isOnEdit: false,
|
||||
onTap: () async {
|
||||
controller.rootLogic.currentPage.value = 1;
|
||||
controller.rootLogic.currentPage.refresh();
|
||||
await Future.delayed(Duration(milliseconds: 100));
|
||||
Get.toNamed(ChickenRoutes.salesOutOfProvinceSteward, id: 1);
|
||||
Get.toNamed(ChickenRoutes.salesOutOfProvinceSteward, id: stewardSecondKey);
|
||||
},
|
||||
),
|
||||
|
||||
widelyUsed(
|
||||
title: 'فروش داخل استان',
|
||||
iconPath: Assets.vec.cubeSvg.path,
|
||||
iconPath: Assets.vec.saleOutProvinceSvg.path,
|
||||
isOnEdit: false,
|
||||
onTap: () async {
|
||||
controller.rootLogic.currentPage.value = 1;
|
||||
controller.rootLogic.currentPage.refresh();
|
||||
await Future.delayed(Duration(milliseconds: 100));
|
||||
Get.toNamed(ChickenRoutes.salesInProvinceSteward, id: 1);
|
||||
Get.toNamed(ChickenRoutes.salesInProvinceSteward, id: stewardSecondKey);
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: -17,
|
||||
@@ -123,23 +121,24 @@ class WidelyUsedWidget extends StatelessWidget {
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
width: 48.w,
|
||||
height: 48.h,
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: ShapeDecoration(
|
||||
color: cardColor ?? Color(0xFFBECDFF),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
decoration: ShapeDecoration(
|
||||
color: labelColor ?? AppColor.blueNormal,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
padding: EdgeInsets.all(4),
|
||||
child: SvgGenImage.vec(iconPath).svg(
|
||||
width: 24,
|
||||
height: 24,
|
||||
width: 24.w,
|
||||
height: 24.h,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
@@ -184,7 +183,7 @@ class WidelyUsedWidget extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(title, style: AppFonts.yekan10.copyWith(color: textColor ?? AppColor.blueNormal)),
|
||||
Text(title, style: AppFonts.yekan10.copyWith(color: textColor ?? AppColor.textColor)),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user