feat(legacy): add connection status indicator to device banners

This commit is contained in:
2026-04-26 09:05:09 +02:00
parent a87c7e8732
commit 8ff94a1e92
2 changed files with 51 additions and 16 deletions

View File

@@ -166,14 +166,32 @@ class LocationBanner extends ConsumerWidget {
mainAxisSize: MainAxisSize.min,
children: [
if (deviceName != null)
Text(
deviceName,
style: TextStyle(
fontSize: isCompact ? 12 : 14,
fontWeight: FontWeight.w600,
color: Theme.of(context).colorScheme.onSurface,
),
overflow: TextOverflow.ellipsis,
Row(
children: [
Container(
width: isCompact ? 7 : 9,
height: isCompact ? 7 : 9,
margin: EdgeInsets.only(right: isCompact ? 4 : 6),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: device?.isDisconnected == true
? Colors.red
: Colors.green,
),
),
Expanded(
child: Text(
deviceName,
style: TextStyle(
fontSize: isCompact ? 12 : 14,
fontWeight: FontWeight.w600,
color:
Theme.of(context).colorScheme.onSurface,
),
overflow: TextOverflow.ellipsis,
),
),
],
),
if (addressText.isNotEmpty)
Padding(

View File

@@ -195,14 +195,31 @@ class _DeviceCard extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
deviceName,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w700,
color: primaryColor,
),
overflow: TextOverflow.ellipsis,
Row(
children: [
Container(
width: 10,
height: 10,
margin: const EdgeInsets.only(right: 6),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: device.isDisconnected
? Colors.red
: Colors.green,
),
),
Expanded(
child: Text(
deviceName,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w700,
color: primaryColor,
),
overflow: TextOverflow.ellipsis,
),
),
],
),
const SizedBox(height: 8),
if (address.isNotEmpty)