mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-10-12 02:37:11 +02:00
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>
This commit is contained in:
1 parent
c712aba724
commit
3dada20ec2
24 files changed
+63
-65
No files matched your search
@@ -544,7 +544,7 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
|||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Theme.of(context).shadowColor.withOpacity(0.3),
|
color: Theme.of(context).shadowColor.withValues(alpha: 0.3),
|
||||||
blurRadius: 10,
|
blurRadius: 10,
|
||||||
offset: Offset(0, -2),
|
offset: Offset(0, -2),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ class _NavigationSettingsScreenState extends State<NavigationSettingsScreen> {
|
|||||||
Text(
|
Text(
|
||||||
value,
|
value,
|
||||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||||
color: Theme.of(context).textTheme.bodySmall?.color?.withOpacity(0.6),
|
color: Theme.of(context).textTheme.bodySmall?.color?.withValues(alpha: 0.6),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ class _OSMAccountScreenState extends State<OSMAccountScreen> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(12.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.5),
|
color: Theme.of(context).colorScheme.surfaceContainerHighest.withValues(alpha: 0.5),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -308,7 +308,7 @@ class _OSMAccountScreenState extends State<OSMAccountScreen> {
|
|||||||
label: Text(locService.t('auth.deleteAccount')),
|
label: Text(locService.t('auth.deleteAccount')),
|
||||||
style: OutlinedButton.styleFrom(
|
style: OutlinedButton.styleFrom(
|
||||||
foregroundColor: Theme.of(context).colorScheme.error,
|
foregroundColor: Theme.of(context).colorScheme.error,
|
||||||
side: BorderSide(color: Theme.of(context).colorScheme.error.withOpacity(0.5)),
|
side: BorderSide(color: Theme.of(context).colorScheme.error.withValues(alpha: 0.5)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -354,10 +354,10 @@ class _OSMAccountScreenState extends State<OSMAccountScreen> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(12.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.errorContainer.withOpacity(0.1),
|
color: Theme.of(context).colorScheme.errorContainer.withValues(alpha: 0.1),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: Theme.of(context).colorScheme.error.withOpacity(0.3),
|
color: Theme.of(context).colorScheme.error.withValues(alpha: 0.3),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class _ReleaseNotesScreenState extends State<ReleaseNotesScreen> {
|
|||||||
color: Theme.of(context).colorScheme.primaryContainer,
|
color: Theme.of(context).colorScheme.primaryContainer,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: Theme.of(context).colorScheme.primary.withOpacity(0.3),
|
color: Theme.of(context).colorScheme.primary.withValues(alpha: 0.3),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -142,8 +142,8 @@ class _ReleaseNotesScreenState extends State<ReleaseNotesScreen> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: isCurrentVersion
|
color: isCurrentVersion
|
||||||
? Theme.of(context).colorScheme.primary.withOpacity(0.3)
|
? Theme.of(context).colorScheme.primary.withValues(alpha: 0.3)
|
||||||
: Theme.of(context).dividerColor.withOpacity(0.3),
|
: Theme.of(context).dividerColor.withValues(alpha: 0.3),
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -140,9 +140,9 @@ class _ProximityAlertsSectionState extends State<ProximityAlertsSection> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.orange.withOpacity(0.1),
|
color: Colors.orange.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: Colors.orange.withValues(alpha: 0.3)),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -233,7 +233,7 @@ class _ProximityAlertsSectionState extends State<ProximityAlertsSection> {
|
|||||||
DistanceService.convertFromMeters(kProximityAlertDefaultDistance.toDouble(), appState.distanceUnit).round().toString(),
|
DistanceService.convertFromMeters(kProximityAlertDefaultDistance.toDouble(), appState.distanceUnit).round().toString(),
|
||||||
]),
|
]),
|
||||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||||
color: Theme.of(context).textTheme.bodySmall?.color?.withOpacity(0.6),
|
color: Theme.of(context).textTheme.bodySmall?.color?.withValues(alpha: 0.6),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class TileProviderSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
...providers.map((provider) => _buildProviderTile(context, provider, appState)).toList(),
|
...providers.map((provider) => _buildProviderTile(context, provider, appState)),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -89,7 +89,7 @@ class TileProviderSection extends StatelessWidget {
|
|||||||
leading: CircleAvatar(
|
leading: CircleAvatar(
|
||||||
backgroundColor: isSelected
|
backgroundColor: isSelected
|
||||||
? Theme.of(context).colorScheme.primary
|
? Theme.of(context).colorScheme.primary
|
||||||
: Theme.of(context).colorScheme.surfaceVariant,
|
: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.map,
|
Icons.map,
|
||||||
color: isSelected
|
color: isSelected
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class UploadModeSection extends StatelessWidget {
|
|||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: appState.pendingCount > 0
|
color: appState.pendingCount > 0
|
||||||
? Theme.of(context).disabledColor
|
? Theme.of(context).disabledColor
|
||||||
: Theme.of(context).colorScheme.onSurface.withOpacity(0.7)
|
: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.7)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
case UploadMode.sandbox:
|
case UploadMode.sandbox:
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class SettingsScreen extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'Version: ${VersionService().version}',
|
'Version: ${VersionService().version}',
|
||||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||||
color: Theme.of(context).textTheme.bodySmall?.color?.withOpacity(0.6),
|
color: Theme.of(context).textTheme.bodySmall?.color?.withValues(alpha: 0.6),
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class CameraIcon extends StatelessWidget {
|
|||||||
height: kNodeIconDiameter,
|
height: kNodeIconDiameter,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: _ringColor.withOpacity(kNodeDotOpacity),
|
color: _ringColor.withValues(alpha: kNodeDotOpacity),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: _ringColor,
|
color: _ringColor,
|
||||||
width: getNodeRingThickness(context),
|
width: getNodeRingThickness(context),
|
||||||
|
|||||||
@@ -96,8 +96,8 @@ class _CompassIndicatorState extends State<CompassIndicator> {
|
|||||||
height: 52,
|
height: 52,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isDisabled
|
color: isDisabled
|
||||||
? Colors.grey.withOpacity(0.8)
|
? Colors.grey.withValues(alpha: 0.8)
|
||||||
: Colors.white.withOpacity(0.95),
|
: Colors.white.withValues(alpha: 0.95),
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: isDisabled
|
color: isDisabled
|
||||||
@@ -107,7 +107,7 @@ class _CompassIndicatorState extends State<CompassIndicator> {
|
|||||||
),
|
),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.black.withOpacity(0.25),
|
color: Colors.black.withValues(alpha: 0.25),
|
||||||
blurRadius: 6,
|
blurRadius: 6,
|
||||||
offset: const Offset(0, 3),
|
offset: const Offset(0, 3),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -189,8 +189,8 @@ class _DownloadAreaDialogState extends State<DownloadAreaDialog> {
|
|||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: _tileCount! > kMaxReasonableTileCount
|
color: _tileCount! > kMaxReasonableTileCount
|
||||||
? Colors.orange.withOpacity(0.1)
|
? Colors.orange.withValues(alpha: 0.1)
|
||||||
: Colors.green.withOpacity(0.1),
|
: Colors.green.withValues(alpha: 0.1),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -198,7 +198,7 @@ class _DownloadAreaDialogState extends State<DownloadAreaDialog> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
_tileCount! > kMaxReasonableTileCount
|
_tileCount! > kMaxReasonableTileCount
|
||||||
? 'Above recommended limit (Z${_maxPossibleZoom})'
|
? 'Above recommended limit (Z$_maxPossibleZoom)'
|
||||||
: locService.t('download.maxRecommendedZoom', params: [_maxPossibleZoom.toString()]),
|
: locService.t('download.maxRecommendedZoom', params: [_maxPossibleZoom.toString()]),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
@@ -211,7 +211,7 @@ class _DownloadAreaDialogState extends State<DownloadAreaDialog> {
|
|||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
Text(
|
Text(
|
||||||
_tileCount! > kMaxReasonableTileCount
|
_tileCount! > kMaxReasonableTileCount
|
||||||
? 'Current selection exceeds ${kMaxReasonableTileCount} recommended tile limit but is within ${kAbsoluteMaxTileCount} absolute limit'
|
? 'Current selection exceeds $kMaxReasonableTileCount recommended tile limit but is within $kAbsoluteMaxTileCount absolute limit'
|
||||||
: locService.t('download.withinTileLimit', params: [kMaxReasonableTileCount.toString()]),
|
: locService.t('download.withinTileLimit', params: [kMaxReasonableTileCount.toString()]),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 11,
|
fontSize: 11,
|
||||||
@@ -230,9 +230,9 @@ class _DownloadAreaDialogState extends State<DownloadAreaDialog> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.orange.withOpacity(0.1),
|
color: Colors.orange.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: Colors.orange.withValues(alpha: 0.3)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ class DirectionConesBuilder {
|
|||||||
|
|
||||||
return Polygon(
|
return Polygon(
|
||||||
points: points,
|
points: points,
|
||||||
color: kDirectionConeColor.withOpacity(opacity),
|
color: kDirectionConeColor.withValues(alpha: opacity),
|
||||||
borderColor: kDirectionConeColor,
|
borderColor: kDirectionConeColor,
|
||||||
borderStrokeWidth: getDirectionConeBorderWidth(context),
|
borderStrokeWidth: getDirectionConeBorderWidth(context),
|
||||||
);
|
);
|
||||||
@@ -251,7 +251,7 @@ class DirectionConesBuilder {
|
|||||||
|
|
||||||
return Polygon(
|
return Polygon(
|
||||||
points: points,
|
points: points,
|
||||||
color: kDirectionConeColor.withOpacity(opacity),
|
color: kDirectionConeColor.withValues(alpha: opacity),
|
||||||
borderColor: kDirectionConeColor,
|
borderColor: kDirectionConeColor,
|
||||||
borderStrokeWidth: getDirectionConeBorderWidth(context),
|
borderStrokeWidth: getDirectionConeBorderWidth(context),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class _LayerSelectorDialogState extends State<_LayerSelectorDialog> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.surfaceVariant,
|
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(12)),
|
borderRadius: const BorderRadius.vertical(top: Radius.circular(12)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ class MapOverlays extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: uploadMode == UploadMode.sandbox
|
color: uploadMode == UploadMode.sandbox
|
||||||
? Colors.orange.withOpacity(0.90)
|
? Colors.orange.withValues(alpha: 0.90)
|
||||||
: Colors.deepPurple.withOpacity(0.80),
|
: Colors.deepPurple.withValues(alpha: 0.80),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
boxShadow: const [
|
boxShadow: const [
|
||||||
BoxShadow(color: Colors.black26, blurRadius: 5, offset: Offset(0,2)),
|
BoxShadow(color: Colors.black26, blurRadius: 5, offset: Offset(0,2)),
|
||||||
@@ -96,7 +96,7 @@ class MapOverlays extends StatelessWidget {
|
|||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 2),
|
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 2),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.black.withOpacity(0.52),
|
color: Colors.black.withValues(alpha: 0.52),
|
||||||
borderRadius: BorderRadius.circular(7),
|
borderRadius: BorderRadius.circular(7),
|
||||||
),
|
),
|
||||||
child: Builder(
|
child: Builder(
|
||||||
@@ -129,7 +129,7 @@ class MapOverlays extends StatelessWidget {
|
|||||||
onTap: () => _showAttributionDialog(context, attribution!),
|
onTap: () => _showAttributionDialog(context, attribution!),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.surface.withOpacity(0.9),
|
color: Theme.of(context).colorScheme.surface.withValues(alpha: 0.9),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import 'package:latlong2/latlong.dart';
|
|||||||
|
|
||||||
import '../../models/osm_node.dart';
|
import '../../models/osm_node.dart';
|
||||||
import '../../app_state.dart';
|
import '../../app_state.dart';
|
||||||
import '../../state/session_state.dart';
|
|
||||||
import '../../dev_config.dart';
|
import '../../dev_config.dart';
|
||||||
import 'direction_cones.dart';
|
import 'direction_cones.dart';
|
||||||
|
|
||||||
@@ -38,7 +37,7 @@ class OverlayLayerBuilder {
|
|||||||
overlays.add(
|
overlays.add(
|
||||||
Polygon(
|
Polygon(
|
||||||
points: selectedLocation.bounds,
|
points: selectedLocation.bounds,
|
||||||
color: Colors.orange.withOpacity(0.3),
|
color: Colors.orange.withValues(alpha: 0.3),
|
||||||
borderColor: Colors.orange,
|
borderColor: Colors.orange,
|
||||||
borderStrokeWidth: 2.0,
|
borderStrokeWidth: 2.0,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:latlong2/latlong.dart';
|
import 'package:latlong2/latlong.dart';
|
||||||
@@ -182,9 +181,9 @@ class NavigationSheet extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.amber.withOpacity(0.1),
|
color: Colors.amber.withValues(alpha: 0.1),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(color: Colors.amber.withOpacity(0.3)),
|
border: Border.all(color: Colors.amber.withValues(alpha: 0.3)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -212,9 +211,9 @@ class NavigationSheet extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.orange.withOpacity(0.1),
|
color: Colors.orange.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: Colors.orange.withValues(alpha: 0.3)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class NodeTagSheet extends StatelessWidget {
|
|||||||
final isRealOSMNode = !node.tags.containsKey('_pending_upload') &&
|
final isRealOSMNode = !node.tags.containsKey('_pending_upload') &&
|
||||||
node.id > 0; // Real OSM nodes have positive IDs
|
node.id > 0; // Real OSM nodes have positive IDs
|
||||||
|
|
||||||
void _openEditSheet() {
|
void openEditSheet() {
|
||||||
// Check if node limit is active and warn user
|
// Check if node limit is active and warn user
|
||||||
if (isNodeLimitActive) {
|
if (isNodeLimitActive) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
@@ -64,7 +64,7 @@ class NodeTagSheet extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _deleteNode() async {
|
void deleteNode() async {
|
||||||
final shouldDelete = await showDialog<bool>(
|
final shouldDelete = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -95,7 +95,7 @@ class NodeTagSheet extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _viewOnOSM() async {
|
void viewOnOSM() async {
|
||||||
final url = 'https://www.openstreetmap.org/node/${node.id}';
|
final url = 'https://www.openstreetmap.org/node/${node.id}';
|
||||||
try {
|
try {
|
||||||
final uri = Uri.parse(url);
|
final uri = Uri.parse(url);
|
||||||
@@ -117,7 +117,7 @@ class NodeTagSheet extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _openAdvancedEdit() {
|
void openAdvancedEdit() {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
@@ -177,7 +177,7 @@ class NodeTagSheet extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
text: e.value,
|
text: e.value,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
|
color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.7),
|
||||||
),
|
),
|
||||||
linkStyle: TextStyle(
|
linkStyle: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
@@ -201,7 +201,7 @@ class NodeTagSheet extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
if (isRealOSMNode) ...[
|
if (isRealOSMNode) ...[
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
onPressed: () => _viewOnOSM(),
|
onPressed: () => viewOnOSM(),
|
||||||
icon: const Icon(Icons.open_in_new, size: 16),
|
icon: const Icon(Icons.open_in_new, size: 16),
|
||||||
label: Text(locService.t('actions.viewOnOSM')),
|
label: Text(locService.t('actions.viewOnOSM')),
|
||||||
),
|
),
|
||||||
@@ -209,7 +209,7 @@ class NodeTagSheet extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
if (isEditable) ...[
|
if (isEditable) ...[
|
||||||
OutlinedButton.icon(
|
OutlinedButton.icon(
|
||||||
onPressed: _openAdvancedEdit,
|
onPressed: openAdvancedEdit,
|
||||||
icon: const Icon(Icons.open_in_new, size: 18),
|
icon: const Icon(Icons.open_in_new, size: 18),
|
||||||
label: Text(locService.t('actions.advanced')),
|
label: Text(locService.t('actions.advanced')),
|
||||||
style: OutlinedButton.styleFrom(
|
style: OutlinedButton.styleFrom(
|
||||||
@@ -226,7 +226,7 @@ class NodeTagSheet extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
if (isEditable) ...[
|
if (isEditable) ...[
|
||||||
ElevatedButton.icon(
|
ElevatedButton.icon(
|
||||||
onPressed: _openEditSheet,
|
onPressed: openEditSheet,
|
||||||
icon: const Icon(Icons.edit, size: 18),
|
icon: const Icon(Icons.edit, size: 18),
|
||||||
label: Text(locService.edit),
|
label: Text(locService.edit),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
@@ -235,7 +235,7 @@ class NodeTagSheet extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
ElevatedButton.icon(
|
ElevatedButton.icon(
|
||||||
onPressed: node.isConstrained ? null : _deleteNode,
|
onPressed: node.isConstrained ? null : deleteNode,
|
||||||
icon: const Icon(Icons.delete, size: 18),
|
icon: const Icon(Icons.delete, size: 18),
|
||||||
label: Text(locService.t('actions.delete')),
|
label: Text(locService.t('actions.delete')),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class PositioningTutorialOverlay extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.black.withOpacity(0.3), // Semi-transparent overlay
|
color: Colors.black.withValues(alpha: 0.3), // Semi-transparent overlay
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@@ -73,7 +73,7 @@ class PositioningTutorialOverlay extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
locService.t('positioningTutorial.hint'),
|
locService.t('positioningTutorial.hint'),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white.withOpacity(0.8),
|
color: Colors.white.withValues(alpha: 0.8),
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontStyle: FontStyle.italic,
|
fontStyle: FontStyle.italic,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class LocationPin extends StatelessWidget {
|
|||||||
width: size * 0.4,
|
width: size * 0.4,
|
||||||
height: size * 0.2,
|
height: size * 0.2,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.black.withOpacity(0.3),
|
color: Colors.black.withValues(alpha: 0.3),
|
||||||
borderRadius: BorderRadius.circular(size * 0.1),
|
borderRadius: BorderRadius.circular(size * 0.1),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -64,7 +64,7 @@ class LocationPin extends StatelessWidget {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: _pinColor.withOpacity(0.8),
|
color: _pinColor.withValues(alpha: 0.8),
|
||||||
width: 1.5,
|
width: 1.5,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class _ProximityAlertBannerState extends State<ProximityAlertBanner>
|
|||||||
color: Colors.red.shade600,
|
color: Colors.red.shade600,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.black.withOpacity(0.3),
|
color: Colors.black.withValues(alpha: 0.3),
|
||||||
blurRadius: 10,
|
blurRadius: 10,
|
||||||
offset: const Offset(0, 2),
|
offset: const Offset(0, 2),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class ReauthMessagesDialog extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(12.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.primaryContainer.withOpacity(0.3),
|
color: Theme.of(context).colorScheme.primaryContainer.withValues(alpha: 0.3),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|||||||
@@ -81,9 +81,9 @@ class _SubmissionGuideDialogState extends State<SubmissionGuideDialog> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.blue.withOpacity(0.1),
|
color: Colors.blue.withValues(alpha: 0.1),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(color: Colors.blue.withOpacity(0.3)),
|
border: Border.all(color: Colors.blue.withValues(alpha: 0.3)),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
locService.t('submissionGuide.bestPractices'),
|
locService.t('submissionGuide.bestPractices'),
|
||||||
@@ -171,10 +171,10 @@ class _SubmissionGuideDialogState extends State<SubmissionGuideDialog> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
|
color: Theme.of(context).colorScheme.primary.withValues(alpha: 0.1),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: Theme.of(context).colorScheme.primary.withOpacity(0.3),
|
color: Theme.of(context).colorScheme.primary.withValues(alpha: 0.3),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class SuspectedLocationSheet extends StatelessWidget {
|
|||||||
: Text(
|
: Text(
|
||||||
e.value,
|
e.value,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
|
color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.7),
|
||||||
),
|
),
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
),
|
),
|
||||||
@@ -128,7 +128,7 @@ class SuspectedLocationSheet extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'${location.centroid.latitude.toStringAsFixed(6)}, ${location.centroid.longitude.toStringAsFixed(6)}',
|
'${location.centroid.latitude.toStringAsFixed(6)}, ${location.centroid.longitude.toStringAsFixed(6)}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
|
color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.7),
|
||||||
),
|
),
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -88,9 +88,9 @@ class _WelcomeDialogState extends State<WelcomeDialog> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.orange.withOpacity(0.1),
|
color: Colors.orange.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: Colors.orange.withValues(alpha: 0.3)),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
locService.t('welcome.firsthandKnowledge'),
|
locService.t('welcome.firsthandKnowledge'),
|
||||||
@@ -171,10 +171,10 @@ class _WelcomeDialogState extends State<WelcomeDialog> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
|
color: Theme.of(context).colorScheme.primary.withValues(alpha: 0.1),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: Theme.of(context).colorScheme.primary.withOpacity(0.3),
|
color: Theme.of(context).colorScheme.primary.withValues(alpha: 0.3),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
Reference in new issue
Block a user