Replace inline Colors.* with SojornColors tokens in secure_chat bubble + composer widgets

This commit is contained in:
Patrick Britton 2026-02-10 14:12:54 -06:00
parent 9b11b95a57
commit b1f1cc5a44
2 changed files with 20 additions and 18 deletions

View file

@ -7,6 +7,7 @@ import 'package:timeago/timeago.dart' as timeago;
import 'package:url_launcher/url_launcher.dart';
import '../../theme/app_theme.dart';
import '../../theme/tokens.dart';
import '../media/signed_media_image.dart';
class ChatBubbleWidget extends StatefulWidget {
@ -251,7 +252,7 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget>
final statusColor = widget.sendFailed
? AppTheme.error
: widget.isMe
? Colors.white.withOpacity(0.75)
? SojornColors.basicWhite.withValues(alpha: 0.75)
: AppTheme.textDisabled;
final statusIcon = widget.sendFailed
@ -291,11 +292,11 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget>
padding: const EdgeInsets.all(10),
margin: const EdgeInsets.only(bottom: 8),
decoration: BoxDecoration(
color: Colors.white.withOpacity(widget.isMe ? 0.08 : 0.12),
color: SojornColors.basicWhite.withValues(alpha: widget.isMe ? 0.08 : 0.12),
borderRadius: BorderRadius.circular(10),
border: Border.all(
color: widget.isMe
? Colors.white.withOpacity(0.12)
? SojornColors.basicWhite.withValues(alpha: 0.12)
: AppTheme.navyBlue.withOpacity(0.08),
),
),
@ -306,7 +307,7 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget>
parsed.replyLabel,
style: GoogleFonts.inter(
color:
widget.isMe ? Colors.white70 : AppTheme.navyBlue,
widget.isMe ? SojornColors.basicWhite.withValues(alpha: 0.7) : AppTheme.navyBlue,
fontWeight: FontWeight.w700,
fontSize: 12,
),
@ -319,7 +320,7 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget>
overflow: TextOverflow.ellipsis,
style: GoogleFonts.inter(
color: widget.isMe
? Colors.white70
? SojornColors.basicWhite.withValues(alpha: 0.7)
: AppTheme.textDisabled,
fontSize: 13,
),
@ -337,14 +338,14 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget>
Icon(
Icons.lock_reset,
size: 16,
color: widget.isMe ? Colors.white70 : AppTheme.error,
color: widget.isMe ? SojornColors.basicWhite.withValues(alpha: 0.7) : AppTheme.error,
),
const SizedBox(width: 8),
Expanded(
child: Text(
'Unable to decrypt',
style: GoogleFonts.inter(
color: widget.isMe ? Colors.white70 : AppTheme.error,
color: widget.isMe ? SojornColors.basicWhite.withValues(alpha: 0.7) : AppTheme.error,
fontStyle: FontStyle.italic,
fontSize: 14,
),
@ -428,7 +429,7 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget>
color: widget.sendFailed
? AppTheme.error
: widget.isRead
? Colors.white
? SojornColors.basicWhite
: statusColor,
),
),
@ -500,7 +501,7 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget>
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.08),
color: SojornColors.overlayScrim,
blurRadius: 10,
offset: const Offset(0, 4),
),
@ -596,20 +597,20 @@ class _VideoAttachment extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: isMine ? Colors.white.withOpacity(0.08) : AppTheme.cardSurface,
color: isMine ? SojornColors.basicWhite.withValues(alpha: 0.08) : AppTheme.cardSurface,
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: isMine
? Colors.white.withOpacity(0.2)
? SojornColors.basicWhite.withValues(alpha: 0.2)
: AppTheme.navyBlue.withOpacity(0.1),
),
),
child: ListTile(
leading: Icon(Icons.videocam, color: isMine ? Colors.white : AppTheme.navyBlue),
leading: Icon(Icons.videocam, color: isMine ? SojornColors.basicWhite : AppTheme.navyBlue),
title: Text(
'Video attachment',
style: GoogleFonts.inter(
color: isMine ? Colors.white : AppTheme.navyText,
color: isMine ? SojornColors.basicWhite : AppTheme.navyText,
fontWeight: FontWeight.w600,
),
),
@ -618,12 +619,12 @@ class _VideoAttachment extends StatelessWidget {
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: GoogleFonts.inter(
color: isMine ? Colors.white70 : AppTheme.textDisabled,
color: isMine ? SojornColors.basicWhite.withValues(alpha: 0.7) : AppTheme.textDisabled,
fontSize: 12,
),
),
trailing: Icon(Icons.open_in_new,
color: isMine ? Colors.white70 : AppTheme.navyBlue),
color: isMine ? SojornColors.basicWhite.withValues(alpha: 0.7) : AppTheme.navyBlue),
onTap: () async {
// Fallback: open in browser
await launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication);

View file

@ -6,6 +6,7 @@ import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:image_picker/image_picker.dart';
import '../../theme/app_theme.dart';
import '../../theme/tokens.dart';
import '../../services/auth_service.dart';
import '../../services/image_upload_service.dart';
@ -237,7 +238,7 @@ class _ComposerWidgetState extends State<ComposerWidget>
padding: const EdgeInsets.symmetric(
horizontal: 16, vertical: 6),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.04),
color: SojornColors.basicWhite.withValues(alpha: 0.04),
borderRadius: BorderRadius.circular(18),
border: Border.all(
color: AppTheme.navyBlue.withOpacity(0.08),
@ -312,11 +313,11 @@ class _ComposerWidgetState extends State<ComposerWidget>
height: 18,
child: CircularProgressIndicator(
strokeWidth: 2,
color: Colors.white,
color: SojornColors.basicWhite,
),
)
: const Icon(Icons.send,
color: Colors.white, size: 18),
color: SojornColors.basicWhite, size: 18),
),
);
},