kirakira/lib/presentation/widgets/drawer/toast_message.dart

47 lines
1.1 KiB
Dart
Raw Normal View History

2024-02-17 20:32:01 +05:30
import "package:flutter/material.dart";
import "package:flash/flash.dart";
class ToastMessage extends StatelessWidget {
final FlashController controller;
final IconData icon;
final String text;
const ToastMessage({
super.key,
required this.controller,
required this.icon,
required this.text,
});
@override
Widget build(BuildContext context) {
return Flash(
position: FlashPosition.bottom,
controller: controller,
child: AlertDialog(
alignment: Alignment.bottomCenter,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
backgroundColor: const Color.fromRGBO(217, 217, 217, 1),
content: Row(
children: [
Icon(
icon,
color: Colors.black,
),
const SizedBox(width: 20),
Text(
text,
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(color: Colors.black),
),
],
),
),
);
}
}