mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-06 16:56:41 +10:00
make raster tile source scollable
This commit is contained in:
@@ -626,24 +626,31 @@ 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: RadioGroup<String>(
|
child: ConstrainedBox(
|
||||||
groupValue: selectedId,
|
constraints: BoxConstraints(
|
||||||
onChanged: (value) {
|
maxHeight: MediaQuery.of(dialogContext).size.height * 0.6,
|
||||||
if (value == null) return;
|
),
|
||||||
setState(() {
|
child: SingleChildScrollView(
|
||||||
selectedId = value;
|
child: RadioGroup<String>(
|
||||||
});
|
groupValue: selectedId,
|
||||||
},
|
onChanged: (value) {
|
||||||
child: Column(
|
if (value == null) return;
|
||||||
mainAxisSize: MainAxisSize.min,
|
setState(() {
|
||||||
children: [
|
selectedId = value;
|
||||||
for (final option in MapRasterSourceCatalog.presets)
|
});
|
||||||
RadioListTile<String>(
|
},
|
||||||
value: option.id,
|
child: Column(
|
||||||
title: Text(option.label),
|
mainAxisSize: MainAxisSize.min,
|
||||||
subtitle: Text(option.description),
|
children: [
|
||||||
),
|
for (final option in MapRasterSourceCatalog.presets)
|
||||||
],
|
RadioListTile<String>(
|
||||||
|
value: option.id,
|
||||||
|
title: Text(option.label),
|
||||||
|
subtitle: Text(option.description),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -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,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user