feat: language

This commit is contained in:
efrilm
2025-08-13 01:17:00 +07:00
parent 3d43d7a934
commit 83edfa61f1
29 changed files with 1539 additions and 156 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
slivers: [
// SliverAppBar with HomeHeader as background
SliverAppBar(
expandedHeight: 250, // Adjust based on HomeHeader height
expandedHeight: 260, // Adjust based on HomeHeader height
floating: true,
pinned: true,
snap: true,
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import '../../../../common/extension/extension.dart';
import '../../../../common/theme/theme.dart';
import '../../../components/spacer/spacer.dart';
@@ -56,13 +57,27 @@ class HomeHeader extends StatelessWidget {
),
),
),
SafeArea(child: _buildContent()),
SafeArea(child: _buildContent(context)),
],
),
);
}
Padding _buildContent() {
Padding _buildContent(BuildContext context) {
String greeting(BuildContext context) {
final hour = DateTime.now().hour;
if (hour >= 4 && hour < 10) {
return context.lang.good_morning;
} else if (hour >= 10 && hour < 15) {
return context.lang.good_afternoon;
} else if (hour >= 15 && hour < 18) {
return context.lang.good_evening;
} else {
return context.lang.good_night;
}
}
return Padding(
padding: EdgeInsets.all(AppValue.padding),
child: Column(
@@ -87,7 +102,7 @@ class HomeHeader extends StatelessWidget {
),
const SpaceHeight(2),
Text(
'Dashboard',
'Manager',
style: AppStyle.sm.copyWith(
color: AppColor.textLight,
fontSize: 11,
@@ -120,7 +135,7 @@ class HomeHeader extends StatelessWidget {
// Greeting Section
Text(
'Selamat Pagi,',
'${greeting(context)},',
style: AppStyle.lg.copyWith(
color: AppColor.white,
fontWeight: FontWeight.w500,
@@ -137,7 +152,7 @@ class HomeHeader extends StatelessWidget {
),
const SpaceHeight(8),
Text(
'Mari tingkatkan performa bisnis Anda hari ini',
context.lang.home_header_desc,
style: AppStyle.md.copyWith(
color: AppColor.white.withOpacity(0.85),
fontWeight: FontWeight.w400,
@@ -170,7 +185,7 @@ class HomeHeader extends StatelessWidget {
),
const SizedBox(width: 6),
Text(
'Penjualan hari ini +25%',
'${context.lang.sales_today} +25%',
style: AppStyle.sm.copyWith(
color: AppColor.white,
fontWeight: FontWeight.w600,