2025-10-06 10:57:46 +03:30
|
|
|
import 'package:flutter/services.dart';
|
2025-06-30 16:18:12 +03:30
|
|
|
import 'package:rasadyar_core/core.dart';
|
2025-06-30 10:36:30 +03:30
|
|
|
|
|
|
|
|
class BuyLogic extends GetxController {
|
2025-07-14 09:27:13 +03:30
|
|
|
List<String> routesName = ['خرید'];
|
2025-10-06 10:57:46 +03:30
|
|
|
DateTime? _lastBackPressed;
|
2025-06-30 16:18:12 +03:30
|
|
|
|
|
|
|
|
|
2025-06-30 10:36:30 +03:30
|
|
|
@override
|
|
|
|
|
void onReady() {
|
2025-10-06 10:57:46 +03:30
|
|
|
fLog('BuyLogic onReady');
|
2025-06-30 10:36:30 +03:30
|
|
|
super.onReady();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void onClose() {
|
|
|
|
|
// TODO: implement onClose
|
|
|
|
|
super.onClose();
|
|
|
|
|
}
|
2025-10-06 10:57:46 +03:30
|
|
|
|
|
|
|
|
void onPopScopTaped() async {
|
|
|
|
|
final now = DateTime.now();
|
|
|
|
|
if (_lastBackPressed == null || now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
|
|
|
|
_lastBackPressed = now;
|
|
|
|
|
Get.snackbar(
|
|
|
|
|
'خروج از برنامه',
|
|
|
|
|
'برای خروج دوباره بازگشت را بزنید',
|
|
|
|
|
snackPosition: SnackPosition.TOP,
|
|
|
|
|
duration: Duration(seconds: 2),
|
|
|
|
|
backgroundColor: AppColor.warning,
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
await SystemNavigator.pop();
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-06-30 10:36:30 +03:30
|
|
|
}
|