Обновлен проект. Добавлена БД
This commit is contained in:
37
lib/common/toast.dart
Normal file
37
lib/common/toast.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
// Package imports:
|
||||
import 'package:oktoast/oktoast.dart' show ToastPosition, showToastWidget;
|
||||
import 'package:remever/common/resources.dart';
|
||||
import 'package:remever/common/widgets/info_toast.dart';
|
||||
|
||||
// Project imports:
|
||||
|
||||
///
|
||||
/// Класс для отображения тостов
|
||||
///
|
||||
final class Toast {
|
||||
///
|
||||
/// Показать информационный тост
|
||||
///
|
||||
static void show(Widget child, {Duration? duration}) {
|
||||
showToastWidget(
|
||||
InfoToast(child: child),
|
||||
duration: duration,
|
||||
handleTouch: true,
|
||||
);
|
||||
}
|
||||
|
||||
///
|
||||
/// Показать тост с иконкой для закрытия
|
||||
///
|
||||
static void showDismissible(String message, {Duration? duration}) {
|
||||
showToastWidget(
|
||||
InfoToast.dismissible(message: message, bgColor: AppColors.white),
|
||||
position: ToastPosition.top.copyWith(offset: 50),
|
||||
duration: duration,
|
||||
handleTouch: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user