showMessage method

void showMessage(
  1. BuildContext context,
  2. String message, {
  3. int durationInSeconds = 4,
})

Implementation

void showMessage(
  BuildContext context,
  String message, {
  int durationInSeconds = 4,
}) {
  Timer(const Duration(milliseconds: 100), () {
    messenger(context).hideCurrentSnackBar();
    messenger(context).showSnackBar(
      SnackBar(
        duration: Duration(seconds: durationInSeconds),
        content: Text(message),
      ),
    );
  });
}