一个轻量级、空安全的 Flutter 包,用于显示可自定义的进度对话框。它支持动态内容更新,并提供多种样式选项,确保在各个平台上的 UI 一致性。非常适合在异步操作期间显示加载状态,保证类型安全并在 Android、iOS、Web、macOS、Windows 和 Linux 上提供流畅的用户体验。该包易于集成和维护,适用于需要在数据处理过程中提供响应式反馈的应用。
适合场景
在 API 调用期间显示加载状态
动态更新对话框文本
显示文件上传过程中的进度
在后台任务期间提供反馈
自定义外观以保持品牌一致性
主要特点
空值安全设计
动态内容更新
多平台支持
可自定义的样式
轻量且快速
与 Flutter 的轻松集成
适合对象
开发跨平台 Flutter 应用的开发者
注重类型安全的团队
需要响应式加载指示器的应用程序
依赖项最少的项目
频繁执行异步操作的UI密集型应用
使用建议
需要 Flutter 2.5 或更高版本
仅限基本进度可视化
无内置取消处理
最适合简单的加载场景
可能需要额外的逻辑来处理复杂的工作流
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
progress_dialog
A light weight package to show progress dialog. As it is a stateful widget, you can change the text shown on the dialog dynamically.
This is the original package and it's owner
https://github.com/fayaz07/progress_dialog
It was discontinued by him, but i really liked the package so I am trynna revive it :D
I added null safety and updated most of the stuff making it null safe and useable again :)
Create and initialise a ProgressDialog object inside the build() method passing context to it
Initialize the ProgressDialog object
finalProgressDialog pr = ProgressDialog(context);
By default it is a normal dialog to show some message, if you would like to use it to show percentage of progress done, specify the optional type parameter and specify if you want your dialog to dismiss when back button is pressed isDismissible parameter (Optional)