showAppUpdate static method
dynamic
showAppUpdate(})
Implementation
static showAppUpdate(bool forcedUpgrade,
{String url = '', String text = '', String apkVersionName = ''}) {
Get.defaultDialog(
radius: 5,
title: '版本更新提示',
titleStyle: MyTextStyle.s12w400(color: AppColor.mainText),
content: Scrollbar(
controller: ScrollController(),
child: TextField(
minLines: 1,
maxLines: 10,
controller: TextEditingController(text: text),
readOnly: true,
decoration: const InputDecoration(
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(horizontal: 20.0),
),
style: MyTextStyle.s12w400(color: AppColor.mainText)),
),
barrierDismissible: false,
titlePadding: EdgeInsets.only(top: 20.w),
contentPadding: EdgeInsets.symmetric(vertical: 20.w),
confirm: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.w),
child: FButton(
width: 79.w,
height: 30.w,
text: '更新',
alignment: Alignment.center,
color: AppColor.orangeBtnGray,
highlightColor: AppColor.orangeBtnGray,
disabledColor: AppColor.orangeBtnGray,
style: MyTextStyle.s12w400(color: AppColor.whiteColor),
onPressed: () {
_simpleUse(url: url, text: text, apkVersionName: apkVersionName);
if (!forcedUpgrade) {
Get.back();
}
},
),
),
cancel: forcedUpgrade
? const SizedBox.shrink()
: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.w),
child: FButton(
width: 79.w,
height: 30.w,
text: '暂不更新',
alignment: Alignment.center,
color: AppColor.grayTableGray,
highlightColor: AppColor.grayTableGray,
disabledColor: AppColor.grayTableGray,
style: MyTextStyle.s12w400(color: AppColor.mainText),
onPressed: () {
Get.back();
},
),
));
}