show static method

void show(
  1. String msg,
  2. BuildContext context, {
  3. Duration? duration = const Duration(seconds: 1),
  4. FlutterToastPosition position = FlutterToastPosition.bottom,
  5. Color backgroundColor = const Color(0xAA000000),
  6. dynamic textStyle = const TextStyle(fontSize: 15, color: Colors.white),
  7. double backgroundRadius = 20,
  8. bool? rootNavigator,
  9. Border? border,
})

a fixed value for toast message position method to show the toast message

Implementation

static void show(
  String msg,
  BuildContext context, {
  Duration? duration = const Duration(seconds: 1),

  /// duration : how long do you want to show the message
  FlutterToastPosition position = FlutterToastPosition.bottom,

  /// position : where do you want to show the toast message, you can pass bottom, center, top or any defined value
  Color backgroundColor = const Color(0xAA000000),

  /// defines the background color of toast message
  textStyle = const TextStyle(fontSize: 15, color: Colors.white),

  /// for toast message styling
  double backgroundRadius = 20,

  /// you can apply toast message background radius
  bool? rootNavigator,
  Border? border,

  /// you can specify background border
}) {
  _FlutterToastView.dismiss();
  _FlutterToastView.createView(msg, context, duration, position,
      backgroundColor, textStyle, backgroundRadius, border, rootNavigator);
}