Replace inline Colors.* with SojornColors tokens in feed_sojorn, home_shell, threaded_conversation, compose screens

This commit is contained in:
Patrick Britton 2026-02-10 14:15:16 -06:00
parent b1f1cc5a44
commit 9093c17e55
4 changed files with 41 additions and 37 deletions

View file

@ -15,6 +15,7 @@ import '../../providers/feed_refresh_provider.dart';
import '../../services/api_service.dart';
import '../../services/image_upload_service.dart';
import '../../theme/app_theme.dart';
import '../../theme/tokens.dart';
import '../../widgets/composer/composer_toolbar.dart';
import '../../services/content_filter.dart';
import '../../widgets/sojorn_snackbar.dart';
@ -739,14 +740,14 @@ class _ComposeScreenState extends ConsumerState<ComposeScreen> {
top: 8,
right: 8,
child: Material(
color: Colors.black.withOpacity(0.6),
color: SojornColors.overlayDark,
shape: const CircleBorder(),
child: InkWell(
onTap: _removeImage,
customBorder: const CircleBorder(),
child: const Padding(
padding: EdgeInsets.all(6),
child: Icon(Icons.close, color: Colors.white, size: 18),
child: Icon(Icons.close, color: SojornColors.basicWhite, size: 18),
),
),
),
@ -769,12 +770,12 @@ class _ComposeScreenState extends ConsumerState<ComposeScreen> {
decoration: BoxDecoration(
color: isSafe
? AppTheme.navyBlue.withValues(alpha: 0.05)
: Colors.amber.withValues(alpha: 0.08),
: SojornColors.nsfwWarningBg,
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: isSafe
? AppTheme.navyBlue.withValues(alpha: 0.15)
: Colors.amber.withValues(alpha: 0.3),
: SojornColors.nsfwWarningBorder,
),
),
child: Row(
@ -782,7 +783,7 @@ class _ComposeScreenState extends ConsumerState<ComposeScreen> {
Icon(
isSafe ? Icons.link_rounded : Icons.warning_amber_rounded,
size: 20,
color: isSafe ? AppTheme.navyBlue : Colors.amber.shade700,
color: isSafe ? AppTheme.navyBlue : AppTheme.nsfwWarningIcon,
),
const SizedBox(width: 10),
Expanded(
@ -980,7 +981,7 @@ class ComposeBody extends StatelessWidget {
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
color: SojornColors.overlayScrim,
blurRadius: 8,
offset: const Offset(0, 2),
),

View file

@ -7,6 +7,7 @@ import '../../providers/feed_refresh_provider.dart';
import '../../models/post.dart';
import '../../theme/theme_extensions.dart';
import '../../theme/app_theme.dart';
import '../../theme/tokens.dart';
import '../../widgets/post/sojorn_swipeable_post.dart';
import '../../widgets/post/post_view_mode.dart';
import '../../widgets/sojorn_post_card.dart';
@ -189,7 +190,7 @@ class _FeedsojornScreenState extends ConsumerState<FeedsojornScreen> {
);
},
backgroundColor: AppTheme.brightNavy,
foregroundColor: Colors.white,
foregroundColor: SojornColors.basicWhite,
child: const Icon(Icons.add),
)
: null,
@ -208,7 +209,7 @@ class _FeedsojornScreenState extends ConsumerState<FeedsojornScreen> {
if (_feedItems.isEmpty && _isLoading) {
return const Center(
child: CircularProgressIndicator(
color: Colors.white,
color: SojornColors.basicWhite,
),
);
}
@ -257,7 +258,7 @@ class _FeedsojornScreenState extends ConsumerState<FeedsojornScreen> {
vertical: 8,
),
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.7),
color: SojornColors.overlayDark,
borderRadius: BorderRadius.circular(20),
),
child: const SizedBox(
@ -265,7 +266,7 @@ class _FeedsojornScreenState extends ConsumerState<FeedsojornScreen> {
height: 20,
child: CircularProgressIndicator(
strokeWidth: 2,
color: Colors.white,
color: SojornColors.basicWhite,
),
),
),
@ -290,9 +291,9 @@ class _FeedsojornScreenState extends ConsumerState<FeedsojornScreen> {
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.7),
color: SojornColors.overlayDark,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: Colors.white24),
border: Border.all(color: SojornColors.basicWhite.withValues(alpha: 0.24)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -300,7 +301,7 @@ class _FeedsojornScreenState extends ConsumerState<FeedsojornScreen> {
const Text(
'Ad Debug',
style: TextStyle(
color: Colors.white,
color: SojornColors.basicWhite,
fontSize: 12,
fontWeight: FontWeight.w700,
),
@ -309,7 +310,7 @@ class _FeedsojornScreenState extends ConsumerState<FeedsojornScreen> {
Text(
'items: ${_feedItems.length} | ads: ${adIndices.length}',
style: const TextStyle(
color: Colors.white70,
color: SojornColors.basicWhite.withValues(alpha: 0.7),
fontSize: 11,
),
),
@ -319,7 +320,7 @@ class _FeedsojornScreenState extends ConsumerState<FeedsojornScreen> {
? 'ad positions: none'
: 'ad positions: ${adIndices.join(', ')}',
style: const TextStyle(
color: Colors.white70,
color: SojornColors.basicWhite.withValues(alpha: 0.7),
fontSize: 11,
),
),
@ -342,7 +343,7 @@ class _ErrorState extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.black,
color: SojornColors.feedNavyTop,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@ -350,7 +351,7 @@ class _ErrorState extends StatelessWidget {
Text(
message,
style: AppTheme.bodyMedium.copyWith(
color: Colors.white,
color: SojornColors.basicWhite,
),
textAlign: TextAlign.center,
),
@ -359,7 +360,7 @@ class _ErrorState extends StatelessWidget {
onPressed: onRetry,
child: const Text(
'Retry',
style: TextStyle(color: Colors.white),
style: TextStyle(color: SojornColors.basicWhite),
),
),
],
@ -375,7 +376,7 @@ class _EmptyState extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.black,
color: SojornColors.feedNavyTop,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@ -383,13 +384,13 @@ class _EmptyState extends StatelessWidget {
Icon(
Icons.explore_outlined,
size: 64.0,
color: Colors.white.withOpacity(0.7),
color: SojornColors.basicWhite.withValues(alpha: 0.7),
),
const SizedBox(height: AppTheme.spacingMd),
Text(
'No active beacons or posts',
style: AppTheme.headlineSmall.copyWith(
color: Colors.white,
color: SojornColors.basicWhite,
),
textAlign: TextAlign.center,
),

View file

@ -6,6 +6,7 @@ import 'package:go_router/go_router.dart';
import '../../services/notification_service.dart';
import '../../services/secure_chat_service.dart';
import '../../theme/app_theme.dart';
import '../../theme/tokens.dart';
import '../notifications/notifications_screen.dart';
import '../compose/compose_screen.dart';
import '../search/search_screen.dart';
@ -145,8 +146,8 @@ class _HomeShellState extends ConsumerState<HomeShell> with WidgetsBindingObserv
child: CustomPaint(
painter: _VerticalBorderProgressPainter(
progress: upload.progress,
color: Colors.white,
backgroundColor: Colors.white.withOpacity(0.2),
color: SojornColors.basicWhite,
backgroundColor: SojornColors.basicWhite.withValues(alpha: 0.2),
strokeWidth: 3.5,
borderRadius: 12,
),
@ -155,12 +156,12 @@ class _HomeShellState extends ConsumerState<HomeShell> with WidgetsBindingObserv
// Content: Icon(+) or Percent or Check
if (isDone)
const Icon(Icons.check, color: Colors.white, size: 28)
const Icon(Icons.check, color: SojornColors.basicWhite, size: 28)
else if (isUploading)
Text(
'${(upload.progress * 100).toInt()}%',
style: GoogleFonts.outfit(
color: Colors.white,
color: SojornColors.basicWhite,
fontSize: 13,
fontWeight: FontWeight.bold,
),
@ -168,7 +169,7 @@ class _HomeShellState extends ConsumerState<HomeShell> with WidgetsBindingObserv
else
const Icon(
Icons.add,
color: Colors.white,
color: SojornColors.basicWhite,
size: 32,
),
],
@ -293,7 +294,7 @@ class _HomeShellState extends ConsumerState<HomeShell> with WidgetsBindingObserv
return Badge(
label: Text(badge.notificationCount.toString()),
isLabelVisible: badge.notificationCount > 0,
backgroundColor: Colors.redAccent,
backgroundColor: SojornColors.destructive,
child: Icon(Icons.notifications_none, color: AppTheme.navyBlue),
);
},
@ -330,7 +331,7 @@ class _HomeShellState extends ConsumerState<HomeShell> with WidgetsBindingObserv
alignment: Alignment.center,
child: Icon(
isActive ? activeIcon : icon,
color: isActive ? AppTheme.navyBlue : Colors.grey,
color: isActive ? AppTheme.navyBlue : SojornColors.bottomNavUnselected,
size: 26,
),
),

View file

@ -11,6 +11,7 @@ import '../../widgets/reactions/reactions_display.dart';
import '../../models/post.dart';
import '../../providers/api_provider.dart';
import '../../theme/app_theme.dart';
import '../../theme/tokens.dart';
import '../../widgets/post/interactive_reply_block.dart';
import '../../widgets/media/signed_media_image.dart';
import '../compose/compose_screen.dart';
@ -266,7 +267,7 @@ class _ThreadedConversationScreenState extends ConsumerState<ThreadedConversatio
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.error, color: Colors.red, size: 48),
Icon(Icons.error, color: SojornColors.destructive, size: 48),
const SizedBox(height: 16),
Text(
'Failed to load conversation',
@ -292,7 +293,7 @@ class _ThreadedConversationScreenState extends ConsumerState<ThreadedConversatio
label: const Text('Retry'),
style: ElevatedButton.styleFrom(
backgroundColor: AppTheme.brightNavy,
foregroundColor: Colors.white,
foregroundColor: SojornColors.basicWhite,
),
),
],
@ -335,7 +336,7 @@ class _ThreadedConversationScreenState extends ConsumerState<ThreadedConversatio
colors: [
AppTheme.navyBlue.withValues(alpha: 0.25), // Darker at top
AppTheme.navyBlue.withValues(alpha: 0.12), // Lighter at bottom
Colors.transparent, // Fade to transparent
SojornColors.transparent, // Fade to transparent
],
stops: const [0.0, 0.6, 1.0],
),
@ -489,17 +490,17 @@ class _ThreadedConversationScreenState extends ConsumerState<ThreadedConversatio
width: double.infinity,
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
decoration: BoxDecoration(
color: Colors.amber.shade800.withOpacity(0.15),
color: AppTheme.nsfwWarningBg,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.amber.shade700.withOpacity(0.3)),
border: Border.all(color: AppTheme.nsfwWarningBorder),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.visibility_off, size: 18, color: Colors.amber.shade700),
Icon(Icons.visibility_off, size: 18, color: AppTheme.nsfwWarningIcon),
const SizedBox(width: 8),
Text('Sensitive Content — Tap to reveal',
style: TextStyle(color: Colors.amber.shade700, fontWeight: FontWeight.w600, fontSize: 13)),
style: TextStyle(color: AppTheme.nsfwWarningText, fontWeight: FontWeight.w600, fontSize: 13)),
],
),
),
@ -656,7 +657,7 @@ class _ThreadedConversationScreenState extends ConsumerState<ThreadedConversatio
backgroundColor: AppTheme.navyBlue.withValues(alpha: 0.05),
foregroundColor: AppTheme.navyBlue,
elevation: 0,
shadowColor: Colors.transparent,
shadowColor: SojornColors.transparent,
minimumSize: const Size(0, 44),
padding: const EdgeInsets.symmetric(horizontal: 16),
shape: RoundedRectangleBorder(
@ -865,7 +866,7 @@ class _ThreadedConversationScreenState extends ConsumerState<ThreadedConversatio
],
),
child: Material(
color: Colors.transparent,
color: SojornColors.transparent,
child: InkWell(
onTap: () => _navigateToPost(post.id),
borderRadius: BorderRadius.circular(12),