Files
food_delivery_mobile/lib/feature/common/presentation/widgets/w_toastification.dart
jahongireshonqulov 2ed2c430c0 feat:login page done
2025-10-29 12:00:33 +05:00

44 lines
1.2 KiB
Dart

import 'package:toastification/toastification.dart';
import '../../../../food_delivery_client.dart';
showErrorToast(String? message) {
toastification.show(
context: navigatorKey.currentContext,
type: ToastificationType.error,
style: ToastificationStyle.fillColored,
title: Text(message ?? "", maxLines: 5),
autoCloseDuration: TimeDelayConst.duration3,
);
}
showSuccessToast(String message) {
toastification.show(
context: navigatorKey.currentContext,
type: ToastificationType.success,
style: ToastificationStyle.fillColored,
title: Text(message, maxLines: 5),
autoCloseDuration: TimeDelayConst.duration3,
);
}
showWarningToast(String message) {
toastification.show(
context: navigatorKey.currentContext,
type: ToastificationType.warning,
style: ToastificationStyle.fillColored,
title: Text(message, maxLines: 5),
autoCloseDuration: TimeDelayConst.duration3,
);
}
showInfoToast(String message) {
toastification.show(
alignment: Alignment.bottomCenter,
context: navigatorKey.currentContext,
type: ToastificationType.info,
style: ToastificationStyle.fillColored,
title: Text(message, maxLines: 5),
autoCloseDuration: TimeDelayConst.duration3,
);
}