Update dependencies and improve code consistency across multiple files

This commit is contained in:
zjs81
2026-02-14 02:22:45 -07:00
parent f87d4896ab
commit 72f0aa7208
12 changed files with 98 additions and 103 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ class AppDebugLogScreen extends StatelessWidget {
child: hasEntries
? ListView.separated(
itemCount: entries.length,
separatorBuilder: (_, __) => const Divider(height: 1),
separatorBuilder: (_, _) => const Divider(height: 1),
itemBuilder: (context, index) {
final entry = entries[index];
return ListTile(
+1 -1
View File
@@ -100,7 +100,7 @@ class _BleDebugLogScreenState extends State<BleDebugLogScreen> {
itemCount: showingFrames
? entries.length
: rawEntries.length,
separatorBuilder: (_, __) => const Divider(height: 1),
separatorBuilder: (_, _) => const Divider(height: 1),
itemBuilder: (context, index) {
if (showingFrames) {
final entry = entries[index];
+1 -1
View File
@@ -594,7 +594,7 @@ class _ChannelMessagePathMapScreenState
: ListView.separated(
padding: const EdgeInsets.symmetric(vertical: 4),
itemCount: hops.length,
separatorBuilder: (_, __) => const Divider(height: 1),
separatorBuilder: (_, _) => const Divider(height: 1),
itemBuilder: (context, index) {
final hop = hops[index];
return ListTile(
+1 -1
View File
@@ -530,7 +530,7 @@ class _PathTraceMapScreenState extends State<PathTraceMapScreen> {
child: ListView.separated(
padding: const EdgeInsets.symmetric(vertical: 4),
itemCount: pathTraceData.pathData.length + 1,
separatorBuilder: (_, __) => const Divider(height: 1),
separatorBuilder: (_, _) => const Divider(height: 1),
itemBuilder: (context, index) {
return Column(
children: [
+2 -2
View File
@@ -742,7 +742,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
);
}
_gpxExport(
Future<void> _gpxExport(
GpxExport exporter,
String name,
String description,
@@ -782,7 +782,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
}
}
_buildExportCard(MeshCoreConnector connector) {
Widget _buildExportCard(MeshCoreConnector connector) {
final l10n = context.l10n;
return Card(
child: Column(
+5 -11
View File
@@ -1,4 +1,3 @@
import 'dart:isolate';
import 'dart:io';
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
@@ -15,18 +14,13 @@ class BackgroundService {
channelDescription: 'Keeps MeshCore running in the background.',
channelImportance: NotificationChannelImportance.LOW,
priority: NotificationPriority.LOW,
iconData: const NotificationIconData(
resType: ResourceType.mipmap,
resPrefix: ResourcePrefix.ic,
name: 'launcher',
),
),
iosNotificationOptions: const IOSNotificationOptions(
showNotification: false,
playSound: false,
),
foregroundTaskOptions: const ForegroundTaskOptions(
interval: 5000,
foregroundTaskOptions: ForegroundTaskOptions(
eventAction: ForegroundTaskEventAction.repeat(5000),
autoRunOnBoot: false,
allowWifiLock: false,
),
@@ -63,13 +57,13 @@ void startCallback() {
class _MeshCoreTaskHandler extends TaskHandler {
@override
void onStart(DateTime timestamp, SendPort? sendPort) {}
Future<void> onStart(DateTime timestamp, TaskStarter starter) async {}
@override
void onRepeatEvent(DateTime timestamp, SendPort? sendPort) {}
void onRepeatEvent(DateTime timestamp) {}
@override
void onDestroy(DateTime timestamp, SendPort? sendPort) {}
Future<void> onDestroy(DateTime timestamp, bool isTimeout) async {}
@override
void onNotificationButtonPressed(String id) {}
+18 -18
View File
@@ -67,7 +67,7 @@ class NotificationService {
try {
await _notifications.initialize(
initSettings,
settings: initSettings,
onDidReceiveNotificationResponse: _onNotificationTapped,
);
_isInitialized = true;
@@ -149,10 +149,10 @@ class NotificationService {
);
await _notifications.show(
contactId?.hashCode ?? 0,
contactName,
message,
notificationDetails,
id: contactId?.hashCode ?? 0,
title: contactName,
body: message,
notificationDetails: notificationDetails,
payload: 'message:$contactId',
);
}
@@ -194,10 +194,10 @@ class NotificationService {
);
await _notifications.show(
contactId?.hashCode ?? DateTime.now().millisecondsSinceEpoch,
_l10n.notification_newTypeDiscovered(contactType),
contactName,
notificationDetails,
id: contactId?.hashCode ?? DateTime.now().millisecondsSinceEpoch,
title: _l10n.notification_newTypeDiscovered(contactType),
body: contactName,
notificationDetails: notificationDetails,
payload: 'advert:$contactId',
);
}
@@ -248,10 +248,10 @@ class NotificationService {
: preview;
await _notifications.show(
channelIndex?.hashCode ?? DateTime.now().millisecondsSinceEpoch,
channelName,
body,
notificationDetails,
id: channelIndex?.hashCode ?? DateTime.now().millisecondsSinceEpoch,
title: channelName,
body: body,
notificationDetails: notificationDetails,
payload: 'channel:$channelIndex',
);
}
@@ -285,7 +285,7 @@ class NotificationService {
}
Future<void> cancel(int id) async {
await _notifications.cancel(id);
await _notifications.cancel(id: id);
}
//
@@ -469,10 +469,10 @@ class NotificationService {
const notificationDetails = NotificationDetails(android: androidDetails);
await _notifications.show(
'batch_summary'.hashCode,
_l10n.notification_activityTitle,
parts.join(', '),
notificationDetails,
id: 'batch_summary'.hashCode,
title: _l10n.notification_activityTitle,
body: parts.join(', '),
notificationDetails: notificationDetails,
payload: 'batch',
);
}
+1 -1
View File
@@ -156,7 +156,7 @@ class _QrScannerWidgetState extends State<QrScannerWidget>
MobileScanner(
controller: _controller,
onDetect: _handleDetection,
errorBuilder: (context, error, child) {
errorBuilder: (context, error) {
return _buildErrorWidget(context, error);
},
),