feat: lang
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:line_icons/line_icons.dart';
|
||||
|
||||
import '../../../../common/extension/extension.dart';
|
||||
import '../../../../common/theme/theme.dart';
|
||||
import '../../../router/app_router.gr.dart';
|
||||
import 'feature_tile.dart';
|
||||
@@ -36,25 +37,25 @@ class HomeFeature extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
HomeFeatureTile(
|
||||
title: 'Penjualan',
|
||||
title: context.lang.sales,
|
||||
color: const Color(0xFF4CAF50),
|
||||
icon: LineIcons.receipt,
|
||||
onTap: () => context.router.push(SalesRoute()),
|
||||
),
|
||||
HomeFeatureTile(
|
||||
title: 'Pembelian',
|
||||
title: context.lang.purchase,
|
||||
color: const Color(0xFF2196F3),
|
||||
icon: LineIcons.shoppingCart,
|
||||
onTap: () => context.router.push(PurchaseRoute()),
|
||||
),
|
||||
HomeFeatureTile(
|
||||
title: 'Keuangan',
|
||||
title: context.lang.finance,
|
||||
color: const Color(0xFF8BC34A),
|
||||
icon: LineIcons.moneyCheck,
|
||||
onTap: () => context.router.push(FinanceRoute()),
|
||||
),
|
||||
HomeFeatureTile(
|
||||
title: 'Produk',
|
||||
title: context.lang.product,
|
||||
color: const Color(0xFFFF9800),
|
||||
icon: LineIcons.box,
|
||||
onTap: () => context.router.push(ProductAnalyticRoute()),
|
||||
@@ -66,25 +67,25 @@ class HomeFeature extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
HomeFeatureTile(
|
||||
title: 'Form',
|
||||
title: context.lang.form,
|
||||
color: const Color(0xFFE91E63),
|
||||
icon: LineIcons.fileAlt,
|
||||
onTap: () => context.router.push(DailyTasksFormRoute()),
|
||||
),
|
||||
HomeFeatureTile(
|
||||
title: 'Jadwal',
|
||||
title: context.lang.schedule,
|
||||
color: const Color(0xFF9C27B0),
|
||||
icon: LineIcons.calendar,
|
||||
onTap: () => context.router.push(ScheduleRoute()),
|
||||
),
|
||||
HomeFeatureTile(
|
||||
title: 'Inventaris',
|
||||
title: context.lang.inventory,
|
||||
color: const Color(0xFF00BCD4),
|
||||
icon: LineIcons.archive,
|
||||
onTap: () => context.router.push(InventoryRoute()),
|
||||
),
|
||||
HomeFeatureTile(
|
||||
title: 'Pelanggan',
|
||||
title: context.lang.customer,
|
||||
color: const Color(0xFFFF5722),
|
||||
icon: LineIcons.userPlus,
|
||||
onTap: () => context.router.push(CustomerRoute()),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:line_icons/line_icons.dart';
|
||||
|
||||
import '../../../../common/extension/extension.dart';
|
||||
import '../../../../common/theme/theme.dart';
|
||||
import '../../../../domain/analytic/analytic.dart';
|
||||
import '../../../components/spacer/spacer.dart';
|
||||
@@ -21,30 +22,30 @@ class HomeStats extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
HomeTitle(title: 'Ringkasan Hari Ini'),
|
||||
HomeTitle(title: context.lang.today_summary),
|
||||
const SpaceHeight(20),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: HomeStatsTile(
|
||||
title: 'Pesanan',
|
||||
title: context.lang.order,
|
||||
value: overview.totalOrders.toString(),
|
||||
icon: Icons.receipt_long_rounded,
|
||||
color: AppColor.info,
|
||||
subtitle: 'Hari ini',
|
||||
subtitle: context.lang.today,
|
||||
),
|
||||
),
|
||||
|
||||
const SpaceWidth(16),
|
||||
Expanded(
|
||||
child: HomeStatsTile(
|
||||
title: 'Pelanggan Baru',
|
||||
title: context.lang.new_customer,
|
||||
value: overview.totalCustomers.toString(),
|
||||
icon: Icons.person_add_outlined,
|
||||
color: AppColor.primary,
|
||||
subtitle: overview.totalCustomers < 1
|
||||
? 'Hari ini'
|
||||
: 'bertambah',
|
||||
? context.lang.today
|
||||
: context.lang.increase,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -54,21 +55,21 @@ class HomeStats extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: HomeStatsTile(
|
||||
title: 'Refund',
|
||||
title: context.lang.refund,
|
||||
value: overview.refundedOrders.toString(),
|
||||
icon: LineIcons.alternateExchange,
|
||||
color: AppColor.warning,
|
||||
subtitle: 'Hari ini',
|
||||
subtitle: context.lang.today,
|
||||
),
|
||||
),
|
||||
const SpaceWidth(16),
|
||||
Expanded(
|
||||
child: HomeStatsTile(
|
||||
title: 'Void',
|
||||
title: context.lang.void_text,
|
||||
value: overview.voidedOrders.toString(),
|
||||
icon: Icons.cancel_rounded,
|
||||
color: AppColor.error,
|
||||
subtitle: 'Hari ini',
|
||||
subtitle: context.lang.today,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../common/extension/extension.dart';
|
||||
import '../../../../common/theme/theme.dart';
|
||||
import '../../../../domain/analytic/analytic.dart';
|
||||
import '../../../components/spacer/spacer.dart';
|
||||
@@ -19,12 +20,13 @@ class HomeTopProduct extends StatelessWidget {
|
||||
).copyWith(bottom: 0),
|
||||
child: Column(
|
||||
children: [
|
||||
HomeTitle(title: 'Product Terlaris Hari Ini'),
|
||||
HomeTitle(title: context.lang.today_top_product),
|
||||
SpaceHeight(20),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: products.length,
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (context, index) {
|
||||
return HomeTopProductTile(
|
||||
product: products[index],
|
||||
|
||||
@@ -44,7 +44,7 @@ class HomeTopProductTile extends StatelessWidget {
|
||||
// Header Row - Ranking dan Revenue
|
||||
Row(
|
||||
children: [
|
||||
_buildRankingBadge(),
|
||||
_buildRankingBadge(context),
|
||||
const Spacer(),
|
||||
_buildRevenueDisplay(),
|
||||
],
|
||||
@@ -71,7 +71,7 @@ class HomeTopProductTile extends StatelessWidget {
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// Metrics dalam Grid 2x2
|
||||
_buildMetricsGrid(),
|
||||
_buildMetricsGrid(context),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -80,7 +80,7 @@ class HomeTopProductTile extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildRankingBadge() {
|
||||
Widget _buildRankingBadge(BuildContext context) {
|
||||
Color badgeColor;
|
||||
IconData icon;
|
||||
|
||||
@@ -115,7 +115,7 @@ class HomeTopProductTile extends StatelessWidget {
|
||||
Icon(icon, color: badgeColor, size: 16),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
'Rank #$ranking',
|
||||
'${context.lang.rank} #$ranking',
|
||||
style: AppStyle.sm.copyWith(
|
||||
color: badgeColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -157,7 +157,7 @@ class HomeTopProductTile extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMetricsGrid() {
|
||||
Widget _buildMetricsGrid(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -165,14 +165,14 @@ class HomeTopProductTile extends StatelessWidget {
|
||||
children: [
|
||||
_buildMetricCard(
|
||||
icon: Icons.shopping_cart_outlined,
|
||||
label: 'Quantity Sold',
|
||||
label: context.lang.quantity_sold,
|
||||
value: product.quantitySold.toString(),
|
||||
color: AppColor.info,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_buildMetricCard(
|
||||
icon: Icons.attach_money,
|
||||
label: 'Average Price',
|
||||
label: context.lang.average_price,
|
||||
value: product.averagePrice.round().currencyFormatRp,
|
||||
color: AppColor.success,
|
||||
),
|
||||
@@ -185,14 +185,14 @@ class HomeTopProductTile extends StatelessWidget {
|
||||
children: [
|
||||
_buildMetricCard(
|
||||
icon: Icons.receipt_outlined,
|
||||
label: 'Total Orders',
|
||||
label: context.lang.total_orders,
|
||||
value: product.orderCount.toString(),
|
||||
color: AppColor.warning,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_buildMetricCard(
|
||||
icon: Icons.trending_up,
|
||||
label: 'Performance',
|
||||
label: context.lang.perfomance,
|
||||
value: 'Top $ranking',
|
||||
color: AppColor.primary,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user