feat : statistics page

This commit is contained in:
2025-07-27 09:26:48 +03:30
parent bafa24543d
commit d192419ac8
8 changed files with 138 additions and 71 deletions

View File

@@ -150,57 +150,102 @@ class StatisticsPage extends GetView<StatisticsLogic> {
),
SizedBox(height: 8.h),
Container(
height: 152.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.lightGreyNormalHover, width: 1),
),
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 10, 0, 13),
child: Row(
spacing: 8,
children: [
Expanded(
child: ObxValue(
(data) => _informationLabelCard(
title: 'تعداد تراکنش ها',
titleColor: AppColor.blueNormal,
isLoading: data.value == null,
description: 25369654.separatedByComma,
iconPath: Assets.vec.cubeSearchSvg.path,
iconColor: AppColor.blueNormal,
bgDescriptionColor: Colors.white,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [AppColor.blueLight, Colors.white],
padding: EdgeInsets.all(8),
child: Column(
spacing: 8,
children: [
Row(
spacing: 8,
children: [
Expanded(
child: ObxValue(
(data) => _informationLabelCard(
title: 'تعداد تراکنش ها',
titleColor: AppColor.blueNormal,
isLoading: data.value == null,
description: 25369654.separatedByComma,
iconPath: Assets.vec.cubeScanSvg.path,
bgDescriptionColor: Colors.white,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [AppColor.blueLight, Colors.white],
),
),
controller.s1,
),
controller.s1,
),
),
Expanded(
child: ObxValue((data) {
return _informationLabelCard(
title: 'جمع تراکنش ها',
isLoading: data.value == null,
description: data.value.separatedByComma ?? '0',
unit: 'ريال',
iconPath: Assets.vec.cubeWattingSvg.path,
bgDescriptionColor: Colors.white,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [const Color(0xFFFFE7BB), Colors.white],
),
);
}, controller.s2),
),
],
),
Expanded(
child: ObxValue((data) {
return _informationLabelCard(
title: 'جمع تراکنش ها',
isLoading: data.value == null,
description: data.value.separatedByComma ?? '0',
unit: 'ريال',
iconPath: Assets.vec.cubeCardSvg.path,
bgDescriptionColor: Colors.white,
titleColor: AppColor.greenDarkHover,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [AppColor.greenLightHover, Colors.white],
),
);
}, controller.s2),
),
],
),
Row(
spacing: 16,
mainAxisAlignment: MainAxisAlignment.center,
children: [
RElevated(
width: 160.w,
height: 40.h,
backgroundColor: AppColor.greenNormal,
onPressed: () {},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Assets.vec.excelDownloadSvg.svg(
width: 24.w,
height: 24.h,
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
),
SizedBox(width: 4.w),
Text('EXCEL', style: AppFonts.yekan14.copyWith(color: Colors.white)),
],
),
),
ROutlinedElevated(
width: 160.w,
height: 40.h,
borderColor: AppColor.error,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Assets.vec.pdfDownloadSvg.svg(
width: 24.w,
height: 24.h,
colorFilter: const ColorFilter.mode(AppColor.error, BlendMode.srcIn),
),
SizedBox(width: 4.w),
Text('PDF', style: AppFonts.yekan14.copyWith(color: AppColor.error)),
],
),
),
],
),
],
),
),
SizedBox(height: 8.h),
],
),
);
@@ -239,7 +284,6 @@ class StatisticsPage extends GetView<StatisticsLogic> {
}) {
return Container(
height: 82.h,
margin: EdgeInsets.symmetric(horizontal: 12.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.lightGreyNormalHover, width: 1),
@@ -249,10 +293,10 @@ class StatisticsPage extends GetView<StatisticsLogic> {
children: [
// Left side with icon and title
Expanded(
flex: 2,
flex: 91,
child: Container(
height: 82.h,
padding: EdgeInsets.all(8),
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: gradient == null ? bgLabelColor : null,
borderRadius: BorderRadius.only(
@@ -263,7 +307,7 @@ class StatisticsPage extends GetView<StatisticsLogic> {
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 4,
spacing: 8,
children: [
SvgGenImage.vec(iconPath).svg(
width: 24,
@@ -285,7 +329,7 @@ class StatisticsPage extends GetView<StatisticsLogic> {
),
// Right side with description and unit
Expanded(
flex: 3,
flex: 109,
child: Container(
decoration: BoxDecoration(
color: bgDescriptionColor,
@@ -302,13 +346,13 @@ class StatisticsPage extends GetView<StatisticsLogic> {
children: [
Text(
description,
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
),
Visibility(
visible: unit != null,
child: Text(
unit,
unit ?? '',
textAlign: TextAlign.center,
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
),