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