Update: 2026-06-15 01:37:40

This commit is contained in:
Hamza-Ayed
2026-06-15 01:37:41 +03:00
parent f021ba5a35
commit 2321b78244
164 changed files with 1356 additions and 1560 deletions

View File

@@ -196,9 +196,18 @@ class ChallengesPage extends StatelessWidget {
SizedBox(
width: double.infinity,
child: ElevatedButton.icon(
onPressed: () => cc.claimReward(c),
icon: const Icon(Icons.card_giftcard_rounded, size: 18),
label: Text('Claim Reward'.tr),
onPressed: cc.isClaiming(c.id) ? null : () => cc.claimReward(c),
icon: cc.isClaiming(c.id)
? const SizedBox(
width: 18,
height: 18,
child: CircularProgressIndicator(
color: Colors.white,
strokeWidth: 2,
),
)
: const Icon(Icons.card_giftcard_rounded, size: 18),
label: Text(cc.isClaiming(c.id) ? 'Claiming...'.tr : 'Claim Reward'.tr),
style: ElevatedButton.styleFrom(
backgroundColor: c.color,
foregroundColor: Colors.white,

View File

@@ -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'),

View File

@@ -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(