showSnackbar method

void showSnackbar(
  1. String text
)

Affiche un SnackBar.

Implementation

void showSnackbar(String text) {
  ScaffoldMessenger.of(this)
    ..hideCurrentSnackBar()
    ..showSnackBar(SnackBar(
      duration: const Duration(seconds: 3),
      backgroundColor: Theme.of(this).colorScheme.secondary,
      behavior: SnackBarBehavior.floating,
      elevation: 3,
      margin: const EdgeInsets.only(left: 12, right: 12, bottom: 12),
      content: FitText.body(
        text,
        style: TextStyle(color: Theme.of(this).colorScheme.onSecondary),
      ),
    ));
}