showError method

void showError(
  1. String message,
  2. Color textColor
)

Implementation

void showError(String message,Color textColor) {
 if (buildContext != null) {

   ScaffoldMessenger.of(buildContext!).showSnackBar(
     SnackBar(
       content: Text(
         message,
         style: TextStyle(
           color:textColor,
           fontSize: 16,
           fontWeight: FontWeight.w600
         ),
       ),
       backgroundColor: Colors.white,
       shape: RoundedRectangleBorder(
         borderRadius: BorderRadius.circular(12)
       ),
       behavior: SnackBarBehavior.floating,
       margin: EdgeInsets.all(8),
       duration: Duration(seconds: 3),
     )
   );


 }
}