Update: 2026-06-15 01:37:40
This commit is contained in:
@@ -16,6 +16,7 @@ import '../../../../../controller/functions/crud.dart';
|
||||
import '../../../../../controller/home/captin/order_request_controller.dart';
|
||||
import '../../../../../print.dart';
|
||||
import '../../../../Rate/ride_calculate_driver.dart';
|
||||
import 'package:siro_driver/views/home/statistics/statistics_dashboard.dart';
|
||||
|
||||
// ─────────────────────────────────────────────
|
||||
// Design Tokens (Responsive)
|
||||
@@ -105,34 +106,9 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
_MenuIcon(
|
||||
icon: FontAwesome5.chart_bar,
|
||||
color: _T.blue,
|
||||
tooltip: 'Earnings'.tr,
|
||||
tooltip: 'Statistics'.tr,
|
||||
onTap: () {
|
||||
final now = DateTime.now();
|
||||
final lastTimeRaw = box.read(BoxName.lastTimeStaticThrottle);
|
||||
DateTime? lastTime;
|
||||
|
||||
if (lastTimeRaw != null) {
|
||||
try {
|
||||
lastTime = DateTime.parse(lastTimeRaw.toString());
|
||||
} catch (_) {
|
||||
lastTime = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (lastTime == null ||
|
||||
now.difference(lastTime).inMinutes >= 2) {
|
||||
box.write(
|
||||
BoxName.lastTimeStaticThrottle, now.toIso8601String());
|
||||
Get.to(() => RideCalculateDriver());
|
||||
} else {
|
||||
final left = 2 - now.difference(lastTime).inMinutes;
|
||||
NotificationController().showNotification(
|
||||
'Siro Driver'.tr,
|
||||
'${'Please wait'.tr} $left ${"minutes before trying again.".tr}',
|
||||
'ding',
|
||||
'',
|
||||
);
|
||||
}
|
||||
Get.to(() => StatisticsDashboard());
|
||||
},
|
||||
onLongPress: () =>
|
||||
box.write(BoxName.statusDriverLocation, 'off'),
|
||||
|
||||
@@ -53,7 +53,10 @@ class StatisticsDashboard extends StatelessWidget {
|
||||
IconButton(
|
||||
icon: const Icon(Icons.refresh_rounded,
|
||||
color: Colors.white),
|
||||
onPressed: () => gc.fetchGamificationData(),
|
||||
onPressed: () {
|
||||
gc.fetchGamificationData(force: true);
|
||||
sc.reloadData(force: true);
|
||||
},
|
||||
),
|
||||
],
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
|
||||
Reference in New Issue
Block a user