updated the sheet

This commit is contained in:
2026-08-28 18:16:28 +05:30
parent 69f4f3e909
commit 074cc0eccf
43 changed files with 2617 additions and 1201 deletions

View File

@@ -34,6 +34,7 @@ import 'package:miler/xpress/views/Dashboard/deliveries/deliveries.dart'
as deliveries;
import 'package:miler/xpress/background/live_tracking_service.dart';
import 'package:miler/xpress/data/delivery_api.dart';
import 'package:miler/data/heartbeat.dart';
/// Helper function to launch phone dialer - works in both debug and release builds
/// In release builds, canLaunchUrl may fail due to R8/ProGuard, so we always try to launch
@@ -320,11 +321,13 @@ class _HomepageState extends State<Homepage>
Future<Duration> _getLogInterval() async {
try {
final prefs = await SharedPreferences.getInstance();
final secs = prefs.getInt('logseconds');
final int interval = (secs != null && secs > 0) ? secs : 30;
// Already correct — routed through the shared resolver so the 30 lives in
// one place. See [kDefaultLogSeconds] for what a zero here used to cost
// the rider-log loop, which read the same pref and did not guard it.
final int interval = resolveLogSeconds(prefs.getInt('logseconds'));
return Duration(seconds: interval);
} catch (_) {
return const Duration(seconds: 30);
return const Duration(seconds: kDefaultLogSeconds);
}
}