24 lines
640 B
Dart
24 lines
640 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:motion_toast/motion_toast.dart';
|
|
import 'package:motion_toast/resources/arrays.dart';
|
|
|
|
// Create a mixin for toast animations
|
|
mixin ToastMixin on StatefulWidget {
|
|
void showToast(BuildContext context, String message) {
|
|
MotionToast.error(
|
|
title: const Text(
|
|
"ERRO",
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
description: Text(message),
|
|
position: MotionToastPosition.top,
|
|
barrierColor: Colors.black.withOpacity(0.3),
|
|
width: 300,
|
|
height: 80,
|
|
dismissable: false,
|
|
).show(context);
|
|
}
|
|
}
|