Files
deflock-app/lib/widgets/camera_icon.dart
Doug Borg 3dada20ec2 Replace deprecated withOpacity and surfaceVariant APIs
Migrate all withOpacity() calls to withValues(alpha:) and
surfaceVariant to surfaceContainerHighest across the codebase.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 14:23:07 -07:00

51 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import '../dev_config.dart';
enum CameraIconType {
real, // Blue ring - real cameras from OSM
mock, // White ring - add camera mock point
pending, // Purple ring - submitted/pending cameras
editing, // Orange ring - camera being edited
pendingEdit, // Grey ring - original camera with pending edit
pendingDeletion, // Red ring - camera pending deletion
}
/// Simple camera icon with grey dot and colored ring
class CameraIcon extends StatelessWidget {
final CameraIconType type;
const CameraIcon({super.key, required this.type});
Color get _ringColor {
switch (type) {
case CameraIconType.real:
return kNodeRingColorReal;
case CameraIconType.mock:
return kNodeRingColorMock;
case CameraIconType.pending:
return kNodeRingColorPending;
case CameraIconType.editing:
return kNodeRingColorEditing;
case CameraIconType.pendingEdit:
return kNodeRingColorPendingEdit;
case CameraIconType.pendingDeletion:
return kNodeRingColorPendingDeletion;
}
}
@override
Widget build(BuildContext context) {
return Container(
width: kNodeIconDiameter,
height: kNodeIconDiameter,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _ringColor.withValues(alpha: kNodeDotOpacity),
border: Border.all(
color: _ringColor,
width: getNodeRingThickness(context),
),
),
);
}
}