Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MertSaygili opened this issue Sep 12, 2024 · 0 comments
Open

Comments

@MertSaygili
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant