42 lines
1.0 KiB
Dart
42 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class AppToast extends StatelessWidget {
|
|
const AppToast({
|
|
super.key,
|
|
required this.text,
|
|
this.bottomPadding,
|
|
this.color,
|
|
this.textStyle,
|
|
});
|
|
|
|
final String text;
|
|
final double? bottomPadding;
|
|
final Color? color;
|
|
final TextStyle? textStyle;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Padding(
|
|
padding: EdgeInsets.only(bottom: bottomPadding ?? 100),
|
|
child: Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(12),
|
|
color: color ?? Theme.of(context).scaffoldBackgroundColor,
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.grey.withOpacity(0.4),
|
|
offset: const Offset(2, 2),
|
|
blurRadius: 5,
|
|
spreadRadius: 1
|
|
)
|
|
]
|
|
),
|
|
child: Text(
|
|
text,
|
|
style: textStyle ?? Theme.of(context).textTheme.bodyMedium,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |