From 248a32eb870606c9d174bfd0b098e1456854c8b1 Mon Sep 17 00:00:00 2001 From: Patrick Britton Date: Tue, 10 Feb 2026 15:30:22 -0600 Subject: [PATCH] Replace Colors.* in admin_scaffold, admin_content_tools, secure_chat_screen, new_conversation_sheet, notifications_screen, viewable_profile --- .../admin/admin_content_tools_screen.dart | 23 +++++++++--------- .../lib/screens/admin/admin_scaffold.dart | 10 ++++---- .../notifications/notifications_screen.dart | 7 +++--- .../profile/viewable_profile_screen.dart | 24 +++++++++---------- .../secure_chat/new_conversation_sheet.dart | 9 +++---- .../secure_chat/secure_chat_screen.dart | 11 +++++---- 6 files changed, 44 insertions(+), 40 deletions(-) diff --git a/sojorn_app/lib/screens/admin/admin_content_tools_screen.dart b/sojorn_app/lib/screens/admin/admin_content_tools_screen.dart index 3f07a00..dcc1a7f 100644 --- a/sojorn_app/lib/screens/admin/admin_content_tools_screen.dart +++ b/sojorn_app/lib/screens/admin/admin_content_tools_screen.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import '../../services/api_service.dart'; +import '../../theme/tokens.dart'; class AdminContentToolsScreen extends StatefulWidget { const AdminContentToolsScreen({super.key}); @@ -286,18 +287,18 @@ class _CreateUserTabState extends State<_CreateUserTab> { padding: const EdgeInsets.all(12), decoration: BoxDecoration( color: _resultIsError - ? Colors.red.withValues(alpha: 0.15) - : Colors.green.withValues(alpha: 0.15), + ? SojornColors.destructive.withValues(alpha: 0.15) + : const Color(0xFF4CAF50).withValues(alpha: 0.15), borderRadius: BorderRadius.circular(8), border: Border.all( - color: _resultIsError ? Colors.red : Colors.green, + color: _resultIsError ? SojornColors.destructive : const Color(0xFF4CAF50), width: 0.5, ), ), child: SelectableText( _result!, style: TextStyle( - color: _resultIsError ? Colors.red.shade300 : Colors.green.shade300, + color: _resultIsError ? const Color(0xFFE57373) : const Color(0xFF81C784), fontSize: 13, ), ), @@ -584,7 +585,7 @@ class _ImportContentTabState extends State<_ImportContentTab> { return Text( '${items.length} item(s) detected', style: theme.textTheme.bodySmall?.copyWith( - color: items.isEmpty ? Colors.orange : Colors.green, + color: items.isEmpty ? const Color(0xFFFF9800) : const Color(0xFF4CAF50), ), ); }), @@ -619,9 +620,9 @@ class _ImportContentTabState extends State<_ImportContentTab> { Widget _buildResultCard() { final isError = _result!.containsKey('error') && _result!['success'] == null; final bgColor = isError - ? Colors.red.withValues(alpha: 0.15) - : Colors.green.withValues(alpha: 0.15); - final borderColor = isError ? Colors.red : Colors.green; + ? SojornColors.destructive.withValues(alpha: 0.15) + : const Color(0xFF4CAF50).withValues(alpha: 0.15); + final borderColor = isError ? SojornColors.destructive : const Color(0xFF4CAF50); return Container( width: double.infinity, @@ -637,13 +638,13 @@ class _ImportContentTabState extends State<_ImportContentTab> { if (isError) SelectableText( _result!['error'].toString(), - style: TextStyle(color: Colors.red.shade300, fontSize: 13), + style: TextStyle(color: const Color(0xFFE57373), fontSize: 13), ) else ...[ Text( _result!['message'] ?? 'Done', style: TextStyle( - color: Colors.green.shade300, + color: const Color(0xFF81C784), fontWeight: FontWeight.w600, fontSize: 14, ), @@ -662,7 +663,7 @@ class _ImportContentTabState extends State<_ImportContentTab> { ...(_result!['errors'] as List).map((e) => Text( '• $e', style: TextStyle( - fontSize: 11, color: Colors.red.shade300), + fontSize: 11, color: const Color(0xFFE57373)), )), ], if (_result!['created'] != null && diff --git a/sojorn_app/lib/screens/admin/admin_scaffold.dart b/sojorn_app/lib/screens/admin/admin_scaffold.dart index f45ccf1..0f4e864 100644 --- a/sojorn_app/lib/screens/admin/admin_scaffold.dart +++ b/sojorn_app/lib/screens/admin/admin_scaffold.dart @@ -33,13 +33,13 @@ class AdminScaffold extends StatelessWidget { primary: accent, secondary: Color(0xFF7C3AED), surface: surface, - onSurface: Colors.white, + onSurface: const Color(0xFFFFFFFF), error: Color(0xFFE11D48), ), appBarTheme: const AppBarTheme( backgroundColor: panel, elevation: 0, - surfaceTintColor: Colors.transparent, + surfaceTintColor: const Color(0x00000000), ), cardTheme: CardThemeData( color: panel, @@ -58,12 +58,12 @@ class AdminScaffold extends StatelessWidget { headlineSmall: TextStyle( fontSize: 22, fontWeight: FontWeight.w700, - color: Colors.white, + color: const Color(0xFFFFFFFF), ), titleMedium: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Colors.white, + color: const Color(0xFFFFFFFF), ), bodyMedium: TextStyle( fontSize: 14, @@ -85,7 +85,7 @@ class AdminScaffold extends StatelessWidget { dataTableTheme: DataTableThemeData( headingTextStyle: const TextStyle( fontWeight: FontWeight.w700, - color: Colors.white, + color: const Color(0xFFFFFFFF), ), dataTextStyle: const TextStyle( color: Color(0xFFCBD5F5), diff --git a/sojorn_app/lib/screens/notifications/notifications_screen.dart b/sojorn_app/lib/screens/notifications/notifications_screen.dart index a55eb64..56e57d6 100644 --- a/sojorn_app/lib/screens/notifications/notifications_screen.dart +++ b/sojorn_app/lib/screens/notifications/notifications_screen.dart @@ -6,6 +6,7 @@ import 'package:timeago/timeago.dart' as timeago; import '../../models/notification.dart'; import '../../providers/api_provider.dart'; import '../../theme/app_theme.dart'; +import '../../theme/tokens.dart'; import '../../widgets/media/signed_media_image.dart'; import '../profile/viewable_profile_screen.dart'; import '../post/post_detail_screen.dart'; @@ -435,12 +436,12 @@ class _NotificationsScreenState extends ConsumerState { Text( 'Archive', style: TextStyle( - color: Colors.white, + color: SojornColors.basicWhite, fontWeight: FontWeight.bold, ), ), SizedBox(width: 8), - Icon(Icons.archive, color: Colors.white), + Icon(Icons.archive, color: SojornColors.basicWhite), ], ), ), @@ -505,7 +506,7 @@ class _NotificationItem extends StatelessWidget { padding: const EdgeInsets.all(AppTheme.spacingMd), decoration: BoxDecoration( color: notification.isRead - ? Colors.transparent + ? SojornColors.transparent : AppTheme.royalPurple.withOpacity(0.05), border: Border( bottom: BorderSide( diff --git a/sojorn_app/lib/screens/profile/viewable_profile_screen.dart b/sojorn_app/lib/screens/profile/viewable_profile_screen.dart index 21d71ec..2fd3e61 100644 --- a/sojorn_app/lib/screens/profile/viewable_profile_screen.dart +++ b/sojorn_app/lib/screens/profile/viewable_profile_screen.dart @@ -11,6 +11,7 @@ import '../../models/trust_state.dart'; import '../../models/trust_tier.dart'; import '../../providers/api_provider.dart'; import '../../theme/app_theme.dart'; +import '../../theme/tokens.dart'; import '../../utils/country_flag.dart'; import '../../utils/url_launcher_helper.dart'; import '../../widgets/sojorn_post_card.dart'; @@ -745,7 +746,7 @@ class _UnifiedProfileScreenState extends ConsumerState showModalBottomSheet( context: context, - backgroundColor: Colors.transparent, + backgroundColor: SojornColors.transparent, builder: (context) { return Container( padding: const EdgeInsets.all(AppTheme.spacingLg), @@ -785,7 +786,7 @@ class _UnifiedProfileScreenState extends ConsumerState builder: (context) { final avatarUrl = _resolveAvatar(profile.avatarUrl); return Dialog( - backgroundColor: Colors.transparent, + backgroundColor: SojornColors.transparent, insetPadding: const EdgeInsets.all(AppTheme.spacingLg), child: Container( padding: const EdgeInsets.all(AppTheme.spacingLg), @@ -940,7 +941,7 @@ class _UnifiedProfileScreenState extends ConsumerState toolbarHeight: 0, collapsedHeight: 0, automaticallyImplyLeading: false, - backgroundColor: Colors.transparent, + backgroundColor: SojornColors.transparent, elevation: 0, flexibleSpace: FlexibleSpaceBar( background: _ProfileHeader( @@ -1465,7 +1466,7 @@ class _ProfileHeader extends StatelessWidget { fontSize: isCompact ? 16 : 18, shadows: [ Shadow( - color: Colors.black.withOpacity(0.2), + color: const Color(0x33000000), blurRadius: 6, ), ], @@ -1485,7 +1486,7 @@ class _ProfileHeader extends StatelessWidget { color: AppTheme.white.withOpacity(0.85), shadows: [ Shadow( - color: Colors.black.withOpacity(0.2), + color: const Color(0x33000000), blurRadius: 4, ), ], @@ -1635,7 +1636,7 @@ class _ProfileHeader extends StatelessWidget { vertical: 6, ), decoration: BoxDecoration( - color: Colors.black.withOpacity(0.35), + color: const Color(0x59000000), borderRadius: BorderRadius.circular(AppTheme.radiusMd), ), child: Row( @@ -1698,11 +1699,11 @@ class _StatItem extends StatelessWidget { Text( value, style: AppTheme.headlineSmall.copyWith( - color: AppTheme.white, + color: SojornColors.white, fontSize: 16, shadows: [ Shadow( - color: Colors.black.withOpacity(0.3), + color: SojornColors.shadow, blurRadius: 4, ), ], @@ -1710,12 +1711,11 @@ class _StatItem extends StatelessWidget { ), Text( label, - style: AppTheme.labelSmall.copyWith( - color: AppTheme.white.withOpacity(0.8), + style: GoogleFonts.inter( fontSize: 10, shadows: [ Shadow( - color: Colors.black.withOpacity(0.3), + color: SojornColors.shadow, blurRadius: 2, ), ], @@ -1766,7 +1766,7 @@ class _HarmonyAvatar extends StatelessWidget { ringColor = AppTheme.egyptianBlue; ringWidth = 3; } else { - ringColor = Colors.grey; + ringColor = AppTheme.textDisabled; ringWidth = 2; } } diff --git a/sojorn_app/lib/screens/secure_chat/new_conversation_sheet.dart b/sojorn_app/lib/screens/secure_chat/new_conversation_sheet.dart index 92fdf8e..ed00077 100644 --- a/sojorn_app/lib/screens/secure_chat/new_conversation_sheet.dart +++ b/sojorn_app/lib/screens/secure_chat/new_conversation_sheet.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import '../../models/secure_chat.dart'; import '../../services/secure_chat_service.dart'; import '../../theme/app_theme.dart'; +import '../../theme/tokens.dart'; import '../../widgets/media/signed_media_image.dart'; /// Bottom sheet for starting a new secure conversation @@ -110,7 +111,7 @@ class _NewConversationSheetState extends State { width: 40, height: 4, decoration: BoxDecoration( - color: Colors.grey.shade300, + color: AppTheme.textDisabled.withValues(alpha: 0.3), borderRadius: BorderRadius.circular(2), ), ), @@ -244,7 +245,7 @@ class _NewConversationSheetState extends State { ), if (_isStarting) Container( - color: Colors.black26, + color: const Color(0x42000000), child: const Center(child: CircularProgressIndicator()), ), ], @@ -363,12 +364,12 @@ class _NewConversationSheetState extends State { child: Row( mainAxisSize: MainAxisSize.min, children: [ - Icon(Icons.lock, size: 14, color: Colors.white), + Icon(Icons.lock, size: 14, color: SojornColors.basicWhite), const SizedBox(width: 4), Text( 'Chat', style: Theme.of(context).textTheme.labelSmall?.copyWith( - color: Colors.white, + color: SojornColors.basicWhite, fontWeight: FontWeight.bold, ), ), diff --git a/sojorn_app/lib/screens/secure_chat/secure_chat_screen.dart b/sojorn_app/lib/screens/secure_chat/secure_chat_screen.dart index 2b06f33..1fd70e7 100644 --- a/sojorn_app/lib/screens/secure_chat/secure_chat_screen.dart +++ b/sojorn_app/lib/screens/secure_chat/secure_chat_screen.dart @@ -7,6 +7,7 @@ import '../../services/api_service.dart'; import '../../services/secure_chat_service.dart'; import '../../services/local_message_store.dart'; import '../../theme/app_theme.dart'; +import '../../theme/tokens.dart'; import '../../services/notification_service.dart'; import '../../widgets/media/signed_media_image.dart'; import '../../widgets/secure_chat/chat_bubble_widget.dart'; @@ -214,7 +215,7 @@ class _SecureChatScreenState extends State return AppBar( backgroundColor: AppTheme.scaffoldBg, elevation: 0, - surfaceTintColor: Colors.transparent, + surfaceTintColor: SojornColors.transparent, leading: IconButton( onPressed: () => Navigator.of(context).pop(), icon: Icon(Icons.arrow_back, color: AppTheme.navyBlue), @@ -324,7 +325,7 @@ class _SecureChatScreenState extends State children: [ Container( key: _listViewportKey, - color: Colors.transparent, + color: SojornColors.transparent, child: ListView.builder( reverse: true, controller: controller, @@ -926,7 +927,7 @@ class _SecureChatScreenState extends State onPressed: () => Navigator.pop(context, true), style: ElevatedButton.styleFrom( backgroundColor: AppTheme.error, - foregroundColor: Colors.white, + foregroundColor: SojornColors.basicWhite, ), child: Text( 'DELETE PERMANENTLY', @@ -1101,7 +1102,7 @@ class _SecureChatScreenState extends State ), TextButton( onPressed: () => Navigator.pop(context, true), - style: TextButton.styleFrom(foregroundColor: Colors.red), + style: TextButton.styleFrom(foregroundColor: SojornColors.destructive), child: const Text('Force Reset'), ), ], @@ -1115,7 +1116,7 @@ class _SecureChatScreenState extends State ScaffoldMessenger.of(context).showSnackBar( const SnackBar( content: Text('Keys force reset! Restart chat to test.'), - backgroundColor: Colors.red, + backgroundColor: SojornColors.destructive, ), ); }