From c680dd1c31fde7ea26f3010a7bb7a460f71f29d8 Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Mon, 15 Jun 2026 19:01:25 +0700 Subject: [PATCH] refactor: update UI components to use theme-based tertiary color scheme for consistent branding --- lib/screens/branches_screen.dart | 4 ++-- lib/screens/orders_screen.dart | 28 +++++++++++++---------- lib/widgets/subscription_list_widget.dart | 13 +++++------ 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/lib/screens/branches_screen.dart b/lib/screens/branches_screen.dart index 5f327d0..54ffee2 100644 --- a/lib/screens/branches_screen.dart +++ b/lib/screens/branches_screen.dart @@ -332,14 +332,14 @@ class _BranchesScreenState extends State { Icon( Icons.near_me_rounded, size: 14, - color: colorScheme.primary, + color: colorScheme.tertiary, ), const SizedBox(width: 4), Text( '$distanceLabel away', style: theme.textTheme.bodyMedium ?.copyWith( - color: colorScheme.primary, + color: colorScheme.tertiary, fontWeight: FontWeight.bold, ), ), diff --git a/lib/screens/orders_screen.dart b/lib/screens/orders_screen.dart index eb28538..0aad784 100644 --- a/lib/screens/orders_screen.dart +++ b/lib/screens/orders_screen.dart @@ -159,15 +159,17 @@ class _OrdersScreenState extends State { leading: Container( padding: const EdgeInsets.all(10), decoration: BoxDecoration( - color: (isEarn - ? const Color(0xFF2E7D32) - : const Color(0xFFC62828)) - .withValues(alpha: 0.1), + color: (isEarn + ? theme.colorScheme.tertiary + : theme.colorScheme.error) + .withValues(alpha: 0.1), shape: BoxShape.circle, ), child: Icon( isEarn ? Icons.add_card_rounded : Icons.payment_rounded, - color: isEarn ? const Color(0xFF2E7D32) : const Color(0xFFC62828), + color: isEarn + ? theme.colorScheme.tertiary + : theme.colorScheme.error, size: 24, ), ), @@ -189,14 +191,14 @@ class _OrdersScreenState extends State { Icon( Icons.storefront_rounded, size: 14, - color: theme.colorScheme.primary, + color: theme.colorScheme.tertiary, ), const SizedBox(width: 4), Text( posName, style: theme.textTheme.bodySmall?.copyWith( fontWeight: FontWeight.w600, - color: theme.colorScheme.primary, + color: theme.colorScheme.tertiary, ), ), ], @@ -214,12 +216,12 @@ class _OrdersScreenState extends State { padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3), decoration: BoxDecoration( color: isSubscription - ? const Color(0xFF1B5E20).withValues(alpha: 0.08) + ? theme.colorScheme.tertiary.withValues(alpha: 0.08) : theme.colorScheme.primary.withValues(alpha: 0.08), borderRadius: BorderRadius.circular(12), border: Border.all( color: isSubscription - ? const Color(0xFF1B5E20).withValues(alpha: 0.2) + ? theme.colorScheme.tertiary.withValues(alpha: 0.2) : theme.colorScheme.primary.withValues(alpha: 0.2), width: 0.5, ), @@ -233,7 +235,7 @@ class _OrdersScreenState extends State { : Icons.card_membership_rounded, size: 10, color: isSubscription - ? const Color(0xFF2E7D32) + ? theme.colorScheme.tertiary : theme.colorScheme.primary, ), const SizedBox(width: 4), @@ -248,7 +250,7 @@ class _OrdersScreenState extends State { fontWeight: FontWeight.bold, letterSpacing: 0.5, color: isSubscription - ? const Color(0xFF2E7D32) + ? theme.colorScheme.tertiary : theme.colorScheme.primary, ), ), @@ -262,7 +264,9 @@ class _OrdersScreenState extends State { '${isEarn ? '+' : ''}${item['points']} pts', style: theme.textTheme.titleMedium?.copyWith( fontWeight: FontWeight.bold, - color: isEarn ? const Color(0xFF2E7D32) : const Color(0xFFC62828), + color: isEarn + ? theme.colorScheme.tertiary + : theme.colorScheme.error, fontSize: 16, ), ), diff --git a/lib/widgets/subscription_list_widget.dart b/lib/widgets/subscription_list_widget.dart index 594935a..e25eac5 100644 --- a/lib/widgets/subscription_list_widget.dart +++ b/lib/widgets/subscription_list_widget.dart @@ -122,19 +122,18 @@ class _SubscriptionCard extends StatelessWidget { Row( children: [ Icon( - Icons - .local_activity_rounded, // Distinct ticket pass icon + Icons.local_activity_rounded, size: 18, color: active - ? colorScheme.primary + ? colorScheme.tertiary : colorScheme.outline, ), const SizedBox(width: 8), Text( - 'SUBSCRIPTION PASS', // Distinct title + 'SUBSCRIPTION PASS', style: theme.textTheme.labelLarge?.copyWith( color: active - ? colorScheme.primary + ? colorScheme.tertiary : colorScheme.outline, fontWeight: FontWeight.bold, fontSize: 10, @@ -150,7 +149,7 @@ class _SubscriptionCard extends StatelessWidget { ), decoration: BoxDecoration( color: active - ? const Color(0xFF1B5E20).withValues(alpha: 0.10) + ? colorScheme.tertiary.withValues(alpha: 0.10) : const Color(0xFFB02500).withValues(alpha: 0.08), borderRadius: BorderRadius.circular(20), ), @@ -161,7 +160,7 @@ class _SubscriptionCard extends StatelessWidget { fontWeight: FontWeight.bold, letterSpacing: 0.8, color: active - ? const Color(0xFF2E7D32) + ? colorScheme.tertiary : const Color(0xFFB02500), ), ),