import 'package:flutter/material.dart'; void showSimpleSnackbar(ScaffoldMessengerState scaffMgr, {required String text, required String action, Function? onTap}) { final snackBar = SnackBar( behavior: SnackBarBehavior.floating, content: Text(text), action: SnackBarAction( label: action, onPressed: () { scaffMgr.hideCurrentSnackBar(); if (onTap != null) { onTap(); } }, ), ); scaffMgr.hideCurrentSnackBar(); scaffMgr.showSnackBar(snackBar); }