showToast method

void showToast(
  1. String text, {
  2. ToastTheme? theme,
})

Implementation

void showToast(String text, {ToastTheme? theme}) {
  final currentTheme = theme ?? _toastTheme;
  final widget = Container(
    margin: const EdgeInsets.only(bottom: 50),
    padding: currentTheme.padding,
    decoration: BoxDecoration(
      color: currentTheme.backgroundColor,
      borderRadius: BorderRadius.circular(currentTheme.radius),
    ),
    child: ClipRect(child: DefaultTextStyle(style: currentTheme.style, child: Text(text))),
  );
  showToastWidget(child: widget, theme: currentTheme);
}