Replace Colors.* in profile_settings dialogs, beacon.dart model, resources_sheet, beacon_screen remaining

This commit is contained in:
Patrick Britton 2026-02-10 15:27:03 -06:00
parent cefa69d7e7
commit 3aa0f5e93a
4 changed files with 55 additions and 53 deletions

View file

@ -1,11 +1,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../theme/tokens.dart';
/// Beacon severity levels controls pin color and alert priority /// Beacon severity levels controls pin color and alert priority
enum BeaconSeverity { enum BeaconSeverity {
low('low', 'Info', Colors.green, Icons.info_outline), low('low', 'Info', Color(0xFF4CAF50), Icons.info_outline),
medium('medium', 'Caution', Colors.amber, Icons.warning_amber), medium('medium', 'Caution', Color(0xFFFFC107), Icons.warning_amber),
high('high', 'Danger', Colors.deepOrange, Icons.error_outline), high('high', 'Danger', Color(0xFFFF5722), Icons.error_outline),
critical('critical', 'Critical', Colors.red, Icons.dangerous); critical('critical', 'Critical', SojornColors.destructive, Icons.dangerous);
final String value; final String value;
final String label; final String label;
@ -44,14 +45,14 @@ enum BeaconIncidentStatus {
/// Beacon type enum for different alert categories /// Beacon type enum for different alert categories
/// Uses neutral naming for App Store compliance /// Uses neutral naming for App Store compliance
enum BeaconType { enum BeaconType {
suspiciousActivity('suspicious', 'Suspicious Activity', 'Report unusual behavior or people', Icons.visibility, Colors.orange), suspiciousActivity('suspicious', 'Suspicious Activity', 'Report unusual behavior or people', Icons.visibility, Color(0xFFFF9800)),
police('police', 'Police Presence', 'General presence (Speed traps, patrol)', Icons.local_police, Colors.blue), police('police', 'Police Presence', 'General presence (Speed traps, patrol)', Icons.local_police, Color(0xFF2196F3)),
checkpoint('checkpoint', 'Checkpoint / Stop', 'Report stationary stops, roadblocks, or inspection points.', Icons.stop_circle, Colors.indigo), checkpoint('checkpoint', 'Checkpoint / Stop', 'Report stationary stops, roadblocks, or inspection points.', Icons.stop_circle, Color(0xFF3F51B5)),
taskForce('taskForce', 'Task Force / Operation', 'Report heavy coordinated activity, raids, or multiple units.', Icons.warning, Colors.deepOrange), taskForce('taskForce', 'Task Force / Operation', 'Report heavy coordinated activity, raids, or multiple units.', Icons.warning, Color(0xFFFF5722)),
hazard('hazard', 'Road Hazard', 'Physical danger (Debris, Ice, Floods)', Icons.report_problem, Colors.amber), hazard('hazard', 'Road Hazard', 'Physical danger (Debris, Ice, Floods)', Icons.report_problem, Color(0xFFFFC107)),
fire('fire', 'Fire', 'Report fires or smoke', Icons.local_fire_department, Colors.red), fire('fire', 'Fire', 'Report fires or smoke', Icons.local_fire_department, Color(0xFFF44336)),
safety('safety', 'Safety Alert', 'Events (Crime, Fights, Gunshots)', Icons.shield, Colors.red), safety('safety', 'Safety Alert', 'Events (Crime, Fights, Gunshots)', Icons.shield, Color(0xFFF44336)),
community('community', 'Community Event', 'Helpful (Food drives, Lost pets)', Icons.volunteer_activism, Colors.teal); community('community', 'Community Event', 'Helpful (Food drives, Lost pets)', Icons.volunteer_activism, Color(0xFF009688));
final String value; final String value;
final String displayName; final String displayName;

View file

@ -129,7 +129,7 @@ class _BeaconScreenState extends ConsumerState<BeaconScreen> {
void _onCreateBeacon() { void _onCreateBeacon() {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
backgroundColor: Colors.transparent, backgroundColor: SojornColors.transparent,
isScrollControlled: true, isScrollControlled: true,
builder: (context) => CreateBeaconSheet( builder: (context) => CreateBeaconSheet(
centerLat: _mapCenter.latitude, centerLat: _mapCenter.latitude,
@ -617,7 +617,7 @@ class _SeverityMarkerState extends State<_SeverityMarker>
), ),
], ],
), ),
child: Icon(widget.icon, color: Colors.white, size: 26), child: Icon(widget.icon, color: SojornColors.basicWhite, size: 26),
), ),
); );
}, },
@ -666,17 +666,17 @@ class _PulsingLocationIndicatorState extends State<_PulsingLocationIndicator>
width: 40, height: 40, width: 40, height: 40,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: Colors.blue.withValues(alpha: 0.3 * (1 - _animation.value)), color: const Color(0xFF2196F3).withValues(alpha: 0.3 * (1 - _animation.value)),
border: Border.all(color: Colors.blue.withValues(alpha: 0.5 * (1 - _animation.value)), width: 2), border: Border.all(color: const Color(0xFF2196F3).withValues(alpha: 0.5 * (1 - _animation.value)), width: 2),
), ),
), ),
Container( Container(
width: 16, height: 16, width: 16, height: 16,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: Colors.blue, color: const Color(0xFF2196F3),
border: Border.all(color: Colors.white, width: 3), border: Border.all(color: SojornColors.basicWhite, width: 3),
boxShadow: [BoxShadow(color: Colors.black.withValues(alpha: 0.3), blurRadius: 4, spreadRadius: 1)], boxShadow: [BoxShadow(color: const Color(0x4D000000), blurRadius: 4, spreadRadius: 1)],
), ),
), ),
], ],

