style: Update padding and text styles in LocationDisplay and CompassHeader for improved UI consistency

This commit is contained in:
Janez T
2025-10-15 10:44:46 +02:00
parent dbaf09e701
commit 3c3db22eb0
2 changed files with 69 additions and 67 deletions

View File

@@ -20,24 +20,25 @@ class LocationDisplay extends StatelessWidget {
return GestureDetector( return GestureDetector(
onTap: () => _showLocationFormats(context), onTap: () => _showLocationFormats(context),
child: Container( child: Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainerHighest, color: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(8),
), ),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const Icon(Icons.location_on, size: 16), const Icon(Icons.location_on, size: 18),
const SizedBox(width: 6), const SizedBox(width: 6),
Text( Text(
'${location.latitude.toStringAsFixed(5)}, ${location.longitude.toStringAsFixed(5)}', '${location.latitude.toStringAsFixed(5)}, ${location.longitude.toStringAsFixed(5)}',
style: Theme.of(context).textTheme.bodyMedium?.copyWith( style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontFamily: 'monospace', fontFamily: 'monospace',
fontWeight: FontWeight.w500, fontWeight: FontWeight.w600,
), ),
), ),
const SizedBox(width: 4), const SizedBox(width: 6),
Icon( Icon(
Icons.open_in_new, Icons.open_in_new,
size: 14, size: 14,
@@ -64,64 +65,66 @@ class LocationDisplay extends StatelessWidget {
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)), borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
), ),
builder: (context) => Container( builder: (context) => SingleChildScrollView(
padding: const EdgeInsets.all(24), child: Container(
child: Column( padding: const EdgeInsets.all(24),
mainAxisSize: MainAxisSize.min, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
// Header children: [
Row( // Header
mainAxisAlignment: MainAxisAlignment.spaceBetween, Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
const Text( children: [
'Location Formats', const Text(
style: TextStyle( 'Location Formats',
fontSize: 20, style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20,
fontWeight: FontWeight.bold,
),
), ),
), IconButton(
IconButton( icon: const Icon(Icons.close),
icon: const Icon(Icons.close), onPressed: () => Navigator.pop(context),
onPressed: () => Navigator.pop(context), ),
), ],
], ),
), const SizedBox(height: 16),
const SizedBox(height: 16), const Divider(),
const Divider(), const SizedBox(height: 8),
const SizedBox(height: 8), // Decimal Degrees (DD)
// Decimal Degrees (DD) _buildFormatRow(
_buildFormatRow( context,
context, 'DD (Decimal Degrees)',
'DD (Decimal Degrees)', '${location.latitude.toStringAsFixed(6)}, ${location.longitude.toStringAsFixed(6)}',
'${location.latitude.toStringAsFixed(6)}, ${location.longitude.toStringAsFixed(6)}', ),
), // Degrees Minutes Seconds (DMS)
// Degrees Minutes Seconds (DMS) _buildFormatRow(
_buildFormatRow( context,
context, 'DMS (Degrees Minutes Seconds)',
'DMS (Degrees Minutes Seconds)', _convertToDMS(location.latitude, location.longitude),
_convertToDMS(location.latitude, location.longitude), ),
), // Degrees Decimal Minutes (DDM)
// Degrees Decimal Minutes (DDM) _buildFormatRow(
_buildFormatRow( context,
context, 'DDM (Degrees Decimal Minutes)',
'DDM (Degrees Decimal Minutes)', _convertToDDM(location.latitude, location.longitude),
_convertToDDM(location.latitude, location.longitude), ),
), // MGRS (Military Grid Reference System)
// MGRS (Military Grid Reference System) _buildFormatRow(
_buildFormatRow( context,
context, 'MGRS (Military Grid)',
'MGRS (Military Grid)', _convertToMGRS(location.latitude, location.longitude),
_convertToMGRS(location.latitude, location.longitude), ),
), // Google Plus Code
// Google Plus Code _buildFormatRow(
_buildFormatRow( context,
context, 'Plus Code',
'Plus Code', _convertToPlusCode(location.latitude, location.longitude),
_convertToPlusCode(location.latitude, location.longitude), ),
), const SizedBox(height: 8),
const SizedBox(height: 8), ],
], ),
), ),
), ),
); );

View File

@@ -576,7 +576,7 @@ class _LocationFormatToggleState extends State<_LocationFormatToggle> {
}, },
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
child: Container( child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainerHighest, color: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@@ -585,10 +585,9 @@ class _LocationFormatToggleState extends State<_LocationFormatToggle> {
child: Text( child: Text(
displayText, displayText,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodySmall?.copyWith( style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w600,
fontFamily: 'monospace', fontFamily: 'monospace',
fontSize: 11,
), ),
), ),
), ),