Files
tm_app/lib/core/utils/app_toast.dart
T
2025-09-24 15:33:48 +03:30

40 lines
1.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:toastification/toastification.dart';
class AppToast {
static void success(BuildContext context, String message) {
toastification.show(
context: context,
type: ToastificationType.success,
style: ToastificationStyle.flatColored,
title: Text(message),
autoCloseDuration: const Duration(seconds: 3),
);
}
static void error(BuildContext context, String message) {
toastification.show(
context: context,
type: ToastificationType.error,
style: ToastificationStyle.flatColored,
title: Text(message),
autoCloseDuration: const Duration(seconds: 3),
);
}
static void notification(
BuildContext context,
String title,
String description,
) {
toastification.show(
context: context,
type: ToastificationType.info,
style: ToastificationStyle.flatColored,
title: Text(title),
description: Text(description),
autoCloseDuration: const Duration(seconds: 6),
);
}
}