upgrade static method
dynamic
upgrade(
- BuildContext context,
- Future<
AppUpgradeInfo> future, { - TextStyle? titleStyle,
- TextStyle? versionStyle,
- TextStyle? contentStyle,
- EdgeInsets? contentPadding,
- String? cancelText,
- TextStyle? cancelTextStyle,
- String? okText,
- TextStyle? okTextStyle,
- List<
Color> ? okBackgroundColors, - Color? progressBarColor,
- double borderRadius = 20.0,
- String? iosAppId,
- AppMarketInfo? appMarketInfo,
- DividerThemeData? dividerTheme,
- DownloadProgressCallback? downloadProgress,
- DownloadStatusChangeCallback? downloadStatusChange,
- VoidCallback? onCancel,
- VoidCallback? onOk,
- bool? beta,
Implementation
static upgrade(
BuildContext context,
Future<AppUpgradeInfo> future, {
TextStyle? titleStyle,
TextStyle? versionStyle,
TextStyle? contentStyle,
EdgeInsets? contentPadding,
String? cancelText,
TextStyle? cancelTextStyle,
String? okText,
TextStyle? okTextStyle,
List<Color>? okBackgroundColors,
Color? progressBarColor,
double borderRadius = 20.0,
String? iosAppId,
AppMarketInfo? appMarketInfo,
DividerThemeData? dividerTheme,
DownloadProgressCallback? downloadProgress,
DownloadStatusChangeCallback? downloadStatusChange,
VoidCallback? onCancel,
VoidCallback? onOk,
bool? beta,
}) {
future.then((AppUpgradeInfo appUpgradeInfo) {
if (!context.mounted) {
return;
}
showDialog(
context: context,
barrierDismissible: false,
builder: (context) {
okBackgroundColors ??= [
Theme.of(context).primaryColor,
Theme.of(context).primaryColor
];
return DividerTheme(
data: dividerTheme ?? DividerTheme.of(context),
child: Dialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(borderRadius),
),
),
child: SimpleUpgradeViewWidget(
title: appUpgradeInfo.title,
version: appUpgradeInfo.version,
contents: appUpgradeInfo.contents,
titleStyle: titleStyle,
versionStyle: versionStyle,
contentStyle: contentStyle,
contentPadding: contentPadding,
progressBarColor: progressBarColor,
borderRadius: borderRadius,
downloadUrl: appUpgradeInfo.apkDownloadUrl,
headers: appUpgradeInfo.headers,
force: appUpgradeInfo.force,
iosAppId: iosAppId,
appMarketInfo: appMarketInfo,
downloadProgress: downloadProgress,
downloadStatusChange: downloadStatusChange,
okBackgroundColors: okBackgroundColors,
cancelTextStyle: cancelTextStyle,
okTextStyle: okTextStyle,
cancelText: cancelText,
onCancel: onCancel,
okText: okText,
onOk: onOk,
beta: beta,
),
),
);
},
);
}).catchError((error) {
debugPrint('$error');
});
}