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
+7
View File
@@ -626,6 +626,11 @@ class AppSettingsScreen extends StatelessWidget {
title: const Text('Raster Tile Source'), title: const Text('Raster Tile Source'),
content: SizedBox( content: SizedBox(
width: 360, width: 360,
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(dialogContext).size.height * 0.6,
),
child: SingleChildScrollView(
child: RadioGroup<String>( child: RadioGroup<String>(
groupValue: selectedId, groupValue: selectedId,
onChanged: (value) { onChanged: (value) {
@@ -647,6 +652,8 @@ class AppSettingsScreen extends StatelessWidget {
), ),
), ),
), ),
),
),
actions: [ actions: [
TextButton( TextButton(
onPressed: () => Navigator.pop(dialogContext), onPressed: () => Navigator.pop(dialogContext),
+43 -16
View File
@@ -288,9 +288,8 @@ class MapTileCacheService extends ChangeNotifier {
String get urlTemplate => _buildUrlTemplate(appSettingsService.settings); String get urlTemplate => _buildUrlTemplate(appSettingsService.settings);
TileBuilder? get tileBuilder => isInvertedOsmDarkSource TileBuilder? get tileBuilder =>
? _osmDarkTileBuilder isInvertedOsmDarkSource ? _osmDarkTileBuilder : null;
: null;
bool get isInvertedOsmDarkSource => bool get isInvertedOsmDarkSource =>
source.id == MapRasterSourceCatalog.osmDark.id; source.id == MapRasterSourceCatalog.osmDark.id;
@@ -638,24 +637,52 @@ class MapTileCacheService extends ChangeNotifier {
} }
} }
Widget _osmDarkTileBuilder( Widget _osmDarkTileBuilder(BuildContext _, Widget tileWidget, TileImage tile) {
BuildContext _,
Widget tileWidget,
TileImage __,
) {
return ColorFiltered( return ColorFiltered(
colorFilter: const ColorFilter.matrix(<double>[ colorFilter: const ColorFilter.matrix(<double>[
1.33, 0, 0, 0, 0, 1.33,
0, 1.33, 0, 0, 0, 0,
0, 0, 1.33, 0, 0, 0,
0, 0, 0, 1, 0, 0,
0,
0,
1.33,
0,
0,
0,
0,
0,
1.33,
0,
0,
0,
0,
0,
1,
0,
]), ]),
child: ColorFiltered( child: ColorFiltered(
colorFilter: const ColorFilter.matrix(<double>[ colorFilter: const ColorFilter.matrix(<double>[
0.5740000009536743, -1.4299999475479126, -0.14399999380111694, 0, 255, 0.5740000009536743,
-0.4259999990463257, -0.429999977350235, -0.14399999380111694, 0, 255, -1.4299999475479126,
-0.4259999990463257, -1.4299999475479126, 0.8559999465942383, 0, 255, -0.14399999380111694,
0, 0, 0, 1, 0, 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, child: tileWidget,
), ),