ponnamkarthik/FlutterToast

Toast.LENGTH_LONG not working for 5 seconds, works for 2 second only

Opened this issue · 0 comments

class ToastService {
  /// Displays a toast notification with the given [text].
  ///
  /// The [backgroundColor] parameter is optional and determines the background color of the toast.
  /// If [backgroundColor] is not provided, the default color will be used.
  ///
  /// This method uses the Fluttertoast package to show the toast at the bottom of the screen
  /// with a long duration.
  static Future<void> showToast({
    required String text,
    ToastType? backgroundColor,
    ToastGravity? gravity = ToastGravity.BOTTOM,
    Toast? toastLength = Toast.LENGTH_LONG,
  }) async {
    await Fluttertoast.showToast(
      msg: text,
      toastLength: toastLength,
      gravity: gravity,
      backgroundColor: backgroundColor?.color,
    );
  }
}

I'am giving Toast.LENGTH_LONG but toast messages stays for only 2 seconds.