Top Snackbar Flutter 是一個通知套件,專門設計用於在螢幕頂部傳遞乾淨、使用者友善的回饋訊息。它提供一種簡單且可自訂的方式,讓使用者了解操作、狀態或事件,而不會打擾他們的工作流程。此套件在整合時特別考量易用性,支援 Android、iOS、Web、macOS、Windows 與 Linux 等多個平台。該套件透過提供順暢的動畫與跨裝置一致的樣式來提升使用者體驗。非常適合需要立即、非干擾式回饋的應用程式。
If you need to show the user some information in a nice way, you can use this package. The API is as simple
as API for regular Material method showDialog. If you need to use your own widget to display, you
can pass it into showTopSnackBar function.
Getting Started
In order to show a CustomSnackBar you need to call a showTopSnackBar function. You can pass there any widget you want
but we have a CustomSnackBar for example.
showTopSnackBar(
Overlay.of(context),
CustomSnackBar.success(
message:
"Good job, your release is successful. Have a nice day",
),
);
showTopSnackBar(
Overlay.of(context),
CustomSnackBar.info(
message:
"There is some information. You need to do something with that",
),
);
showTopSnackBar(
Overlay.of(context),
CustomSnackBar.error(
message:
"Something went wrong. Please check your credentials and try again",
),
);