fix: Update import path for AppLocalizations in CompassSarList widget

This commit is contained in:
Janez T
2025-10-16 16:07:22 +02:00
parent 01a1bbec44
commit f95edcb477
21 changed files with 2055 additions and 91 deletions

View File

@@ -1,3 +1,6 @@
import 'package:flutter/material.dart';
import '../l10n/app_localizations.dart';
enum MapLayerType {
openStreetMap,
openTopoMap,
@@ -19,6 +22,19 @@ class MapLayer {
required this.maxZoom,
});
/// Get localized name for the layer
String getLocalizedName(BuildContext context) {
final localizations = AppLocalizations.of(context)!;
switch (type) {
case MapLayerType.openStreetMap:
return localizations.openStreetMap;
case MapLayerType.openTopoMap:
return localizations.openTopoMap;
case MapLayerType.esriWorldImagery:
return localizations.esriSatellite;
}
}
static const openStreetMap = MapLayer(
type: MapLayerType.openStreetMap,
name: 'OpenStreetMap',