showUpToast function
dynamic
showUpToast({
- required BuildContext context,
- required String text,
- UpStyle? style,
- UpColorType? upColorType,
- bool isRounded = false,
- double borderRadius = 25.0,
- UpToastType upToastType = UpToastType.primary,
- EdgeInsetsGeometry? padding,
- Icon? icon,
- Duration? duration,
- double width = 300,
- double? height,
Implementation
showUpToast({
required BuildContext context,
required String text,
UpStyle? style,
UpColorType? upColorType,
bool isRounded = false,
double borderRadius = 25.0,
UpToastType upToastType = UpToastType.primary,
EdgeInsetsGeometry? padding,
Icon? icon,
Duration? duration,
double width = 300,
double? height,
}) {
try {
// FlutterToastr.show(text, context);
removeAllQueuedToasts();
fToast.init(context);
fToast.showToast(
child: _upToast(
context,
style,
upColorType,
text,
isRounded,
borderRadius,
upToastType,
icon,
padding,
width,
height,
),
gravity: ToastGravity.BOTTOM,
toastDuration: duration ?? const Duration(seconds: 2),
// positionedToastBuilder: (context, child) {
// return Positioned(
// child: child,
// top: 16.0,
// left: 16.0,
// );
// }
);
} catch (e) {
upConsole(UpConsoleLevel.error, e.toString());
}
}