33 lines
1.0 KiB
Dart
33 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:rasadyar_chicken/features/common/presentation/routes/routes.dart';
|
|
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
|
import 'package:rasadyar_core/core.dart';
|
|
|
|
const int timeDebounce = 1200;
|
|
|
|
void handleGeneric(DioException error, [void Function()? onError]) {
|
|
Get.showSnackbar(
|
|
_errorSnackBar('اعتبار توکن شما منقضی شده است لطفا دوباره وارد شوید'),
|
|
);
|
|
|
|
Get.offAllNamed(CommonRoutes.auth, arguments: Module.chicken);
|
|
}
|
|
|
|
GetSnackBar _errorSnackBar(String message) {
|
|
return GetSnackBar(
|
|
titleText: Text(
|
|
'خطا',
|
|
style: AppFonts.yekan14.copyWith(color: Colors.white),
|
|
),
|
|
messageText: Text(
|
|
message,
|
|
style: AppFonts.yekan12.copyWith(color: Colors.white),
|
|
),
|
|
backgroundColor: AppColor.error,
|
|
margin: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
|
borderRadius: 12,
|
|
duration: Duration(milliseconds: 3500),
|
|
snackPosition: SnackPosition.TOP,
|
|
);
|
|
}
|