feat: lang
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../../../application/analytic/product_analytic_loader/product_analytic_loader_bloc.dart';
|
||||
import '../../../../common/extension/extension.dart';
|
||||
import '../../../../common/theme/theme.dart';
|
||||
import '../../../../domain/analytic/analytic.dart';
|
||||
import '../../../../injection.dart';
|
||||
@@ -136,18 +137,7 @@ class _ProductAnalyticPageState extends State<ProductAnalyticPage>
|
||||
pinned: true,
|
||||
elevation: 0,
|
||||
backgroundColor: AppColor.primary,
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
background: Container(
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: AppColor.primaryGradient,
|
||||
),
|
||||
),
|
||||
child: const CustomAppBar(title: "Analisis Produk"),
|
||||
),
|
||||
),
|
||||
flexibleSpace: CustomAppBar(title: context.lang.product_analytic),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -214,7 +204,7 @@ class _ProductAnalyticPageState extends State<ProductAnalyticPage>
|
||||
Expanded(
|
||||
child: _buildSummaryCard(
|
||||
icon: Icons.monetization_on,
|
||||
title: 'Total Pendapatan',
|
||||
title: context.lang.total_revenue,
|
||||
value: _formatCurrency(stats.totalRevenue),
|
||||
color: AppColor.success,
|
||||
),
|
||||
@@ -223,7 +213,7 @@ class _ProductAnalyticPageState extends State<ProductAnalyticPage>
|
||||
Expanded(
|
||||
child: _buildSummaryCard(
|
||||
icon: Icons.shopping_cart,
|
||||
title: 'Total Terjual',
|
||||
title: context.lang.total_sold,
|
||||
value: _formatNumber(stats.totalQuantity),
|
||||
color: AppColor.info,
|
||||
),
|
||||
@@ -236,7 +226,7 @@ class _ProductAnalyticPageState extends State<ProductAnalyticPage>
|
||||
Expanded(
|
||||
child: _buildSummaryCard(
|
||||
icon: Icons.receipt_long,
|
||||
title: 'Total Pesanan',
|
||||
title: context.lang.total_orders,
|
||||
value: _formatNumber(stats.totalOrders),
|
||||
color: AppColor.warning,
|
||||
),
|
||||
@@ -245,7 +235,7 @@ class _ProductAnalyticPageState extends State<ProductAnalyticPage>
|
||||
Expanded(
|
||||
child: _buildSummaryCard(
|
||||
icon: Icons.trending_up,
|
||||
title: 'Rata-rata Nilai',
|
||||
title: context.lang.average_price,
|
||||
value: _formatCurrency(stats.averageOrderValue),
|
||||
color: AppColor.primary,
|
||||
),
|
||||
@@ -541,7 +531,7 @@ class _ProductAnalyticPageState extends State<ProductAnalyticPage>
|
||||
Icon(Icons.trending_up, color: AppColor.success, size: 20),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Pendapatan',
|
||||
context.lang.revenue,
|
||||
style: _getTextStyle(
|
||||
AppStyle.sm,
|
||||
color: AppColor.success,
|
||||
@@ -552,7 +542,7 @@ class _ProductAnalyticPageState extends State<ProductAnalyticPage>
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
_formatCurrency(product.revenue.toDouble()),
|
||||
product.revenue.currencyFormatRp,
|
||||
style: _getTextStyle(
|
||||
AppStyle.xl,
|
||||
color: AppColor.success,
|
||||
@@ -570,14 +560,14 @@ class _ProductAnalyticPageState extends State<ProductAnalyticPage>
|
||||
_buildStatCard(
|
||||
icon: Icons.shopping_cart_outlined,
|
||||
value: '${product.quantitySold}',
|
||||
label: 'Terjual',
|
||||
label: context.lang.sold,
|
||||
color: AppColor.info,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_buildStatCard(
|
||||
icon: Icons.receipt_outlined,
|
||||
value: '${product.orderCount}',
|
||||
label: 'Pesanan',
|
||||
label: context.lang.orders,
|
||||
color: AppColor.warning,
|
||||
),
|
||||
],
|
||||
@@ -645,7 +635,7 @@ class _ProductAnalyticPageState extends State<ProductAnalyticPage>
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Harga Rata-rata',
|
||||
context.lang.average_price,
|
||||
style: _getTextStyle(
|
||||
AppStyle.sm,
|
||||
color: AppColor.textSecondary,
|
||||
@@ -653,7 +643,7 @@ class _ProductAnalyticPageState extends State<ProductAnalyticPage>
|
||||
),
|
||||
),
|
||||
Text(
|
||||
_formatCurrency(product.averagePrice),
|
||||
product.averagePrice.round().currencyFormatRp,
|
||||
style: _getTextStyle(
|
||||
AppStyle.sm,
|
||||
color: _getCategoryColor(product.categoryName),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:shimmer/shimmer.dart';
|
||||
|
||||
import '../../../../application/category/category_loader/category_loader_bloc.dart';
|
||||
import '../../../../application/product/product_loader/product_loader_bloc.dart';
|
||||
import '../../../../common/extension/extension.dart';
|
||||
import '../../../../common/theme/theme.dart';
|
||||
import '../../../../domain/category/category.dart';
|
||||
import '../../../../domain/product/product.dart';
|
||||
@@ -83,7 +84,7 @@ class _ProductPageState extends State<ProductPage>
|
||||
child: CustomScrollView(
|
||||
controller: scrollController,
|
||||
slivers: [
|
||||
_buildSliverAppBar(),
|
||||
_buildSliverAppBar(context),
|
||||
_buildCategoryFilter(),
|
||||
_buildProductContent(state),
|
||||
],
|
||||
@@ -95,13 +96,13 @@ class _ProductPageState extends State<ProductPage>
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSliverAppBar() {
|
||||
Widget _buildSliverAppBar(BuildContext context) {
|
||||
return SliverAppBar(
|
||||
expandedHeight: 120.0,
|
||||
floating: false,
|
||||
pinned: true,
|
||||
elevation: 0,
|
||||
flexibleSpace: CustomAppBar(title: 'Produk'),
|
||||
flexibleSpace: CustomAppBar(title: context.lang.product),
|
||||
actions: [
|
||||
ActionIconButton(onTap: () {}, icon: LineIcons.search),
|
||||
ActionIconButton(
|
||||
|
||||
Reference in New Issue
Block a user