mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-04-20 22:13:48 +00:00
formatting fixes
This commit is contained in:
parent
c284e571b0
commit
4975b5366e
5 changed files with 84 additions and 49 deletions
|
|
@ -694,7 +694,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||
try {
|
||||
await FlutterBluePlus.stopScan();
|
||||
} catch (_) {}
|
||||
|
||||
|
||||
try {
|
||||
await _scanSubscription?.cancel();
|
||||
} catch (_) {}
|
||||
|
|
@ -743,7 +743,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||
await FlutterBluePlus.startScan(
|
||||
withServices: [Guid(MeshCoreUuids.service)],
|
||||
);
|
||||
// On web, the chooser returns once a device is picked, but the scanResults
|
||||
// On web, the chooser returns once a device is picked, but the scanResults
|
||||
// stream might take a moment to emit the last result. Wait briefly so the
|
||||
// device appears in the UI before stopScan() clears the list.
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
|
|
@ -760,7 +760,7 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||
debugPrint("Scan error: $e");
|
||||
// On web, suppress common cancellation and chooser errors
|
||||
if (kIsWeb) return;
|
||||
|
||||
|
||||
if (!PlatformInfo.isWeb) {
|
||||
rethrow;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -367,17 +367,24 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
(message.status == ChannelMessageStatus.sent && displayPath.isNotEmpty)
|
||||
(message.status ==
|
||||
ChannelMessageStatus.sent &&
|
||||
displayPath.isNotEmpty)
|
||||
? Icons.check_circle
|
||||
: message.status == ChannelMessageStatus.failed
|
||||
? Icons.cancel
|
||||
: Icons.cloud,
|
||||
: message.status ==
|
||||
ChannelMessageStatus.failed
|
||||
? Icons.cancel
|
||||
: Icons.cloud,
|
||||
size: 14,
|
||||
color: (message.status == ChannelMessageStatus.sent && displayPath.isNotEmpty)
|
||||
color:
|
||||
(message.status ==
|
||||
ChannelMessageStatus.sent &&
|
||||
displayPath.isNotEmpty)
|
||||
? Colors.green
|
||||
: message.status == ChannelMessageStatus.failed
|
||||
? Colors.red
|
||||
: Colors.white70,
|
||||
: message.status ==
|
||||
ChannelMessageStatus.failed
|
||||
? Colors.red
|
||||
: Colors.white70,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -402,8 +409,10 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||
defaultToHttps: false,
|
||||
),
|
||||
linkifiers: const [UrlLinkifier()],
|
||||
onOpen: (link) =>
|
||||
LinkHandler.handleLinkTap(context, link.url),
|
||||
onOpen: (link) => LinkHandler.handleLinkTap(
|
||||
context,
|
||||
link.url,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (!enableTracing && isOutgoing) ...[
|
||||
|
|
@ -411,17 +420,24 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 2),
|
||||
child: Icon(
|
||||
(message.status == ChannelMessageStatus.sent && displayPath.isNotEmpty)
|
||||
(message.status ==
|
||||
ChannelMessageStatus.sent &&
|
||||
displayPath.isNotEmpty)
|
||||
? Icons.check_circle
|
||||
: message.status == ChannelMessageStatus.failed
|
||||
? Icons.cancel
|
||||
: Icons.cloud,
|
||||
: message.status ==
|
||||
ChannelMessageStatus.failed
|
||||
? Icons.cancel
|
||||
: Icons.cloud,
|
||||
size: 14,
|
||||
color: (message.status == ChannelMessageStatus.sent && displayPath.isNotEmpty)
|
||||
color:
|
||||
(message.status ==
|
||||
ChannelMessageStatus.sent &&
|
||||
displayPath.isNotEmpty)
|
||||
? Colors.green
|
||||
: message.status == ChannelMessageStatus.failed
|
||||
? Colors.red
|
||||
: Colors.grey,
|
||||
: message.status ==
|
||||
ChannelMessageStatus.failed
|
||||
? Colors.red
|
||||
: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
@ -915,7 +931,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||
onKeyEvent: (node, event) {
|
||||
if (event is KeyDownEvent &&
|
||||
(event.logicalKey == LogicalKeyboardKey.enter ||
|
||||
event.logicalKey == LogicalKeyboardKey.numpadEnter)) {
|
||||
event.logicalKey ==
|
||||
LogicalKeyboardKey.numpadEnter)) {
|
||||
_sendMessage();
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
|
|
@ -932,9 +949,10 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||
backgroundColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.surfaceContainerHighest,
|
||||
fallbackTextColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.6),
|
||||
fallbackTextColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
.withValues(alpha: 0.6),
|
||||
maxSize: 160,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -346,7 +346,8 @@ class _ChatScreenState extends State<ChatScreen> {
|
|||
onKeyEvent: (node, event) {
|
||||
if (event is KeyDownEvent &&
|
||||
(event.logicalKey == LogicalKeyboardKey.enter ||
|
||||
event.logicalKey == LogicalKeyboardKey.numpadEnter)) {
|
||||
event.logicalKey ==
|
||||
LogicalKeyboardKey.numpadEnter)) {
|
||||
_sendMessage(connector);
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
|
|
@ -1290,21 +1291,30 @@ class _MessageBubble extends StatelessWidget {
|
|||
child: Container(
|
||||
padding: const EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black.withValues(alpha: 0.3),
|
||||
color: Colors.black.withValues(
|
||||
alpha: 0.3,
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
(message.status == MessageStatus.delivered && message.pathBytes.isNotEmpty)
|
||||
(message.status ==
|
||||
MessageStatus.delivered &&
|
||||
message.pathBytes.isNotEmpty)
|
||||
? Icons.check_circle
|
||||
: message.status == MessageStatus.failed
|
||||
? Icons.cancel
|
||||
: Icons.cloud,
|
||||
: message.status ==
|
||||
MessageStatus.failed
|
||||
? Icons.cancel
|
||||
: Icons.cloud,
|
||||
size: 14,
|
||||
color: (message.status == MessageStatus.delivered && message.pathBytes.isNotEmpty)
|
||||
color:
|
||||
(message.status ==
|
||||
MessageStatus.delivered &&
|
||||
message.pathBytes.isNotEmpty)
|
||||
? Colors.green
|
||||
: message.status == MessageStatus.failed
|
||||
? Colors.red
|
||||
: Colors.white70,
|
||||
: message.status ==
|
||||
MessageStatus.failed
|
||||
? Colors.red
|
||||
: Colors.white70,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -1328,8 +1338,10 @@ class _MessageBubble extends StatelessWidget {
|
|||
defaultToHttps: false,
|
||||
),
|
||||
linkifiers: const [UrlLinkifier()],
|
||||
onOpen: (link) =>
|
||||
LinkHandler.handleLinkTap(context, link.url),
|
||||
onOpen: (link) => LinkHandler.handleLinkTap(
|
||||
context,
|
||||
link.url,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (!enableTracing && isOutgoing) ...[
|
||||
|
|
@ -1337,17 +1349,22 @@ class _MessageBubble extends StatelessWidget {
|
|||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 2),
|
||||
child: Icon(
|
||||
(message.status == MessageStatus.delivered && message.pathBytes.isNotEmpty)
|
||||
(message.status ==
|
||||
MessageStatus.delivered &&
|
||||
message.pathBytes.isNotEmpty)
|
||||
? Icons.check_circle
|
||||
: message.status == MessageStatus.failed
|
||||
? Icons.cancel
|
||||
: Icons.cloud,
|
||||
? Icons.cancel
|
||||
: Icons.cloud,
|
||||
size: 14,
|
||||
color: (message.status == MessageStatus.delivered && message.pathBytes.isNotEmpty)
|
||||
color:
|
||||
(message.status ==
|
||||
MessageStatus.delivered &&
|
||||
message.pathBytes.isNotEmpty)
|
||||
? Colors.green
|
||||
: message.status == MessageStatus.failed
|
||||
? Colors.red
|
||||
: Colors.grey,
|
||||
? Colors.red
|
||||
: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -64,9 +64,7 @@ class ChromeRequiredScreen extends StatelessWidget {
|
|||
decoration: BoxDecoration(
|
||||
color: Colors.blue.withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
border: Border.all(
|
||||
color: Colors.blue.withValues(alpha: 0.3),
|
||||
),
|
||||
border: Border.all(color: Colors.blue.withValues(alpha: 0.3)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
|
|||
|
|
@ -112,9 +112,11 @@ class _ScannerScreenState extends State<ScannerScreen> {
|
|||
if (isScanning) {
|
||||
connector.stopScan();
|
||||
} else {
|
||||
unawaited(connector.startScan().catchError((e) {
|
||||
debugPrint("Scanner screen startScan error: $e");
|
||||
}));
|
||||
unawaited(
|
||||
connector.startScan().catchError((e) {
|
||||
debugPrint("Scanner screen startScan error: $e");
|
||||
}),
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: isScanning
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue