appUpgrade static method

dynamic appUpgrade(
  1. BuildContext context,
  2. Future<AppUpgradeInfo?> future, {
  3. TextStyle? titleStyle,
  4. TextStyle? contentStyle,
  5. String? cancelText,
  6. TextStyle? cancelTextStyle,
  7. String? okText,
  8. TextStyle? okTextStyle,
  9. List<Color>? okBackgroundColors,
  10. Color? progressBarColor,
  11. double borderRadius = 20.0,
  12. String? iosAppId,
  13. AppMarketInfo? appMarketInfo,
  14. VoidCallback? onCancel,
  15. VoidCallback? onOk,
  16. DownloadProgressCallback? downloadProgress,
  17. DownloadStatusChangeCallback? downloadStatusChange,
  18. bool isDark = false,
})

Implementation

static appUpgrade(
  BuildContext context,
  Future<AppUpgradeInfo?> future, {
  TextStyle? titleStyle,
  TextStyle? contentStyle,
  String? cancelText,
  TextStyle? cancelTextStyle,
  String? okText,
  TextStyle? okTextStyle,
  List<Color>? okBackgroundColors,
  Color? progressBarColor,
  double borderRadius = 20.0,
  String? iosAppId,
  AppMarketInfo? appMarketInfo,
  VoidCallback? onCancel,
  VoidCallback? onOk,
  DownloadProgressCallback? downloadProgress,
  DownloadStatusChangeCallback? downloadStatusChange,
  bool isDark = false,
}) {
  future.then((AppUpgradeInfo? appUpgradeInfo) {
    if (appUpgradeInfo != null) {
      _showUpgradeDialog(
        context,
        appUpgradeInfo.title,
        appUpgradeInfo.contents,
        apkDownloadUrl: appUpgradeInfo.apkDownloadUrl,
        force: appUpgradeInfo.force,
        titleStyle: titleStyle,
        contentStyle: contentStyle,
        cancelText: cancelText,
        cancelTextStyle: cancelTextStyle,
        okBackgroundColors: okBackgroundColors,
        okText: okText,
        okTextStyle: okTextStyle,
        borderRadius: borderRadius,
        progressBarColor: progressBarColor,
        iosAppId: iosAppId,
        appMarketInfo: appMarketInfo,
        onCancel: onCancel,
        onOk: onOk,
        downloadProgress: downloadProgress,
        downloadStatusChange: downloadStatusChange,
        isDark: isDark,
      );
    }
  }).catchError((onError) {
    debugPrint("显示出错:$onError");
    // print('$onError');
  });
}