44 lines
1.2 KiB
Dart
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,
|
|
);
|
|
}
|