Térkép refraktorálás
This commit is contained in:
@@ -27,66 +27,23 @@ class GnssStatusChip extends StatelessWidget {
|
||||
return Obx(() {
|
||||
final connState = GnssService.to.connectionState.value;
|
||||
final quality = GnssService.to.gpsQuality.value;
|
||||
final device = GnssDeviceService.to.selectedDevice.value;
|
||||
final sats = GnssService.to.satelliteCount.value;
|
||||
|
||||
final isConnected = connState == GnssConnectionState.connected;
|
||||
final isConn = connState == GnssConnectionState.connected;
|
||||
final isConnecting = connState == GnssConnectionState.connecting;
|
||||
final color = _chipColor(isConnected, quality);
|
||||
final label = _chipLabel(connState, quality, device?.name);
|
||||
final color = _chipColor(isConn, quality);
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => GnssDevicePickerDialog.show(),
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: color.withOpacity(0.5)),
|
||||
),
|
||||
child: Row(mainAxisSize: MainAxisSize.min, children: [
|
||||
// Állapot ikon
|
||||
if (isConnecting)
|
||||
SizedBox(
|
||||
width: 10,
|
||||
height: 10,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 1.5,
|
||||
color: color,
|
||||
),
|
||||
)
|
||||
else
|
||||
Icon(
|
||||
_chipIcon(isConnected, quality),
|
||||
size: 12,
|
||||
color: color,
|
||||
),
|
||||
|
||||
const SizedBox(width: 4),
|
||||
|
||||
// Felirat
|
||||
Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
|
||||
// Műholdak száma (csak ha van fix)
|
||||
if (isConnected && quality > 0) ...[
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'($sats)',
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
color: color.withOpacity(0.8),
|
||||
),
|
||||
),
|
||||
],
|
||||
]),
|
||||
return Tooltip(
|
||||
// Hosszú nyomásra szöveg jelenik meg
|
||||
message: _chipLabel(connState, quality, ''),
|
||||
child: IconButton(
|
||||
icon: isConnecting
|
||||
? SizedBox(
|
||||
width: 18,
|
||||
height: 18,
|
||||
child:
|
||||
CircularProgressIndicator(strokeWidth: 2, color: color),
|
||||
)
|
||||
: Icon(_chipIcon(isConn, quality), color: color),
|
||||
onPressed: () => GnssDevicePickerDialog.show(),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user