showSnackBar method

void showSnackBar(
  1. String text, {
  2. Duration duration = const Duration(milliseconds: 1500),
  3. VoidCallback? onTap,
})

Implementation

void showSnackBar(
  String text, {
  Duration duration = const Duration(milliseconds: 1500),
  VoidCallback? onTap,
}) {
  ScaffoldMessenger.of(this).showSnackBar(
    SnackBar(
      content: Text(
        text,
      ),
      duration: duration,
    ),
  );
}