View file

@ -3,6 +3,7 @@ import 'package:latlong2/latlong.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../../../models/local_intel.dart'; import '../../../models/local_intel.dart';
import '../../../theme/app_theme.dart'; import '../../../theme/app_theme.dart';
import '../../../theme/tokens.dart';
/// Bottom sheet displaying nearby public resources /// Bottom sheet displaying nearby public resources
class ResourcesSheet extends StatelessWidget { class ResourcesSheet extends StatelessWidget {
@ -34,7 +35,7 @@ class ResourcesSheet extends StatelessWidget {
width: 40, width: 40,
height: 4, height: 4,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey.shade300, color: AppTheme.textDisabled.withValues(alpha: 0.3),
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.circular(2),
), ),
), ),
@ -48,12 +49,12 @@ class ResourcesSheet extends StatelessWidget {
width: 40, width: 40,
height: 40, height: 40,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.teal.withValues(alpha: 0.1), color: const Color(0xFF009688).withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
child: const Icon( child: const Icon(
Icons.place_outlined, Icons.place_outlined,
color: Colors.teal, color: const Color(0xFF009688),
size: 22, size: 22,
), ),
), ),
@ -243,19 +244,19 @@ class ResourcesSheet extends StatelessWidget {
Color _getTypeColor(ResourceType type) { Color _getTypeColor(ResourceType type) {
switch (type) { switch (type) {
case ResourceType.library: case ResourceType.library:
return Colors.blue; return const Color(0xFF2196F3);
case ResourceType.park: case ResourceType.park:
return Colors.green; return const Color(0xFF4CAF50);
case ResourceType.hospital: case ResourceType.hospital:
return Colors.red; return const Color(0xFFF44336);
case ResourceType.police: case ResourceType.police:
return Colors.indigo; return const Color(0xFF3F51B5);
case ResourceType.pharmacy: case ResourceType.pharmacy:
return Colors.teal; return const Color(0xFF009688);
case ResourceType.fireStation: case ResourceType.fireStation:
return Colors.orange; return const Color(0xFFFF9800);
case ResourceType.other: case ResourceType.other:
return Colors.grey; return AppTheme.textDisabled;
} }
} }

View file

@ -951,7 +951,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
builder: (ctx) => AlertDialog( builder: (ctx) => AlertDialog(
title: Row( title: Row(
children: [ children: [
Icon(Icons.pause_circle_outline, color: Colors.orange, size: 24), Icon(Icons.pause_circle_outline, color: SojornColors.nsfwWarningIcon, size: 24),
const SizedBox(width: 8), const SizedBox(width: 8),
const Text('Deactivate Account'), const Text('Deactivate Account'),
], ],
@ -969,13 +969,13 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
Container( Container(
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.orange.withOpacity(0.1), color: SojornColors.nsfwWarningIcon.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.orange.withOpacity(0.3)), border: Border.all(color: SojornColors.nsfwWarningIcon.withValues(alpha: 0.3)),
), ),
child: Row( child: Row(
children: [ children: [
Icon(Icons.email_outlined, color: Colors.orange, size: 18), Icon(Icons.email_outlined, color: SojornColors.nsfwWarningIcon, size: 18),
const SizedBox(width: 8), const SizedBox(width: 8),
const Expanded( const Expanded(
child: Text( child: Text(
@ -998,7 +998,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
Navigator.pop(ctx); Navigator.pop(ctx);
await _performDeactivation(); await _performDeactivation();
}, },
style: TextButton.styleFrom(foregroundColor: Colors.orange), style: TextButton.styleFrom(foregroundColor: SojornColors.nsfwWarningIcon),
child: const Text('Deactivate'), child: const Text('Deactivate'),
), ),
], ],
@ -1014,7 +1014,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
builder: (ctx, setDialogState) => AlertDialog( builder: (ctx, setDialogState) => AlertDialog(
title: Row( title: Row(
children: [ children: [
Icon(Icons.delete_outline, color: Colors.red.shade400, size: 24), Icon(Icons.delete_outline, color: SojornColors.destructive, size: 24),
const SizedBox(width: 8), const SizedBox(width: 8),
const Text('Delete Account'), const Text('Delete Account'),
], ],
@ -1032,13 +1032,13 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
Container( Container(
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.red.withOpacity(0.08), color: SojornColors.destructive.withValues(alpha: 0.08),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.red.withOpacity(0.3)), border: Border.all(color: SojornColors.destructive.withValues(alpha: 0.3)),
), ),
child: Row( child: Row(
children: [ children: [
Icon(Icons.email_outlined, color: Colors.red.shade400, size: 18), Icon(Icons.email_outlined, color: SojornColors.destructive, size: 18),
const SizedBox(width: 8), const SizedBox(width: 8),
const Expanded( const Expanded(
child: Text( child: Text(
@ -1075,7 +1075,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
await _performDeletion(); await _performDeletion();
} }
: null, : null,
style: TextButton.styleFrom(foregroundColor: Colors.red), style: TextButton.styleFrom(foregroundColor: SojornColors.destructive),
child: const Text('Delete My Account'), child: const Text('Delete My Account'),
), ),
], ],
@ -1092,9 +1092,9 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
builder: (ctx, setDialogState) => AlertDialog( builder: (ctx, setDialogState) => AlertDialog(
title: Row( title: Row(
children: [ children: [
Icon(Icons.warning_amber_rounded, color: Colors.red.shade800, size: 24), Icon(Icons.warning_amber_rounded, color: const Color(0xFFC62828), size: 24),
const SizedBox(width: 8), const SizedBox(width: 8),
const Expanded(child: Text('Immediate Destroy', style: TextStyle(color: Colors.red))), Expanded(child: Text('Immediate Destroy', style: TextStyle(color: SojornColors.destructive))),
], ],
), ),
content: Column( content: Column(
@ -1103,7 +1103,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
children: [ children: [
Text( Text(
'THIS IS IRREVERSIBLE.', 'THIS IS IRREVERSIBLE.',
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.red.shade800), style: TextStyle(fontWeight: FontWeight.bold, color: const Color(0xFFC62828)),
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
const Text( const Text(
@ -1115,9 +1115,9 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
Container( Container(
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.red.shade900.withOpacity(0.15), color: const Color(0xFFB71C1C).withValues(alpha: 0.15),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.red.shade800.withOpacity(0.4)), border: Border.all(color: const Color(0xFFC62828).withValues(alpha: 0.4)),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -1157,8 +1157,8 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
} }
: null, : null,
style: TextButton.styleFrom( style: TextButton.styleFrom(
foregroundColor: Colors.white, foregroundColor: SojornColors.basicWhite,
backgroundColor: confirmController.text == 'DESTROY' ? Colors.red.shade800 : Colors.grey, backgroundColor: confirmController.text == 'DESTROY' ? const Color(0xFFC62828) : AppTheme.textDisabled,
), ),
child: const Text('Send Destroy Email'), child: const Text('Send Destroy Email'),
), ),
@ -1176,14 +1176,14 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
const SnackBar( const SnackBar(
content: Text('Account deactivated. A confirmation email has been sent. Log back in anytime to reactivate.'), content: Text('Account deactivated. A confirmation email has been sent. Log back in anytime to reactivate.'),
backgroundColor: Colors.orange, backgroundColor: SojornColors.nsfwWarningIcon,
), ),
); );
await _signOut(); await _signOut();
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Failed to deactivate: $e'), backgroundColor: Colors.red), SnackBar(content: Text('Failed to deactivate: $e'), backgroundColor: SojornColors.destructive),
); );
} }
} }
@ -1200,7 +1200,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
builder: (ctx) => AlertDialog( builder: (ctx) => AlertDialog(
title: Row( title: Row(
children: [ children: [
Icon(Icons.email, color: Colors.red.shade400, size: 24), Icon(Icons.email, color: SojornColors.destructive, size: 24),
const SizedBox(width: 8), const SizedBox(width: 8),
const Text('Deletion Scheduled'), const Text('Deletion Scheduled'),
], ],
@ -1224,7 +1224,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Failed to schedule deletion: $e'), backgroundColor: Colors.red), SnackBar(content: Text('Failed to schedule deletion: $e'), backgroundColor: SojornColors.destructive),
); );
} }
} }
@ -1240,7 +1240,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
builder: (ctx) => AlertDialog( builder: (ctx) => AlertDialog(
title: Row( title: Row(
children: [ children: [
Icon(Icons.mark_email_read, color: Colors.red.shade800, size: 24), Icon(Icons.mark_email_read, color: const Color(0xFFC62828), size: 24),
const SizedBox(width: 8), const SizedBox(width: 8),
const Expanded(child: Text('Confirmation Email Sent')), const Expanded(child: Text('Confirmation Email Sent')),
], ],
@ -1262,7 +1262,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
Text( Text(
'If you did not mean to do this, simply ignore the email — your account will not be affected. ' 'If you did not mean to do this, simply ignore the email — your account will not be affected. '
'The link expires in 1 hour.', 'The link expires in 1 hour.',
style: TextStyle(color: Colors.grey), style: TextStyle(color: AppTheme.textDisabled),
), ),
], ],
), ),
@ -1277,7 +1277,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Failed to initiate destroy: $e'), backgroundColor: Colors.red), SnackBar(content: Text('Failed to initiate destroy: $e'), backgroundColor: SojornColors.destructive),
); );
} }
} }