showSnackBar method

dynamic showSnackBar({
  1. required BuildContext context,
  2. required String msg,
})

Implementation

showSnackBar({required BuildContext context,required String msg}){
  ScaffoldMessenger.of(context).hideCurrentSnackBar();
  ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(
          content: Text(msg),
      )
  );
}