feat(legacy): add connection status indicator to device banners
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user