dart format

This commit is contained in:
Eric Poulsen
2026-06-13 22:05:46 -07:00
parent e1536c49b1
commit 5f54a2cd1b
4 changed files with 161 additions and 150 deletions
+3 -1
View File
@@ -125,7 +125,9 @@ class _BleDebugLogScreenState extends State<BleDebugLogScreen> {
if (context.mounted) { if (context.mounted) {
showDismissibleSnackBar( showDismissibleSnackBar(
context, context,
content: Text(context.l10n.debugLog_bleCopied), content: Text(
context.l10n.debugLog_bleCopied,
),
); );
} }
} }
+110 -110
View File
@@ -438,133 +438,133 @@ class _ChannelsScreenState extends State<ChannelsScreen>
) )
: null, : null,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
// Leading avatar with optional community badge // Leading avatar with optional community badge
Stack( Stack(
clipBehavior: Clip.none, clipBehavior: Clip.none,
children: [ children: [
AvatarCircle( AvatarCircle(
name: channelLabel, name: channelLabel,
size: 42, size: 42,
color: iconColor, color: iconColor,
icon: icon, icon: icon,
),
if (isCommunityChannel)
Positioned(
right: -2,
bottom: -2,
child: Container(
width: 16,
height: 16,
decoration: BoxDecoration(
color: MeshPalette.magenta,
shape: BoxShape.circle,
border: Border.all(
color: Theme.of(
context,
).colorScheme.surfaceContainerLow,
width: 2,
),
),
child: const Icon(
Icons.people,
size: 8,
color: Colors.white,
),
),
),
],
),
const SizedBox(width: 12),
// Title + subtitle + ch chip
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
channelLabel,
style: Theme.of(context).textTheme.bodyMedium
?.copyWith(fontWeight: FontWeight.w500),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(width: 6),
StatusChip(
label: 'CH ${channel.index}',
color: MeshPalette.blue,
fontSize: 10,
),
],
),
if (lastPreview.isNotEmpty) ...[
const SizedBox(height: 2),
Text(
lastPreview,
style: MeshTheme.mono(
fontSize: 11.5,
color: scheme.onSurfaceVariant,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
],
), ),
), if (isCommunityChannel)
const SizedBox(width: 8), Positioned(
// Right side: time + unread badge + muted + drag handle right: -2,
Column( bottom: -2,
crossAxisAlignment: CrossAxisAlignment.end, child: Container(
width: 16,
height: 16,
decoration: BoxDecoration(
color: MeshPalette.magenta,
shape: BoxShape.circle,
border: Border.all(
color: Theme.of(
context,
).colorScheme.surfaceContainerLow,
width: 2,
),
),
child: const Icon(
Icons.people,
size: 8,
color: Colors.white,
),
),
),
],
),
const SizedBox(width: 12),
// Title + subtitle + ch chip
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (lastTime != null)
Text(
_relativeTime(lastTime),
style: MeshTheme.mono(
fontSize: 11,
color: scheme.onSurfaceVariant,
),
),
const SizedBox(height: 4),
Row( Row(
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
if (isMuted) ...[ Expanded(
Icon( child: Text(
Icons.notifications_off, channelLabel,
size: 14, style: Theme.of(context).textTheme.bodyMedium
color: scheme.onSurfaceVariant, ?.copyWith(fontWeight: FontWeight.w500),
maxLines: 1,
overflow: TextOverflow.ellipsis,
), ),
const SizedBox(width: 4), ),
], const SizedBox(width: 6),
if (unreadCount > 0) UnreadBadge(count: unreadCount), StatusChip(
label: 'CH ${channel.index}',
color: MeshPalette.blue,
fontSize: 10,
),
], ],
), ),
if (lastPreview.isNotEmpty) ...[
const SizedBox(height: 2),
Text(
lastPreview,
style: MeshTheme.mono(
fontSize: 11.5,
color: scheme.onSurfaceVariant,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
], ],
), ),
if (showDragHandle && dragIndex != null) ...[ ),
const SizedBox(width: 4), const SizedBox(width: 8),
ReorderableDragStartListener( // Right side: time + unread badge + muted + drag handle
index: dragIndex, Column(
child: Padding( crossAxisAlignment: CrossAxisAlignment.end,
padding: const EdgeInsets.all(8), mainAxisSize: MainAxisSize.min,
child: Icon( children: [
Icons.drag_handle, if (lastTime != null)
Text(
_relativeTime(lastTime),
style: MeshTheme.mono(
fontSize: 11,
color: scheme.onSurfaceVariant, color: scheme.onSurfaceVariant,
), ),
), ),
const SizedBox(height: 4),
Row(
mainAxisSize: MainAxisSize.min,
children: [
if (isMuted) ...[
Icon(
Icons.notifications_off,
size: 14,
color: scheme.onSurfaceVariant,
),
const SizedBox(width: 4),
],
if (unreadCount > 0) UnreadBadge(count: unreadCount),
],
), ),
], ],
),
if (showDragHandle && dragIndex != null) ...[
const SizedBox(width: 4),
ReorderableDragStartListener(
index: dragIndex,
child: Padding(
padding: const EdgeInsets.all(8),
child: Icon(
Icons.drag_handle,
color: scheme.onSurfaceVariant,
),
),
),
], ],
), ],
), ),
),
); );
} }
+5 -1
View File
@@ -285,7 +285,11 @@ class _MapScreenState extends State<MapScreen> {
); );
} }
void _handleMapContextPress(BuildContext context, MeshCoreConnector connector, LatLng latLng) { void _handleMapContextPress(
BuildContext context,
MeshCoreConnector connector,
LatLng latLng,
) {
if (_isSelectingPoi) { if (_isSelectingPoi) {
setState(() { setState(() {
_isSelectingPoi = false; _isSelectingPoi = false;
+43 -38
View File
@@ -538,57 +538,62 @@ class _RoutingSheetBodyState extends State<_RoutingSheetBody> {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onSecondaryTapUp: PlatformInfo.isDesktop && hasBytes onSecondaryTapUp: PlatformInfo.isDesktop && hasBytes
? (_) => _showPathDetail(context, connector, contact, record.pathBytes) ? (_) =>
_showPathDetail(context, connector, contact, record.pathBytes)
: null, : null,
child: Card( child: Card(
margin: const EdgeInsets.symmetric(vertical: 4), margin: const EdgeInsets.symmetric(vertical: 4),
child: ListTile( child: ListTile(
enabled: hasBytes, enabled: hasBytes,
leading: CircleAvatar( leading: CircleAvatar(
radius: 18, radius: 18,
backgroundColor: bg, backgroundColor: bg,
child: Icon( child: Icon(
_qualityIcon(quality), _qualityIcon(quality),
size: 18, size: 18,
color: fg, color: fg,
semanticLabel: _qualityLabel(context, quality), semanticLabel: _qualityLabel(context, quality),
),
), ),
), title: Text(title, maxLines: 1, overflow: TextOverflow.ellipsis),
title: Text(title, maxLines: 1, overflow: TextOverflow.ellipsis), subtitle: Text(
subtitle: Text( '$line1\n${line2Parts.join('')}',
'$line1\n${line2Parts.join('')}', style: const TextStyle(fontSize: 11),
style: const TextStyle(fontSize: 11), ),
), isThreeLine: true,
isThreeLine: true, trailing: Row(
trailing: Row( mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, children: [
children: [ if (inUse)
if (inUse) Tooltip(
Tooltip( message: l10n.routing_inUse,
message: l10n.routing_inUse, child: Icon(
child: Icon( Icons.check_circle,
Icons.check_circle, color: scheme.primary,
color: scheme.primary, semanticLabel: l10n.routing_inUse,
semanticLabel: l10n.routing_inUse, ),
),
IconButton(
icon: const Icon(Icons.delete_outline, size: 20),
tooltip: l10n.chat_removePath,
constraints: const BoxConstraints(minWidth: 44, minHeight: 44),
onPressed: () => pathService.removePathRecord(
contact.publicKeyHex,
record.pathBytes,
), ),
), ),
IconButton( ],
icon: const Icon(Icons.delete_outline, size: 20), ),
tooltip: l10n.chat_removePath,
constraints: const BoxConstraints(minWidth: 44, minHeight: 44),
onPressed: () => pathService.removePathRecord(
contact.publicKeyHex,
record.pathBytes,
),
),
],
),
onTap: hasBytes && !inUse onTap: hasBytes && !inUse
? () => _applyHistoryPath(connector, contact, record) ? () => _applyHistoryPath(connector, contact, record)
: null, : null,
onLongPress: hasBytes onLongPress: hasBytes
? () => ? () => _showPathDetail(
_showPathDetail(context, connector, contact, record.pathBytes) context,
connector,
contact,
record.pathBytes,
)
: null, : null,
), ),
), ),