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
@@ -182,7 +182,11 @@ class InventoryProductTile extends StatelessWidget {
],
),
child: Text(
_getStatusText(),
item.isZeroStock
? context.lang.out_of_stock
: item.isLowStock
? context.lang.low_stock
: context.lang.available,
style: AppStyle.xs.copyWith(
fontSize: 10,
fontWeight: FontWeight.w700,
@@ -202,7 +206,7 @@ class InventoryProductTile extends StatelessWidget {
Expanded(
child: _buildInfoItem(
LineIcons.boxes,
'Stok',
context.lang.stock,
'${NumberFormat('#,###', 'id_ID').format(item.quantity)} pcs',
_getQuantityColor(),
),
@@ -212,7 +216,7 @@ class InventoryProductTile extends StatelessWidget {
Expanded(
child: _buildInfoItem(
LineIcons.dollarSign,
'Nilai',
context.lang.value_text,
_formatCurrencyShort(item.totalValue),
AppColor.info,
),
@@ -259,14 +263,19 @@ class InventoryProductTile extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Stok Menipis',
context.lang.low_stock,
style: AppStyle.sm.copyWith(
fontWeight: FontWeight.w600,
color: AppColor.warning,
),
),
Text(
'Segera reorder minimal ${NumberFormat('#,###', 'id_ID').format(item.reorderLevel)} pcs',
context.lang.low_stock_desc(
NumberFormat(
'#,###',
'id_ID',
).format(item.reorderLevel),
),
style: AppStyle.xs.copyWith(
color: AppColor.textSecondary,
fontWeight: FontWeight.w500,
@@ -301,14 +310,14 @@ class InventoryProductTile extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Stok Habis',
context.lang.out_of_stock,
style: AppStyle.sm.copyWith(
fontWeight: FontWeight.w600,
color: AppColor.error,
),
),
Text(
'Produk tidak tersedia untuk dijual',
context.lang.out_of_stock_desc,
style: AppStyle.xs.copyWith(
color: AppColor.textSecondary,
fontWeight: FontWeight.w500,
@@ -330,7 +339,7 @@ class InventoryProductTile extends StatelessWidget {
Expanded(
child: _buildMovementInfo(
LineIcons.arrowUp,
'Masuk',
context.lang.in_text,
'${NumberFormat('#,###', 'id_ID').format(item.totalIn)} pcs',
AppColor.success,
),
@@ -341,7 +350,7 @@ class InventoryProductTile extends StatelessWidget {
Expanded(
child: _buildMovementInfo(
LineIcons.arrowDown,
'Keluar',
context.lang.out_text,
'${NumberFormat('#,###', 'id_ID').format(item.totalOut)} pcs',
AppColor.error,
),
@@ -476,12 +485,6 @@ class InventoryProductTile extends StatelessWidget {
return AppColor.textPrimary;
}
String _getStatusText() {
if (item.isZeroStock) return 'HABIS';
if (item.isLowStock) return 'MINIM';
return 'TERSEDIA';
}
IconData _getCategoryIcon() {
final category = item.categoryName.toLowerCase();
if (category.contains('elektronik') || category.contains('gadget')) {