Replace Colors.* in profile_settings dialogs, beacon.dart model, resources_sheet, beacon_screen remaining
This commit is contained in:
parent
cefa69d7e7
commit
3aa0f5e93a
|
|
@ -1,11 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import '../theme/tokens.dart';
|
||||
|
||||
/// Beacon severity levels — controls pin color and alert priority
|
||||
enum BeaconSeverity {
|
||||
low('low', 'Info', Colors.green, Icons.info_outline),
|
||||
medium('medium', 'Caution', Colors.amber, Icons.warning_amber),
|
||||
high('high', 'Danger', Colors.deepOrange, Icons.error_outline),
|
||||
critical('critical', 'Critical', Colors.red, Icons.dangerous);
|
||||
low('low', 'Info', Color(0xFF4CAF50), Icons.info_outline),
|
||||
medium('medium', 'Caution', Color(0xFFFFC107), Icons.warning_amber),
|
||||
high('high', 'Danger', Color(0xFFFF5722), Icons.error_outline),
|
||||
critical('critical', 'Critical', SojornColors.destructive, Icons.dangerous);
|
||||
|
||||
final String value;
|
||||
final String label;
|
||||
|
|
@ -44,14 +45,14 @@ enum BeaconIncidentStatus {
|
|||
/// Beacon type enum for different alert categories
|
||||
/// Uses neutral naming for App Store compliance
|
||||
enum BeaconType {
|
||||
suspiciousActivity('suspicious', 'Suspicious Activity', 'Report unusual behavior or people', Icons.visibility, Colors.orange),
|
||||
police('police', 'Police Presence', 'General presence (Speed traps, patrol)', Icons.local_police, Colors.blue),
|
||||
checkpoint('checkpoint', 'Checkpoint / Stop', 'Report stationary stops, roadblocks, or inspection points.', Icons.stop_circle, Colors.indigo),
|
||||
taskForce('taskForce', 'Task Force / Operation', 'Report heavy coordinated activity, raids, or multiple units.', Icons.warning, Colors.deepOrange),
|
||||
hazard('hazard', 'Road Hazard', 'Physical danger (Debris, Ice, Floods)', Icons.report_problem, Colors.amber),
|
||||
fire('fire', 'Fire', 'Report fires or smoke', Icons.local_fire_department, Colors.red),
|
||||
safety('safety', 'Safety Alert', 'Events (Crime, Fights, Gunshots)', Icons.shield, Colors.red),
|
||||
community('community', 'Community Event', 'Helpful (Food drives, Lost pets)', Icons.volunteer_activism, Colors.teal);
|
||||
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, Color(0xFF2196F3)),
|
||||
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, Color(0xFFFF5722)),
|
||||
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, Color(0xFFF44336)),
|
||||
safety('safety', 'Safety Alert', 'Events (Crime, Fights, Gunshots)', Icons.shield, Color(0xFFF44336)),
|
||||
community('community', 'Community Event', 'Helpful (Food drives, Lost pets)', Icons.volunteer_activism, Color(0xFF009688));
|
||||
|
||||
final String value;
|
||||
final String displayName;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class _BeaconScreenState extends ConsumerState<BeaconScreen> {
|
|||
void _onCreateBeacon() {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
backgroundColor: Colors.transparent,
|
||||
backgroundColor: SojornColors.transparent,
|
||||
isScrollControlled: true,
|
||||
builder: (context) => CreateBeaconSheet(
|
||||
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,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.blue.withValues(alpha: 0.3 * (1 - _animation.value)),
|
||||
border: Border.all(color: Colors.blue.withValues(alpha: 0.5 * (1 - _animation.value)), width: 2),
|
||||
color: const Color(0xFF2196F3).withValues(alpha: 0.3 * (1 - _animation.value)),
|
||||
border: Border.all(color: const Color(0xFF2196F3).withValues(alpha: 0.5 * (1 - _animation.value)), width: 2),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 16, height: 16,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.blue,
|
||||
border: Border.all(color: Colors.white, width: 3),
|
||||
boxShadow: [BoxShadow(color: Colors.black.withValues(alpha: 0.3), blurRadius: 4, spreadRadius: 1)],
|
||||
color: const Color(0xFF2196F3),
|
||||
border: Border.all(color: SojornColors.basicWhite, width: 3),
|
||||
boxShadow: [BoxShadow(color: const Color(0x4D000000), blurRadius: 4, spreadRadius: 1)],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import 'package:latlong2/latlong.dart';
|
|||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../../../models/local_intel.dart';
|
||||
import '../../../theme/app_theme.dart';
|
||||
import '../../../theme/tokens.dart';
|
||||
|
||||
/// Bottom sheet displaying nearby public resources
|
||||
class ResourcesSheet extends StatelessWidget {
|
||||
|
|
@ -34,7 +35,7 @@ class ResourcesSheet extends StatelessWidget {
|
|||
width: 40,
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey.shade300,
|
||||
color: AppTheme.textDisabled.withValues(alpha: 0.3),
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
),
|
||||
|
|
@ -48,12 +49,12 @@ class ResourcesSheet extends StatelessWidget {
|
|||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.teal.withValues(alpha: 0.1),
|
||||
color: const Color(0xFF009688).withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.place_outlined,
|
||||
color: Colors.teal,
|
||||
color: const Color(0xFF009688),
|
||||
size: 22,
|
||||
),
|
||||
),
|
||||
|
|
@ -243,19 +244,19 @@ class ResourcesSheet extends StatelessWidget {
|
|||
Color _getTypeColor(ResourceType type) {
|
||||
switch (type) {
|
||||
case ResourceType.library:
|
||||
return Colors.blue;
|
||||
return const Color(0xFF2196F3);
|
||||
case ResourceType.park:
|
||||
return Colors.green;
|
||||
return const Color(0xFF4CAF50);
|
||||
case ResourceType.hospital:
|
||||
return Colors.red;
|
||||
return const Color(0xFFF44336);
|
||||
case ResourceType.police:
|
||||
return Colors.indigo;
|
||||
return const Color(0xFF3F51B5);
|
||||
case ResourceType.pharmacy:
|
||||
return Colors.teal;
|
||||
return const Color(0xFF009688);
|
||||
case ResourceType.fireStation:
|
||||
return Colors.orange;
|
||||
return const Color(0xFFFF9800);
|
||||
case ResourceType.other:
|
||||
return Colors.grey;
|
||||
return AppTheme.textDisabled;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -951,7 +951,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
builder: (ctx) => AlertDialog(
|
||||
title: Row(
|
||||
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 Text('Deactivate Account'),
|
||||
],
|
||||
|
|
@ -969,13 +969,13 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.orange.withOpacity(0.1),
|
||||
color: SojornColors.nsfwWarningIcon.withValues(alpha: 0.1),
|
||||
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(
|
||||
children: [
|
||||
Icon(Icons.email_outlined, color: Colors.orange, size: 18),
|
||||
Icon(Icons.email_outlined, color: SojornColors.nsfwWarningIcon, size: 18),
|
||||
const SizedBox(width: 8),
|
||||
const Expanded(
|
||||
child: Text(
|
||||
|
|
@ -998,7 +998,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
Navigator.pop(ctx);
|
||||
await _performDeactivation();
|
||||
},
|
||||
style: TextButton.styleFrom(foregroundColor: Colors.orange),
|
||||
style: TextButton.styleFrom(foregroundColor: SojornColors.nsfwWarningIcon),
|
||||
child: const Text('Deactivate'),
|
||||
),
|
||||
],
|
||||
|
|
@ -1014,7 +1014,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
builder: (ctx, setDialogState) => AlertDialog(
|
||||
title: Row(
|
||||
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 Text('Delete Account'),
|
||||
],
|
||||
|
|
@ -1032,13 +1032,13 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red.withOpacity(0.08),
|
||||
color: SojornColors.destructive.withValues(alpha: 0.08),
|
||||
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(
|
||||
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 Expanded(
|
||||
child: Text(
|
||||
|
|
@ -1075,7 +1075,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
await _performDeletion();
|
||||
}
|
||||
: null,
|
||||
style: TextButton.styleFrom(foregroundColor: Colors.red),
|
||||
style: TextButton.styleFrom(foregroundColor: SojornColors.destructive),
|
||||
child: const Text('Delete My Account'),
|
||||
),
|
||||
],
|
||||
|
|
@ -1092,9 +1092,9 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
builder: (ctx, setDialogState) => AlertDialog(
|
||||
title: Row(
|
||||
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 Expanded(child: Text('Immediate Destroy', style: TextStyle(color: Colors.red))),
|
||||
Expanded(child: Text('Immediate Destroy', style: TextStyle(color: SojornColors.destructive))),
|
||||
],
|
||||
),
|
||||
content: Column(
|
||||
|
|
@ -1103,7 +1103,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
children: [
|
||||
Text(
|
||||
'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 Text(
|
||||
|
|
@ -1115,9 +1115,9 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red.shade900.withOpacity(0.15),
|
||||
color: const Color(0xFFB71C1C).withValues(alpha: 0.15),
|
||||
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(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
|
@ -1157,8 +1157,8 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
}
|
||||
: null,
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: Colors.white,
|
||||
backgroundColor: confirmController.text == 'DESTROY' ? Colors.red.shade800 : Colors.grey,
|
||||
foregroundColor: SojornColors.basicWhite,
|
||||
backgroundColor: confirmController.text == 'DESTROY' ? const Color(0xFFC62828) : AppTheme.textDisabled,
|
||||
),
|
||||
child: const Text('Send Destroy Email'),
|
||||
),
|
||||
|
|
@ -1176,14 +1176,14 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Account deactivated. A confirmation email has been sent. Log back in anytime to reactivate.'),
|
||||
backgroundColor: Colors.orange,
|
||||
backgroundColor: SojornColors.nsfwWarningIcon,
|
||||
),
|
||||
);
|
||||
await _signOut();
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
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(
|
||||
title: Row(
|
||||
children: [
|
||||
Icon(Icons.email, color: Colors.red.shade400, size: 24),
|
||||
Icon(Icons.email, color: SojornColors.destructive, size: 24),
|
||||
const SizedBox(width: 8),
|
||||
const Text('Deletion Scheduled'),
|
||||
],
|
||||
|
|
@ -1224,7 +1224,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
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(
|
||||
title: Row(
|
||||
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 Expanded(child: Text('Confirmation Email Sent')),
|
||||
],
|
||||
|
|
@ -1262,7 +1262,7 @@ class _ProfileSettingsScreenState extends ConsumerState<ProfileSettingsScreen> {
|
|||
Text(
|
||||
'If you did not mean to do this, simply ignore the email — your account will not be affected. '
|
||||
'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) {
|
||||
if (!mounted) return;
|
||||
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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue