update theme

This commit is contained in:
Phuoc Nguyen
2025-12-02 15:20:54 +07:00
parent 12bd70479c
commit 49a41d24eb
78 changed files with 3263 additions and 2756 deletions

View File

@@ -9,7 +9,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:go_router/go_router.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:worker/core/constants/ui_constants.dart';
import 'package:worker/core/theme/colors.dart';
import 'package:worker/features/loyalty/presentation/providers/loyalty_points_provider.dart';
/// Loyalty Page
@@ -24,18 +23,19 @@ class LoyaltyPage extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final colorScheme = Theme.of(context).colorScheme;
final loyaltyPoints = ref.watch(loyaltyPointsProvider);
return Scaffold(
backgroundColor: const Color(0xFFF4F6F8),
backgroundColor: colorScheme.surfaceContainerLowest,
appBar: AppBar(
title: const Text(
title: Text(
'Hội viên thân thiết',
style: TextStyle(color: Colors.black),
style: TextStyle(color: colorScheme.onSurface),
),
elevation: AppBarSpecs.elevation,
backgroundColor: AppColors.white,
foregroundColor: AppColors.grey900,
backgroundColor: colorScheme.surface,
foregroundColor: colorScheme.onSurface,
centerTitle: false,
automaticallyImplyLeading: false,
),
@@ -50,17 +50,17 @@ class LoyaltyPage extends ConsumerWidget {
const SizedBox(height: 16),
// Progress Card
_buildProgressCard(),
_buildProgressCard(colorScheme),
const SizedBox(height: 16),
// Loyalty Features Menu
..._buildLoyaltyMenu(context),
..._buildLoyaltyMenu(context, colorScheme),
const SizedBox(height: 16),
// Current Benefits Card
_buildBenefitsCard(),
_buildBenefitsCard(colorScheme),
],
),
),
@@ -201,7 +201,7 @@ class LoyaltyPage extends ConsumerWidget {
}
/// Build Progress Card
Widget _buildProgressCard() {
Widget _buildProgressCard(ColorScheme colorScheme) {
return Card(
elevation: 5,
margin: EdgeInsets.zero,
@@ -211,12 +211,12 @@ class LoyaltyPage extends ConsumerWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
Text(
'Tiến trình lên hạng',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: AppColors.grey900,
color: colorScheme.onSurface,
),
),
const SizedBox(height: 16),
@@ -227,11 +227,11 @@ class LoyaltyPage extends ConsumerWidget {
children: [
Text(
'Hạng hiện tại: DIAMOND',
style: TextStyle(fontSize: 13, color: AppColors.grey500),
style: TextStyle(fontSize: 13, color: colorScheme.onSurfaceVariant),
),
Text(
'Hạng kế tiếp: PLATINUM',
style: TextStyle(fontSize: 13, color: AppColors.grey500),
style: TextStyle(fontSize: 13, color: colorScheme.onSurfaceVariant),
),
],
),
@@ -244,7 +244,7 @@ class LoyaltyPage extends ConsumerWidget {
child: LinearProgressIndicator(
value: 0.65,
minHeight: 8,
backgroundColor: AppColors.grey100,
backgroundColor: colorScheme.surfaceContainerHighest,
valueColor: const AlwaysStoppedAnimation<Color>(
Color(0xFF4A00E0),
),
@@ -257,18 +257,18 @@ class LoyaltyPage extends ConsumerWidget {
Center(
child: RichText(
textAlign: TextAlign.center,
text: const TextSpan(
style: TextStyle(fontSize: 13, color: AppColors.grey500),
text: TextSpan(
style: TextStyle(fontSize: 13, color: colorScheme.onSurfaceVariant),
children: [
TextSpan(text: 'Còn '),
const TextSpan(text: 'Còn '),
TextSpan(
text: '2,250 điểm',
style: TextStyle(
fontWeight: FontWeight.w600,
color: AppColors.grey900,
color: colorScheme.onSurface,
),
),
TextSpan(text: ' nữa để lên hạng Platinum'),
const TextSpan(text: ' nữa để lên hạng Platinum'),
],
),
),
@@ -280,7 +280,7 @@ class LoyaltyPage extends ConsumerWidget {
}
/// Build Loyalty Menu Items
List<Widget> _buildLoyaltyMenu(BuildContext context) {
List<Widget> _buildLoyaltyMenu(BuildContext context, ColorScheme colorScheme) {
final menuItems = [
{
'icon': FontAwesomeIcons.gift,
@@ -326,7 +326,7 @@ class LoyaltyPage extends ConsumerWidget {
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
side: const BorderSide(color: AppColors.grey100),
side: BorderSide(color: colorScheme.surfaceContainerHighest),
),
child: InkWell(
onTap: () {
@@ -348,12 +348,12 @@ class LoyaltyPage extends ConsumerWidget {
width: 48,
height: 48,
decoration: BoxDecoration(
color: AppColors.primaryBlue.withValues(alpha: 0.1),
color: colorScheme.primary.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(12),
),
child: Icon(
item['icon'] as IconData,
color: AppColors.primaryBlue,
color: colorScheme.primary,
size: 24,
),
),
@@ -367,18 +367,18 @@ class LoyaltyPage extends ConsumerWidget {
children: [
Text(
item['title'] as String,
style: const TextStyle(
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
color: AppColors.grey900,
color: colorScheme.onSurface,
),
),
const SizedBox(height: 2),
Text(
item['subtitle'] as String,
style: const TextStyle(
style: TextStyle(
fontSize: 13,
color: AppColors.grey500,
color: colorScheme.onSurfaceVariant,
),
),
],
@@ -386,9 +386,9 @@ class LoyaltyPage extends ConsumerWidget {
),
// Arrow
const Icon(
Icon(
FontAwesomeIcons.chevronRight,
color: AppColors.grey500,
color: colorScheme.onSurfaceVariant,
size: 20,
),
],
@@ -400,7 +400,7 @@ class LoyaltyPage extends ConsumerWidget {
}
/// Build Benefits Card
Widget _buildBenefitsCard() {
Widget _buildBenefitsCard(ColorScheme colorScheme) {
return Card(
elevation: 1,
margin: EdgeInsets.zero,
@@ -410,22 +410,23 @@ class LoyaltyPage extends ConsumerWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
Text(
'Quyền lợi hạng Diamond',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: AppColors.grey900,
color: colorScheme.onSurface,
),
),
const SizedBox(height: 16),
_buildBenefitItem('Chiết khấu 15% cho tất cả sản phẩm'),
_buildBenefitItem('Giao hàng miễn phí cho đơn từ 5 triệu'),
_buildBenefitItem('Ưu tiên xử lý đơn hàng'),
_buildBenefitItem('Tặng 500 điểm vào ngày sinh nhật'),
_buildBenefitItem('Tư vấn thiết kế miễn phí'),
_buildBenefitItem('Chiết khấu 15% cho tất cả sản phẩm', colorScheme),
_buildBenefitItem('Giao hàng miễn phí cho đơn từ 5 triệu', colorScheme),
_buildBenefitItem('Ưu tiên xử lý đơn hàng', colorScheme),
_buildBenefitItem('Tặng 500 điểm vào ngày sinh nhật', colorScheme),
_buildBenefitItem('Tư vấn thiết kế miễn phí', colorScheme),
_buildBenefitItem(
'Mời tham gia sự kiện VIP độc quyền',
colorScheme,
isLast: true,
),
],
@@ -435,7 +436,7 @@ class LoyaltyPage extends ConsumerWidget {
}
/// Build Benefit Item
Widget _buildBenefitItem(String text, {bool isLast = false}) {
Widget _buildBenefitItem(String text, ColorScheme colorScheme, {bool isLast = false}) {
return Padding(
padding: EdgeInsets.only(bottom: isLast ? 0 : 12),
child: Row(
@@ -446,9 +447,9 @@ class LoyaltyPage extends ConsumerWidget {
Expanded(
child: Text(
text,
style: const TextStyle(
style: TextStyle(
fontSize: 14,
color: AppColors.grey900,
color: colorScheme.onSurface,
height: 1.4,
),
),