light static method
void
light({})
A floating toast with a semi-transparent (light) background.
textThe message to display.colorBorder and tinted background color.textColorColor of the message text.widthWidth of the snackbar. Defaults to 300.durationHow long the toast is visible. Defaults to 1200 ms.
Implementation
static void light({
required BuildContext context,
required String text,
required Color color,
required Color textColor,
double width = 300,
Duration duration = const Duration(milliseconds: 1200),
}) {
_show(
context,
SnackBar(
clipBehavior: Clip.antiAliasWithSaveLayer,
elevation: 0,
shape: OutlineInputBorder(borderSide: BorderSide(color: color)),
width: width,
behavior: SnackBarBehavior.floating,
duration: duration,
backgroundColor: color.withAlpha(36),
content: Text(text, style: TextStyle(color: textColor)),
),
);
}