From bc1a9044c2b3bd0b3956417afe8710364fa857fe Mon Sep 17 00:00:00 2001 From: lowrt Date: Tue, 13 Jan 2026 22:36:34 +0800 Subject: [PATCH 1/2] fix: settings --- lib/app/settings/map/page.dart | 79 +++------------------------------- 1 file changed, 7 insertions(+), 72 deletions(-) diff --git a/lib/app/settings/map/page.dart b/lib/app/settings/map/page.dart index d5930973a..1bd72a61f 100644 --- a/lib/app/settings/map/page.dart +++ b/lib/app/settings/map/page.dart @@ -65,8 +65,7 @@ class SettingsMapPage extends StatelessWidget { children: [ _buildHeader(context), const SizedBox(height: 16), - _buildBaseMapCard(context, model, baseMapLabels), - _buildLayersCard(context, model, layerLabels), + _buildMapSettingCard(context, model, baseMapLabels, layerLabels), _buildAutoZoomCard(context, model), _buildAnimationFpsCard(context, model), ], @@ -117,11 +116,13 @@ class SettingsMapPage extends StatelessWidget { ); } - Widget _buildBaseMapCard( + Widget _buildMapSettingCard( BuildContext context, SettingsMapModel model, Map baseMapLabels, + Map layerLabels, ) { + final layersText = model.layers.map((e) => layerLabels[e]!).join(', '); return Container( margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 6), decoration: BoxDecoration( @@ -155,81 +156,15 @@ class SettingsMapPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - '底圖'.i18n, - style: context.texts.titleMedium?.copyWith( - fontWeight: FontWeight.w600, - ), - ), - const SizedBox(height: 2), - Text( - baseMapLabels[model.baseMap]!, - style: context.texts.bodySmall?.copyWith( - color: context.colors.onSurfaceVariant, - ), - ), - ], - ), - ), - Icon( - Symbols.chevron_right_rounded, - color: context.colors.onSurfaceVariant, - ), - ], - ), - ), - ), - ), - ); - } - - Widget _buildLayersCard( - BuildContext context, - SettingsMapModel model, - Map layerLabels, - ) { - final layersText = model.layers.map((e) => layerLabels[e]!).join(', '); - - return Container( - margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 6), - decoration: BoxDecoration( - color: context.colors.surfaceContainerLow, - borderRadius: BorderRadius.circular(16), - ), - child: Material( - color: Colors.transparent, - child: InkWell( - borderRadius: BorderRadius.circular(16), - onTap: () => showLayerSheet(context), - child: Padding( - padding: const EdgeInsets.all(16), - child: Row( - children: [ - Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.purple.withValues(alpha: 0.15), - borderRadius: BorderRadius.circular(12), - ), - child: Icon( - Symbols.stacks_rounded, - color: Colors.purple, - size: 24, - ), - ), - const SizedBox(width: 16), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '初始圖層'.i18n, + '${'底圖'.i18n} · ${'初始圖層'.i18n}', style: context.texts.titleMedium?.copyWith( fontWeight: FontWeight.w600, ), ), const SizedBox(height: 2), Text( - layersText.isEmpty ? '無'.i18n : layersText, + '${baseMapLabels[model.baseMap]!} · ' + '${layersText.isEmpty ? '無'.i18n : layersText}', style: context.texts.bodySmall?.copyWith( color: context.colors.onSurfaceVariant, ), From a51e8a11c03e4bcb87a6e468e8cabcc1869f881c Mon Sep 17 00:00:00 2001 From: lowrt Date: Wed, 14 Jan 2026 08:44:05 +0800 Subject: [PATCH 2/2] fix: text --- lib/app/settings/map/page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/app/settings/map/page.dart b/lib/app/settings/map/page.dart index 1bd72a61f..8e673e0d1 100644 --- a/lib/app/settings/map/page.dart +++ b/lib/app/settings/map/page.dart @@ -156,14 +156,14 @@ class SettingsMapPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - '${'底圖'.i18n} · ${'初始圖層'.i18n}', + '${'底圖'.i18n} & ${'初始圖層'.i18n}', style: context.texts.titleMedium?.copyWith( fontWeight: FontWeight.w600, ), ), const SizedBox(height: 2), Text( - '${baseMapLabels[model.baseMap]!} · ' + '${baseMapLabels[model.baseMap]!} & ' '${layersText.isEmpty ? '無'.i18n : layersText}', style: context.texts.bodySmall?.copyWith( color: context.colors.onSurfaceVariant,