Replace inline Colors.* with SojornColors tokens in profile_settings_screen.dart (56 replacements)

This commit is contained in:
Patrick Britton 2026-02-10 14:23:23 -06:00
parent 38f0952bc8
commit 52dfa0c653

View file

@ -12,6 +12,7 @@ import '../../providers/theme_provider.dart' as app_theme;
import '../../services/image_upload_service.dart';
import '../../services/notification_service.dart';
import '../../theme/app_theme.dart';
import '../../theme/tokens.dart';
import '../../widgets/app_scaffold.dart';
import '../../widgets/media/signed_media_image.dart';
import '../../widgets/sojorn_input.dart';
@ -99,19 +100,19 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
_buildEditTile(
icon: Icons.pause_circle_outline,
title: 'Deactivate Account',
color: Colors.orange,
color: SojornColors.nsfwWarningIcon,
onTap: () => _showDeactivateDialog(),
),
_buildEditTile(
icon: Icons.delete_outline,
title: 'Delete Account',
color: Colors.red.shade400,
color: SojornColors.destructive,
onTap: () => _showDeleteDialog(),
),
_buildEditTile(
icon: Icons.warning_amber_rounded,
title: 'Immediate Destroy',
color: Colors.red.shade800,
color: const Color(0xFFC62828),
onTap: () => _showSuperDeleteDialog(),
),
],
@ -245,7 +246,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
shape: BoxShape.circle,
border: Border.all(color: AppTheme.scaffoldBg, width: 2),
),
child: const Icon(Icons.add_a_photo, size: 14, color: Colors.white),
child: const Icon(Icons.add_a_photo, size: 14, color: SojornColors.basicWhite),
),
),
],
@ -305,7 +306,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
const SizedBox(height: AppTheme.spacingMd),
Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.5),
color: SojornColors.basicWhite.withValues(alpha: 0.5),
borderRadius: BorderRadius.circular(20),
border: Border.all(color: AppTheme.egyptianBlue.withOpacity(0.1)),
),
@ -334,8 +335,8 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
onTap: onTap,
child: Container(
padding: const EdgeInsets.all(8),
color: Colors.white.withOpacity(0.2),
child: Icon(icon, color: Colors.white, size: 20),
color: SojornColors.basicWhite.withValues(alpha: 0.2),
child: Icon(icon, color: SojornColors.basicWhite, size: 20),
),
),
),
@ -378,7 +379,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
backgroundColor: SojornColors.transparent,
builder: (_) => Container(
decoration: BoxDecoration(
color: AppTheme.scaffoldBg,
@ -478,7 +479,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
decoration: BoxDecoration(
color: AppTheme.cardSurface,
borderRadius: BorderRadius.circular(20),
border: Border.all(color: Colors.amber.shade700.withOpacity(0.25)),
border: Border.all(color: AppTheme.nsfwWarningBorder),
),
padding: const EdgeInsets.all(20),
child: Column(
@ -486,7 +487,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
children: [
Row(
children: [
Icon(Icons.visibility_off_outlined, size: 20, color: Colors.amber.shade700),
Icon(Icons.visibility_off_outlined, size: 20, color: AppTheme.nsfwWarningIcon),
const SizedBox(width: 8),
Text('Content Filters', style: AppTheme.textTheme.headlineSmall),
],
@ -494,7 +495,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
const SizedBox(height: 4),
Text(
'Control what content appears in your feed',
style: AppTheme.textTheme.labelSmall?.copyWith(color: Colors.grey),
style: AppTheme.textTheme.labelSmall?.copyWith(color: SojornColors.textDisabled),
),
const SizedBox(height: 16),
SwitchListTile(
@ -506,7 +507,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
: 'Enable to see posts marked as sensitive (violence, mature themes, etc). Disabled by default.',
),
value: userSettings.nsfwEnabled,
activeColor: Colors.amber.shade700,
activeColor: AppTheme.nsfwWarningIcon,
onChanged: isUnder18
? null
: (v) {
@ -528,7 +529,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
'When enabled, NSFW posts are blurred until you tap to reveal. Disable to show them without blur.',
),
value: userSettings.nsfwBlurEnabled,
activeColor: Colors.amber.shade700,
activeColor: AppTheme.nsfwWarningIcon,
onChanged: (v) {
if (!v) {
_showDisableBlurConfirmation(userSettings);
@ -558,7 +559,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
title: Row(
children: [
Icon(Icons.warning_amber_rounded, color: Colors.amber.shade700, size: 28),
Icon(Icons.warning_amber_rounded, color: AppTheme.nsfwWarningIcon, size: 28),
const SizedBox(width: 10),
const Expanded(child: Text('Enable Sensitive Content')),
],
@ -570,19 +571,19 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.red.shade900.withOpacity(0.1),
color: SojornColors.destructive.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.red.shade700.withOpacity(0.3)),
border: Border.all(color: SojornColors.destructive.withValues(alpha: 0.3)),
),
child: Row(
children: [
Icon(Icons.eighteen_up_rating, color: Colors.red.shade700, size: 24),
Icon(Icons.eighteen_up_rating, color: SojornColors.destructive, size: 24),
const SizedBox(width: 10),
Expanded(
child: Text(
'You must be 18 or older to enable this feature.',
style: TextStyle(
color: Colors.red.shade700,
color: SojornColors.destructive,
fontWeight: FontWeight.w700,
fontSize: 13,
),
@ -611,8 +612,8 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
),
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.amber.shade700,
foregroundColor: Colors.white,
backgroundColor: AppTheme.nsfwWarningIcon,
foregroundColor: SojornColors.basicWhite,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
),
onPressed: () => Navigator.pop(ctx, true),
@ -638,7 +639,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
title: Row(
children: [
Icon(Icons.visibility_outlined, color: Colors.amber.shade700, size: 28),
Icon(Icons.visibility_outlined, color: AppTheme.nsfwWarningIcon, size: 28),
const SizedBox(width: 10),
const Expanded(child: Text('Disable Content Blur')),
],
@ -650,19 +651,19 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.red.shade900.withOpacity(0.1),
color: SojornColors.destructive.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.red.shade700.withOpacity(0.3)),
border: Border.all(color: SojornColors.destructive.withValues(alpha: 0.3)),
),
child: Row(
children: [
Icon(Icons.eighteen_up_rating, color: Colors.red.shade700, size: 24),
Icon(Icons.eighteen_up_rating, color: SojornColors.destructive, size: 24),
const SizedBox(width: 10),
Expanded(
child: Text(
'You must be 18 or older. This cannot be undone without re-enabling blur.',
style: TextStyle(
color: Colors.red.shade700,
color: SojornColors.destructive,
fontWeight: FontWeight.w700,
fontSize: 13,
),
@ -689,8 +690,8 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
),
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.red.shade700,
foregroundColor: Colors.white,
backgroundColor: SojornColors.destructive,
foregroundColor: SojornColors.basicWhite,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
),
onPressed: () => Navigator.pop(ctx, true),
@ -718,7 +719,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
child: Container(
width: 5, height: 5,
decoration: BoxDecoration(
color: Colors.amber.shade700,
color: AppTheme.nsfwWarningIcon,
shape: BoxShape.circle,
),
),
@ -739,7 +740,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
backgroundColor: SojornColors.transparent,
builder: (_) => Container(
decoration: BoxDecoration(
color: AppTheme.scaffoldBg,
@ -783,7 +784,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
backgroundColor: SojornColors.transparent,
builder: (_) => Container(
decoration: BoxDecoration(
color: AppTheme.scaffoldBg,
@ -820,7 +821,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
backgroundColor: SojornColors.transparent,
builder: (_) => Container(
decoration: BoxDecoration(
color: AppTheme.scaffoldBg,
@ -854,7 +855,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
backgroundColor: SojornColors.transparent,
builder: (_) => Container(
decoration: BoxDecoration(
color: AppTheme.scaffoldBg,