QuickAlert 是一個 Flutter 套件,讓開發者能快速顯示具有預設類型(如成功、錯誤、警告、確認與載入)的動畫化、可自訂對話方塊。它透過極少的程式碼簡化使用者回饋的呈現過程,支援 Android、iOS、Web、macOS、Windows 與 Linux 等多個平台。此套件提供順暢的動畫效果,並可透過單一方法呼叫輕鬆整合,非常適合需要即時視覺反饋之應用程式以提升使用者體驗。亦支援自訂對話方塊,適用於特殊使用情境。
適用情境
表單提交後顯示成功訊息
顯示無效輸入的錯誤警示
透過是/否提示確認動作
在異步操作期間指示加載狀態
為特定的UI需求創建自定義警報設計
主要特色
預定義的警示類型(成功、錯誤、警告等)
用於視覺吸引力的動畫過渡
對自訂對話方塊內容的支援
簡單的單行呼叫
跨平台相容性
輕量且易於整合
適合對象
初學者 Flutter 開發者
需要快速使用者回饋的應用程式
表單和驗證流程
頻繁彈出提醒的互動式 UI
優先考慮快速實現的專案
使用建議
超出基本樣式之外的自訂有限
可能需要額外的樣式設定以適應複雜版面
不太適合高度動態或持續的對話方塊
最適合暫時通知
依賴外部動畫程式庫以實現效果
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
An instantly ready, full-featured alerts for development on any platform with flutter. Enabling you to complete projects and deploy quickly. With QuickAlert, you can display animated alert dialogs such as success, error, warning, confirm, loading or even a custom dialog.
Key Features 🔮
Easy To Use
The alerts are very flexible and can be customized very easily. In QuickAlert, the QuickAlert.show() triggers the alert, which informs the user about the situations that need acknowledgment.
Predefined Beautiful Alert Styles
Make use of the predefined alerts are very beautiful and can also be customized very easily. In QuickAlert there are 6 different types of alerts, they are Success, Error, Warning, Info, Confirm & Loading.
Predefined Title & Actions
In QuickAlert all the 6 different types of alerts have predefined title & actions matching the alert type.
Super Customizable
Build your custom alert with power of QuickAlert using the flutter widgets.
Change Animation
Set your favorite animation by choosing from scale, rotate, slideInDown, slideInUp, slideInLeft, slideInRight.
Set Auto close
Auto close the alert by setting auto close duration.
Set Overlay Tap to Dismiss
Control the alert's Barrier Dismissible Property by setting barrierDismissible to true or false.
And Many More...
QuickAlert Demo
Getting Started 🔥
Start by adding the library as a dependency to your project.
dependencies:quickalert:<latestversion>
Run the command get the dependency
$ flutter pub get
Import it in your dart code, you can use
import'package:quickalert/quickalert.dart';
To display alert use QuickAlert.show() and define the type of alert.
QuickAlert.show(
context: context,
type: QuickAlertType.success,
); // That's it to display an alert, use other properties to customize.
Examples ⚡
There is a detailed example project in the example folder. You can directly run and play on it. There are code snippets from example project below.