feduke-nukem / flutter_easy_dialogs

Easy dialogs library for Flutter
https://pub.dev/packages/flutter_easy_dialogs
MIT License
12 stars 0 forks source link

[Feature]: Persistent snackbar #19

Closed Apollo108 closed 1 year ago

Apollo108 commented 1 year ago

What is your idea?

I didn't see an option like: 'autoHide'. How to make a snackbar to stay until I hide it manually besides setting autoHideDuration: const Duration(days: 999)?

Code of Conduct

feduke-nukem commented 1 year ago

What is your idea?

I didn't see an option like: 'autoHide'. How to make a snackbar to stay until I hide it manually?

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

Hello @Apollo108.

Thanks for a issue.

There is a property named autoHideDuration and if you pass null, it won't do the auto hide thing, so later you could hide the dialog manually:

Container(
  color: Colors.blueAccent,
  width: double.infinity,
  height: 200.0,
  child: const Text('Hello World'),
).positioned(autoHideDuration: null).show();

or

FlutterEasyDialogs.show(
  EasyDialog.positioned(
    autoHideDuration: null,
    content: Container(
      color: Colors.blueAccent,
      width: double.infinity,
      height: 200.0,
      child: const Text('Hello World'),
    ),
  ),
);
Apollo108 commented 1 year ago

Thanks for quick response, it works, despite being not so obvious)

feduke-nukem commented 1 year ago

Thanks for quick response, it works, despite being not so obvious)

Will update documentation for that case later 😄