make raster tile source scollable

This commit is contained in:
ericz
2026-05-24 11:55:50 +02:00
parent 11a4f9a373
commit bdd0d3dee2
2 changed files with 68 additions and 34 deletions
+25 -18
View File
@@ -626,24 +626,31 @@ class AppSettingsScreen extends StatelessWidget {
title: const Text('Raster Tile Source'),
content: SizedBox(
width: 360,
child: RadioGroup<String>(
groupValue: selectedId,
onChanged: (value) {
if (value == null) return;
setState(() {
selectedId = value;
});
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
for (final option in MapRasterSourceCatalog.presets)
RadioListTile<String>(
value: option.id,
title: Text(option.label),
subtitle: Text(option.description),
),
],
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(dialogContext).size.height * 0.6,
),
child: SingleChildScrollView(
child: RadioGroup<String>(
groupValue: selectedId,
onChanged: (value) {
if (value == null) return;
setState(() {
selectedId = value;
});
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
for (final option in MapRasterSourceCatalog.presets)
RadioListTile<String>(
value: option.id,
title: Text(option.label),
subtitle: Text(option.description),
),
],
),
),
),
),
),
+43 -16
View File
@@ -288,9 +288,8 @@ class MapTileCacheService extends ChangeNotifier {
String get urlTemplate => _buildUrlTemplate(appSettingsService.settings);
TileBuilder? get tileBuilder => isInvertedOsmDarkSource
? _osmDarkTileBuilder
: null;
TileBuilder? get tileBuilder =>
isInvertedOsmDarkSource ? _osmDarkTileBuilder : null;
bool get isInvertedOsmDarkSource =>
source.id == MapRasterSourceCatalog.osmDark.id;
@@ -638,24 +637,52 @@ class MapTileCacheService extends ChangeNotifier {
}
}
Widget _osmDarkTileBuilder(
BuildContext _,
Widget tileWidget,
TileImage __,
) {
Widget _osmDarkTileBuilder(BuildContext _, Widget tileWidget, TileImage tile) {
return ColorFiltered(
colorFilter: const ColorFilter.matrix(<double>[
1.33, 0, 0, 0, 0,
0, 1.33, 0, 0, 0,
0, 0, 1.33, 0, 0,
0, 0, 0, 1, 0,
1.33,
0,
0,
0,
0,
0,
1.33,
0,
0,
0,
0,
0,
1.33,
0,
0,
0,
0,
0,
1,
0,
]),
child: ColorFiltered(
colorFilter: const ColorFilter.matrix(<double>[
0.5740000009536743, -1.4299999475479126, -0.14399999380111694, 0, 255,
-0.4259999990463257, -0.429999977350235, -0.14399999380111694, 0, 255,
-0.4259999990463257, -1.4299999475479126, 0.8559999465942383, 0, 255,
0, 0, 0, 1, 0,
0.5740000009536743,
-1.4299999475479126,
-0.14399999380111694,
0,
255,
-0.4259999990463257,
-0.429999977350235,
-0.14399999380111694,
0,
255,
-0.4259999990463257,
-1.4299999475479126,
0.8559999465942383,
0,
255,
0,
0,
0,
1,
0,
]),
child: tileWidget,
),