updateByInfo static method

Future<Null> updateByInfo({
  1. required UpdateEntity updateEntity,
  2. bool supportBackgroundUpdate = false,
  3. bool isAutoMode = false,
  4. String themeColor = '',
  5. String topImageRes = '',
  6. String buttonTextColor = '',
  7. double? widthRatio,
  8. double? heightRatio,
  9. bool overrideGlobalRetryStrategy = false,
  10. bool enableRetry = false,
  11. String retryContent = '',
  12. String retryUrl = '',
})

检查版本更新(Android Only)

Implementation

static Future<Null> updateByInfo(
    {required UpdateEntity updateEntity,

    ///是否支持后台更新
    bool supportBackgroundUpdate = false,

    ///是否开启自动模式
    bool isAutoMode = false,

    ///应用弹窗的主题色
    String themeColor = '',

    ///应用弹窗的顶部图片资源名
    String topImageRes = '',

    ///按钮文字的颜色
    String buttonTextColor = '',

    ///版本更新提示器宽度占屏幕的比例, 不设置的话不做约束
    double? widthRatio,

    ///版本更新提示器高度占屏幕的比例, 不设置的话不做约束
    double? heightRatio,

    ///是否覆盖全局的重试策略
    bool overrideGlobalRetryStrategy = false,

    ///在下载过程中,如果点击了取消的话,是否弹出切换下载方式的重试提示弹窗
    bool enableRetry = false,

    ///重试提示弹窗的提示内容
    String retryContent = '',

    ///重试提示弹窗点击后跳转的url
    String retryUrl = ''}) async {
  assert(Platform.isAndroid);

  final Map<String, Object?> map = {
    'updateEntity': updateEntity.toMap(),
    'supportBackgroundUpdate': supportBackgroundUpdate,
    'isAutoMode': isAutoMode,
    'themeColor': themeColor,
    'topImageRes': topImageRes,
    'buttonTextColor': buttonTextColor,
    'widthRatio': widthRatio,
    'heightRatio': heightRatio,
    'overrideGlobalRetryStrategy': overrideGlobalRetryStrategy,
    'enableRetry': enableRetry,
    'retryContent': retryContent,
    'retryUrl': retryUrl,
  };
  await _channel.invokeMethod('updateByInfo', map);
}