feat: lang

This commit is contained in:
efrilm
2025-08-20 13:52:49 +07:00
parent f07d07b3a8
commit 5a83bc4049
53 changed files with 3386 additions and 721 deletions
@@ -57,7 +57,7 @@ class ReportPaymentMethod extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Payment Methods',
context.lang.payment_methods,
style: AppStyle.xl.copyWith(
fontWeight: FontWeight.bold,
color: AppColor.textPrimary,
@@ -65,7 +65,7 @@ class ReportPaymentMethod extends StatelessWidget {
),
const SizedBox(height: 4),
Text(
'Revenue breakdown by payment method',
context.lang.payment_methods_desc,
style: AppStyle.sm.copyWith(
color: AppColor.textSecondary,
),
@@ -80,7 +80,7 @@ class ReportPaymentMethod extends StatelessWidget {
// Payment Method List
if (paymentMethods.isEmpty)
_buildEmptyState()
_buildEmptyState(context)
else
ListView.separated(
shrinkWrap: true,
@@ -190,12 +190,12 @@ class ReportPaymentMethod extends StatelessWidget {
const SizedBox(height: 16),
// Stats row with better spacing
_buildStatsSection(method),
_buildStatsSection(context, method),
const SizedBox(height: 16),
// Enhanced progress bar section
_buildProgressSection(method, index),
_buildProgressSection(context, method, index),
],
),
),
@@ -410,7 +410,10 @@ class ReportPaymentMethod extends StatelessWidget {
);
}
Widget _buildStatsSection(DashboardPaymentMethod method) {
Widget _buildStatsSection(
BuildContext context,
DashboardPaymentMethod method,
) {
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
@@ -426,7 +429,7 @@ class ReportPaymentMethod extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Total Revenue',
context.lang.total_revenue,
style: AppStyle.xs.copyWith(
color: AppColor.textSecondary,
fontWeight: FontWeight.w500,
@@ -457,7 +460,7 @@ class ReportPaymentMethod extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
'Orders',
context.lang.orders,
style: AppStyle.xs.copyWith(
color: AppColor.textSecondary,
fontWeight: FontWeight.w500,
@@ -480,7 +483,11 @@ class ReportPaymentMethod extends StatelessWidget {
);
}
Widget _buildProgressSection(DashboardPaymentMethod method, int index) {
Widget _buildProgressSection(
BuildContext context,
DashboardPaymentMethod method,
int index,
) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -488,7 +495,7 @@ class ReportPaymentMethod extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Revenue Share',
context.lang.revenue_share,
style: AppStyle.sm.copyWith(
color: AppColor.textSecondary,
fontWeight: FontWeight.w600,
@@ -560,11 +567,10 @@ class ReportPaymentMethod extends StatelessWidget {
);
}
Widget _buildEmptyState() {
Widget _buildEmptyState(BuildContext context) {
return EmptyWidget(
title: 'No Payment Methods',
message:
'Payment method data will appear here once transactions are made',
title: context.lang.no_payment_methods,
message: context.lang.no_payment_methods_desc,
);
}