From 9b11b95a57d4dbc880ec619ba01221a9535c778f Mon Sep 17 00:00:00 2001 From: Patrick Britton Date: Tue, 10 Feb 2026 13:59:15 -0600 Subject: [PATCH] Replace inline Colors.* with SojornColors tokens in 8 more widgets: composer, reactions, modals, safety, button, radial_menu --- .../lib/widgets/composer/composer_themes.dart | 3 ++- .../lib/widgets/composer/composer_toolbar.dart | 3 ++- .../lib/widgets/composer/quill_editor_wrapper.dart | 3 ++- sojorn_app/lib/widgets/modals/sanctuary_sheet.dart | 13 +++++++------ sojorn_app/lib/widgets/radial_menu_overlay.dart | 11 ++++++----- .../lib/widgets/reactions/reaction_picker.dart | 13 +++++++------ sojorn_app/lib/widgets/safety_redirect_sheet.dart | 5 +++-- sojorn_app/lib/widgets/sojorn_button.dart | 5 +++-- 8 files changed, 32 insertions(+), 24 deletions(-) diff --git a/sojorn_app/lib/widgets/composer/composer_themes.dart b/sojorn_app/lib/widgets/composer/composer_themes.dart index 4ad50be..511196f 100644 --- a/sojorn_app/lib/widgets/composer/composer_themes.dart +++ b/sojorn_app/lib/widgets/composer/composer_themes.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import '../../theme/app_theme.dart'; +import '../../theme/tokens.dart'; /// Simple text styling options (Twitter/Bluesky style) enum TextStyleOption { @@ -99,7 +100,7 @@ class FormattingToolbar extends StatelessWidget { child: Container( padding: const EdgeInsets.all(8), decoration: BoxDecoration( - color: isActive ? AppTheme.queenPink.withValues(alpha: 0.3) : Colors.transparent, + color: isActive ? AppTheme.queenPink.withValues(alpha: 0.3) : SojornColors.transparent, borderRadius: BorderRadius.circular(4), ), child: Icon( diff --git a/sojorn_app/lib/widgets/composer/composer_toolbar.dart b/sojorn_app/lib/widgets/composer/composer_toolbar.dart index e9817a3..632b6e0 100644 --- a/sojorn_app/lib/widgets/composer/composer_toolbar.dart +++ b/sojorn_app/lib/widgets/composer/composer_toolbar.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import '../../theme/app_theme.dart'; +import '../../theme/tokens.dart'; /// Keyboard-attached toolbar for the composer with attachments, formatting, topic, and counter. class ComposerToolbar extends StatelessWidget { @@ -102,7 +103,7 @@ class ComposerToolbar extends StatelessWidget { onPressed: onToggleNsfw, icon: Icon( Icons.visibility_off_outlined, - color: isNsfw ? Colors.amber.shade700 : AppTheme.navyText.withValues(alpha: 0.4), + color: isNsfw ? AppTheme.nsfwWarningIcon : AppTheme.navyText.withValues(alpha: 0.4), ), tooltip: isNsfw ? 'Marked as NSFW' : 'Mark as NSFW', ), diff --git a/sojorn_app/lib/widgets/composer/quill_editor_wrapper.dart b/sojorn_app/lib/widgets/composer/quill_editor_wrapper.dart index 0164834..6929062 100644 --- a/sojorn_app/lib/widgets/composer/quill_editor_wrapper.dart +++ b/sojorn_app/lib/widgets/composer/quill_editor_wrapper.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_quill/flutter_quill.dart'; import '../../theme/app_theme.dart'; +import '../../theme/tokens.dart'; class QuillEditorWrapper extends StatelessWidget { final QuillController controller; @@ -38,7 +39,7 @@ class QuillEditorWrapper extends StatelessWidget { Container( constraints: const BoxConstraints(minHeight: 200), decoration: const BoxDecoration( - color: Colors.white, + color: SojornColors.basicWhite, ), child: QuillEditor.basic( controller: controller, diff --git a/sojorn_app/lib/widgets/modals/sanctuary_sheet.dart b/sojorn_app/lib/widgets/modals/sanctuary_sheet.dart index 8e42d28..d81909f 100644 --- a/sojorn_app/lib/widgets/modals/sanctuary_sheet.dart +++ b/sojorn_app/lib/widgets/modals/sanctuary_sheet.dart @@ -2,6 +2,7 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import '../../models/post.dart'; import '../../theme/app_theme.dart'; +import '../../theme/tokens.dart'; import '../../services/api_service.dart'; class SanctuarySheet extends StatefulWidget { @@ -12,7 +13,7 @@ class SanctuarySheet extends StatefulWidget { static Future show(BuildContext context, Post post) { return showModalBottomSheet( context: context, - backgroundColor: Colors.transparent, + backgroundColor: SojornColors.transparent, isScrollControlled: true, builder: (_) => SanctuarySheet(post: post), ); @@ -110,7 +111,7 @@ class _SanctuarySheetState extends State { icon: Icons.block_flipped, title: "Exclude User", subtitle: "Stop all interactions structurally", - color: Colors.redAccent.withOpacity(0.8), + color: SojornColors.destructive.withValues(alpha: 0.8), onTap: () => setState(() => _step = 3), ), ], @@ -185,7 +186,7 @@ class _SanctuarySheetState extends State { shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), ), onPressed: _submitReport, - child: const Text("Submit Report", style: TextStyle(color: Colors.white)), + child: const Text("Submit Report", style: TextStyle(color: SojornColors.basicWhite)), ), ), TextButton( @@ -199,7 +200,7 @@ class _SanctuarySheetState extends State { Widget _buildBlockConfirmation() { return Column( children: [ - const Icon(Icons.warning_amber_rounded, color: Colors.redAccent, size: 64), + const Icon(Icons.warning_amber_rounded, color: SojornColors.destructive, size: 64), const SizedBox(height: 16), Text( "Exclude from Circle?", @@ -220,11 +221,11 @@ class _SanctuarySheetState extends State { height: 56, child: ElevatedButton( style: ElevatedButton.styleFrom( - backgroundColor: Colors.redAccent, + backgroundColor: SojornColors.destructive, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), ), onPressed: _confirmBlock, - child: const Text("Yes, Exclude structurally", style: TextStyle(color: Colors.white)), + child: const Text("Yes, Exclude structurally", style: TextStyle(color: SojornColors.basicWhite)), ), ), const SizedBox(height: 8), diff --git a/sojorn_app/lib/widgets/radial_menu_overlay.dart b/sojorn_app/lib/widgets/radial_menu_overlay.dart index 275c31e..e5b33fa 100644 --- a/sojorn_app/lib/widgets/radial_menu_overlay.dart +++ b/sojorn_app/lib/widgets/radial_menu_overlay.dart @@ -2,6 +2,7 @@ import 'dart:math' as math; import 'dart:ui'; import 'package:flutter/material.dart'; import '../theme/app_theme.dart'; +import '../theme/tokens.dart'; class RadialMenuOverlay extends StatefulWidget { final bool isVisible; @@ -95,7 +96,7 @@ class _RadialMenuOverlayState extends State child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5), child: Container( - color: Colors.black54, + color: SojornColors.overlayDark, ), ), ), @@ -219,11 +220,11 @@ class _MenuButton extends StatelessWidget { width: 70, height: 70, decoration: BoxDecoration( - color: Colors.white, + color: SojornColors.basicWhite, shape: BoxShape.circle, boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(0.2), + color: SojornColors.overlayScrim, blurRadius: 12, offset: const Offset(0, 4), ), @@ -239,11 +240,11 @@ class _MenuButton extends StatelessWidget { Container( padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4), decoration: BoxDecoration( - color: Colors.white, + color: SojornColors.basicWhite, borderRadius: BorderRadius.circular(12), boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(0.15), + color: SojornColors.overlayScrim, blurRadius: 8, offset: const Offset(0, 2), ), diff --git a/sojorn_app/lib/widgets/reactions/reaction_picker.dart b/sojorn_app/lib/widgets/reactions/reaction_picker.dart index 184a375..ce202c2 100644 --- a/sojorn_app/lib/widgets/reactions/reaction_picker.dart +++ b/sojorn_app/lib/widgets/reactions/reaction_picker.dart @@ -7,6 +7,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:url_launcher/url_launcher.dart'; import 'dart:convert'; import '../../theme/app_theme.dart'; +import '../../theme/tokens.dart'; class ReactionPicker extends StatefulWidget { final Function(String) onReactionSelected; @@ -203,7 +204,7 @@ class _ReactionPickerState extends State with SingleTickerProvid Widget build(BuildContext context) { if (_isLoading) { return Dialog( - backgroundColor: Colors.transparent, + backgroundColor: SojornColors.transparent, child: Container( width: 400, height: 300, @@ -224,7 +225,7 @@ class _ReactionPickerState extends State with SingleTickerProvid final myReactions = widget.myReactions ?? {}; return Dialog( - backgroundColor: Colors.transparent, + backgroundColor: SojornColors.transparent, child: Container( padding: const EdgeInsets.all(20), decoration: BoxDecoration( @@ -236,7 +237,7 @@ class _ReactionPickerState extends State with SingleTickerProvid ), boxShadow: [ BoxShadow( - color: Colors.black.withValues(alpha: 0.2), + color: SojornColors.overlayScrim, blurRadius: 20, offset: const Offset(0, 10), ), @@ -403,7 +404,7 @@ class _ReactionPickerState extends State with SingleTickerProvid child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Divider(color: Colors.grey), + Divider(color: SojornColors.textDisabled), const SizedBox(height: 8), Text( 'Credits:', @@ -474,7 +475,7 @@ class _ReactionPickerState extends State with SingleTickerProvid final isSelected = myReactions.contains(reaction); return Material( - color: Colors.transparent, + color: SojornColors.transparent, child: InkWell( onTap: () { Navigator.of(context).pop(); @@ -517,7 +518,7 @@ class _ReactionPickerState extends State with SingleTickerProvid child: Text( count > 99 ? '99+' : '$count', style: GoogleFonts.inter( - color: Colors.white, + color: SojornColors.basicWhite, fontSize: 8, fontWeight: FontWeight.w600, ), diff --git a/sojorn_app/lib/widgets/safety_redirect_sheet.dart b/sojorn_app/lib/widgets/safety_redirect_sheet.dart index 832008f..41cb854 100644 --- a/sojorn_app/lib/widgets/safety_redirect_sheet.dart +++ b/sojorn_app/lib/widgets/safety_redirect_sheet.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; import '../theme/app_theme.dart'; +import '../theme/tokens.dart'; /// Safety Redirect Sheet /// @@ -40,7 +41,7 @@ class SafetyRedirectSheet extends StatelessWidget { CupertinoIcons.arrow_up_right_square, size: 56, color: theme.iconTheme.color?.withValues(alpha: 0.7) ?? - Colors.grey.shade600, + SojornColors.textDisabled, ), const SizedBox(height: 20), @@ -114,7 +115,7 @@ class SafetyRedirectSheet extends StatelessWidget { Icon( CupertinoIcons.hand_raised, color: theme.iconTheme.color?.withValues(alpha: 0.6) ?? - Colors.grey.shade600, + SojornColors.textDisabled, size: 18, ), const SizedBox(width: 8), diff --git a/sojorn_app/lib/widgets/sojorn_button.dart b/sojorn_app/lib/widgets/sojorn_button.dart index afc66b0..8757075 100644 --- a/sojorn_app/lib/widgets/sojorn_button.dart +++ b/sojorn_app/lib/widgets/sojorn_button.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import '../theme/app_theme.dart'; +import '../theme/tokens.dart'; /// Custom button widget enforcing sojorn's visual system /// Variants: primary, secondary, tertiary, destructive @@ -101,7 +102,7 @@ class sojornButton extends StatelessWidget { disabledForegroundColor: AppTheme.navyText .withOpacity(0.5), // Replaced AppTheme.textDisabled elevation: 0, - shadowColor: Colors.transparent, + shadowColor: SojornColors.transparent, padding: _getPadding(), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( @@ -122,7 +123,7 @@ class sojornButton extends StatelessWidget { disabledForegroundColor: AppTheme.navyText .withOpacity(0.5), // Replaced AppTheme.textDisabled elevation: 0, - shadowColor: Colors.transparent, + shadowColor: SojornColors.transparent, padding: _getPadding(), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(