mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-06-18 16:36:27 +10:00
format files
This commit is contained in:
@@ -30,7 +30,9 @@ class DeviceTile extends StatelessWidget {
|
||||
final name = device.platformName.isNotEmpty
|
||||
? device.platformName
|
||||
: scanResult.advertisementData.advName;
|
||||
final displayName = name.isNotEmpty ? name : context.l10n.common_unknownDevice;
|
||||
final displayName = name.isNotEmpty
|
||||
? name
|
||||
: context.l10n.common_unknownDevice;
|
||||
final mac = device.remoteId.toString();
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
|
||||
@@ -55,11 +57,7 @@ class DeviceTile extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
AvatarCircle(
|
||||
name: displayName,
|
||||
size: 42,
|
||||
icon: Icons.router,
|
||||
),
|
||||
AvatarCircle(name: displayName, size: 42, icon: Icons.router),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
@@ -107,10 +105,7 @@ class DeviceTile extends StatelessWidget {
|
||||
const SizedBox(height: 3),
|
||||
Text(
|
||||
'$rssi dBm',
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 10,
|
||||
color: signalUi.color,
|
||||
),
|
||||
style: MeshTheme.mono(fontSize: 10, color: signalUi.color),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -60,10 +60,7 @@ class _FeatureToggleRow extends State<FeatureToggleRow> {
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Switch(
|
||||
value: widget.value,
|
||||
onChanged: widget.onChanged,
|
||||
),
|
||||
Switch(value: widget.value, onChanged: widget.onChanged),
|
||||
if (widget.hasRefreshing) ...[
|
||||
const SizedBox(width: 4),
|
||||
widget.isRefreshing
|
||||
|
||||
@@ -29,10 +29,7 @@ class JumpToBottomButton extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: scheme.surfaceContainerHigh.withValues(alpha: 0.92),
|
||||
border: Border.all(
|
||||
color: scheme.outlineVariant,
|
||||
width: 1,
|
||||
),
|
||||
border: Border.all(color: scheme.outlineVariant, width: 1),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.18),
|
||||
|
||||
@@ -350,7 +350,9 @@ class RouteChip extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final label = isDirect
|
||||
? (hops == null || hops == 0 ? 'DIRECT' : '$hops HOP${hops == 1 ? '' : 'S'}')
|
||||
? (hops == null || hops == 0
|
||||
? 'DIRECT'
|
||||
: '$hops HOP${hops == 1 ? '' : 'S'}')
|
||||
: 'FLOOD';
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
||||
@@ -536,9 +538,7 @@ Future<T?> showMeshSheet<T>(
|
||||
useSafeArea: true,
|
||||
showDragHandle: false,
|
||||
builder: (context) => Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.viewInsetsOf(context).bottom,
|
||||
),
|
||||
padding: EdgeInsets.only(bottom: MediaQuery.viewInsetsOf(context).bottom),
|
||||
child: builder(context),
|
||||
),
|
||||
);
|
||||
@@ -574,10 +574,7 @@ class ErrorRetryCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
if (onRetry != null)
|
||||
TextButton(
|
||||
onPressed: onRetry,
|
||||
child: Text(retryLabel ?? 'Retry'),
|
||||
),
|
||||
TextButton(onPressed: onRetry, child: Text(retryLabel ?? 'Retry')),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -610,10 +607,7 @@ class _ListEntranceState extends State<ListEntrance>
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 280),
|
||||
);
|
||||
_curve = CurvedAnimation(
|
||||
parent: _controller,
|
||||
curve: Curves.easeOutCubic,
|
||||
);
|
||||
_curve = CurvedAnimation(parent: _controller, curve: Curves.easeOutCubic);
|
||||
final delay = Duration(milliseconds: 24 * widget.index.clamp(0, 12));
|
||||
Future.delayed(delay, () {
|
||||
if (mounted) _controller.forward();
|
||||
|
||||
@@ -72,11 +72,7 @@ class _MessageStatusIconState extends State<MessageStatusIcon>
|
||||
if (widget.isFailed) {
|
||||
return Semantics(
|
||||
label: l10n.messageStatus_failed,
|
||||
child: Icon(
|
||||
Icons.cancel,
|
||||
size: size,
|
||||
color: colorScheme.error,
|
||||
),
|
||||
child: Icon(Icons.cancel, size: size, color: colorScheme.error),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -160,10 +160,7 @@ List<Polyline> buildPacketTrailPolylines(
|
||||
}
|
||||
|
||||
/// The moving packet dot and the pulse ring at the hop it just reached.
|
||||
List<Marker> buildPacketMarkers(
|
||||
PathPlaybackController playback,
|
||||
Color color,
|
||||
) {
|
||||
List<Marker> buildPacketMarkers(PathPlaybackController playback, Color color) {
|
||||
if (!playback.started || !playback.hasPath) return const [];
|
||||
final markers = <Marker>[];
|
||||
|
||||
@@ -412,7 +409,9 @@ class PathAnimationControls extends StatelessWidget {
|
||||
),
|
||||
controlButton(
|
||||
icon: playback.playing ? Icons.pause : Icons.play_arrow,
|
||||
tooltip: playback.playing ? l10n.pathMap_pause : l10n.pathMap_play,
|
||||
tooltip: playback.playing
|
||||
? l10n.pathMap_pause
|
||||
: l10n.pathMap_play,
|
||||
onPressed: enabled ? playback.togglePlay : null,
|
||||
),
|
||||
controlButton(
|
||||
@@ -635,7 +634,10 @@ class PathSummaryList extends StatelessWidget {
|
||||
parts.join(' · '),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: MeshTheme.mono(fontSize: 10.5, color: MeshPalette.ink3),
|
||||
style: MeshTheme.mono(
|
||||
fontSize: 10.5,
|
||||
color: MeshPalette.ink3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -332,19 +332,12 @@ class _RepeaterLoginDialogState extends State<RepeaterLoginDialog> {
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.error,
|
||||
size: 18,
|
||||
color: scheme.error,
|
||||
),
|
||||
Icon(Icons.error, size: 18, color: scheme.error),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
_loginError!,
|
||||
style: TextStyle(
|
||||
color: scheme.error,
|
||||
fontSize: 13,
|
||||
),
|
||||
style: TextStyle(color: scheme.error, fontSize: 13),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -435,9 +428,7 @@ class _RepeaterLoginDialogState extends State<RepeaterLoginDialog> {
|
||||
Icon(
|
||||
Icons.auto_mode,
|
||||
size: 20,
|
||||
color: !isFloodMode
|
||||
? scheme.primary
|
||||
: null,
|
||||
color: !isFloodMode ? scheme.primary : null,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
@@ -458,9 +449,7 @@ class _RepeaterLoginDialogState extends State<RepeaterLoginDialog> {
|
||||
Icon(
|
||||
Icons.waves,
|
||||
size: 20,
|
||||
color: isFloodMode
|
||||
? scheme.primary
|
||||
: null,
|
||||
color: isFloodMode ? scheme.primary : null,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
|
||||
@@ -364,9 +364,7 @@ class _RoomLoginDialogState extends State<RoomLoginDialog> {
|
||||
Icon(
|
||||
Icons.auto_mode,
|
||||
size: 20,
|
||||
color: !isFloodMode
|
||||
? scheme.primary
|
||||
: null,
|
||||
color: !isFloodMode ? scheme.primary : null,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
@@ -387,9 +385,7 @@ class _RoomLoginDialogState extends State<RoomLoginDialog> {
|
||||
Icon(
|
||||
Icons.waves,
|
||||
size: 20,
|
||||
color: isFloodMode
|
||||
? scheme.primary
|
||||
: null,
|
||||
color: isFloodMode ? scheme.primary : null,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
|
||||
@@ -15,10 +15,7 @@ class UnreadDivider extends StatelessWidget {
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 1,
|
||||
color: color.withValues(alpha: 0.25),
|
||||
),
|
||||
child: Container(height: 1, color: color.withValues(alpha: 0.25)),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Container(
|
||||
@@ -39,10 +36,7 @@ class UnreadDivider extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 1,
|
||||
color: color.withValues(alpha: 0.25),
|
||||
),
|
||||
child: Container(height: 1, color: color.withValues(alpha: 0.25)),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user