feature: toast mixin
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user