message static method

void message(
  1. String message, {
  2. int duration = 5,
})

Implementation

static void message(String message, {int duration = 5}) {
  if (!kIsWeb && Platform.isWindows) {
    ScaffoldMessenger.of(context).hideCurrentSnackBar();
    ScaffoldMessenger.of(
      context,
    ).showSnackBar(SnackBar(content: Text(message)));
  } else {
    Fluttertoast.showToast(
      msg: message,
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.CENTER,
      timeInSecForIosWeb: duration,
      backgroundColor: Colors.red,
      textColor: Colors.white,
      fontSize: 16.0,
      webShowClose: true,
    );
  }
}