feat: lang
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../../application/analytic/inventory_analytic_loader/inventory_analytic_loader_bloc.dart';
|
||||
import '../../../common/extension/extension.dart';
|
||||
import '../../../common/theme/theme.dart';
|
||||
import '../../../domain/analytic/analytic.dart';
|
||||
import '../../../injection.dart';
|
||||
@@ -95,11 +96,11 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
String getStatusText(String status) {
|
||||
switch (status) {
|
||||
case 'available':
|
||||
return 'Tersedia';
|
||||
return context.lang.available;
|
||||
case 'low_stock':
|
||||
return 'Stok Rendah';
|
||||
return context.lang.low_stock;
|
||||
case 'out_of_stock':
|
||||
return 'Habis';
|
||||
return context.lang.out_of_stock;
|
||||
default:
|
||||
return 'Unknown';
|
||||
}
|
||||
@@ -189,7 +190,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
),
|
||||
child: const Row(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
@@ -199,7 +200,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
size: 16,
|
||||
),
|
||||
SizedBox(width: 6),
|
||||
Text('Produk'),
|
||||
Text(context.lang.product),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -210,7 +211,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
),
|
||||
child: const Row(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
@@ -220,7 +221,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
size: 16,
|
||||
),
|
||||
SizedBox(width: 6),
|
||||
Text('Bahan'),
|
||||
Text(context.lang.ingredients),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -254,7 +255,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
pinned: true,
|
||||
elevation: 0,
|
||||
backgroundColor: AppColor.primary,
|
||||
flexibleSpace: CustomAppBar(title: 'Inventaris'),
|
||||
flexibleSpace: CustomAppBar(title: context.lang.inventory),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -308,7 +309,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildStatCard(
|
||||
'Total Produk',
|
||||
context.lang.total_products,
|
||||
inventory.totalProducts.toString(),
|
||||
Icons.inventory_2_rounded,
|
||||
AppColor.primary,
|
||||
@@ -317,7 +318,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: _buildStatCard(
|
||||
'Produk Terjual',
|
||||
context.lang.total_sold,
|
||||
inventory.totalSoldProducts.toString(),
|
||||
Icons.check_circle_rounded,
|
||||
AppColor.success,
|
||||
@@ -330,7 +331,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildStatCard(
|
||||
'Stok Rendah',
|
||||
context.lang.low_stock,
|
||||
inventory.lowStockProducts.toString(),
|
||||
Icons.warning_rounded,
|
||||
AppColor.warning,
|
||||
@@ -339,7 +340,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: _buildStatCard(
|
||||
'Stok Kosong',
|
||||
context.lang.zero_stock,
|
||||
inventory.zeroStockProducts.toString(),
|
||||
Icons.error_rounded,
|
||||
AppColor.error,
|
||||
@@ -361,7 +362,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildStatCard(
|
||||
'Total Bahan',
|
||||
context.lang.total_ingredients,
|
||||
inventory.totalIngredients.toString(),
|
||||
Icons.restaurant_menu_rounded,
|
||||
AppColor.primary,
|
||||
@@ -370,7 +371,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: _buildStatCard(
|
||||
'Bahan Terjual',
|
||||
context.lang.total_sold,
|
||||
inventory.totalSoldIngredients.toString(),
|
||||
Icons.check_circle_rounded,
|
||||
AppColor.success,
|
||||
@@ -383,7 +384,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildStatCard(
|
||||
'Stok Kurang',
|
||||
context.lang.low_stock,
|
||||
inventory.lowStockIngredients.toString(),
|
||||
Icons.warning_rounded,
|
||||
AppColor.warning,
|
||||
@@ -392,7 +393,7 @@ class _InventoryPageState extends State<InventoryPage>
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: _buildStatCard(
|
||||
'Habis',
|
||||
context.lang.zero_stock,
|
||||
inventory.zeroStockIngredients.toString(),
|
||||
Icons.error_rounded,
|
||||
AppColor.error,
|
||||
|
||||
Reference in New Issue
Block a user