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",
),
);