• 赚钱入口【需求资源】限时招募流量主、渠道主,站长合作;【合作模式】CPS长期分成,一次推广永久有收益。主动打款,不扣量;

progress dialog

Flutter cps12345 8个月前 (08-05) 145次浏览 0个评论

弹框进度条

使用插件 progress_dialog 可以快速实现效果:

progress dialog

progress dialog

使用方法非常简单:

添加插件:
dependencies:
  progress_dialog: ^1.2.4
导入头文件:
import 'package:progress_dialog/progress_dialog.dart';
初始化:
final ProgressDialog pr = ProgressDialog(context);
展示或者隐藏
await pr.show();
Future.delayed(Duration(seconds: 2), () {
  pr.hide();
});
自定义样式:
//For normal dialog
pr = ProgressDialog(context,type: ProgressDialogType.Normal, isDismissible: true/false, showLogs: true/false);
    
//For showing progress percentage
pr =  ProgressDialog(context,type: ProgressDialogType.Download, isDismissible: true/false, showLogs: true/false);
自定义UI:
pr.style(
  message: 'Downloading file...',
  borderRadius: 10.0,
  backgroundColor: Colors.white,
  progressWidget: CircularProgressIndicator(),
  elevation: 10.0,
  insetAnimCurve: Curves.easeInOut,
  progress: 0.0,
  textDirection: TextDirection.rtl,
  maxProgress: 100.0,
  progressTextStyle: TextStyle(
     color: Colors.black, fontSize: 13.0, fontWeight: FontWeight.w400),
  messageTextStyle: TextStyle(
     color: Colors.black, fontSize: 19.0, fontWeight: FontWeight.w600)
  );
喜欢 (0)

您必须 登录 才能发表评论!