更新首页数据滚动效果
This commit is contained in:
@@ -1221,3 +1221,137 @@ Future<void> showTipUpgradeDialog(
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> showAPPUpgradeDialog(
|
||||
BuildContext context,
|
||||
Widget widget, {
|
||||
Color? backgroundColor,
|
||||
required VoidCallback onUpgradeTap,
|
||||
String? secondaryButtonText, // 👈 新增:次要按钮文本
|
||||
VoidCallback? onSecondaryTap, // 👈 新增:次要按钮点击回调
|
||||
}) {
|
||||
ThemeController themeController = Get.find();
|
||||
BlueteethBindController blueteethBindController = Get.find();
|
||||
|
||||
return showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
barrierColor: Colors.black.withOpacity(0.5),
|
||||
builder: (BuildContext context) {
|
||||
return WillPopScope(
|
||||
child: FrostedDialog(
|
||||
blurSigma: 3.0,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor ?? Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
padding: EdgeInsetsDirectional.fromSTEB(64.rpx, 0, 64.rpx, 0),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: MediaQuery.sizeOf(context).height * 0.656,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Align(
|
||||
alignment: AlignmentDirectional(0, 0),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 93.rpx, 0, 74.rpx),
|
||||
child: widget,
|
||||
),
|
||||
),
|
||||
|
||||
// 👇 修改按钮布局,支持两个按钮
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0, 19.rpx, 0, 60.rpx),
|
||||
child: Column(
|
||||
children: [
|
||||
// 主要按钮(升级按钮)
|
||||
CustomCard(
|
||||
gradientDirection: GradientDirection.vertical,
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: onUpgradeTap,
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 0.055,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 500.rpx,
|
||||
minHeight: 90.rpx,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'升级'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontFamily: 'Inter',
|
||||
fontSize:
|
||||
AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// 如果有次要按钮,显示次要按钮
|
||||
// if (secondaryButtonText != null && onSecondaryTap != null)
|
||||
// Padding(
|
||||
// padding: EdgeInsets.only(top: 20.rpx),
|
||||
// child: CustomCard(
|
||||
// gradientDirection: GradientDirection.vertical,
|
||||
// borderRadius: AppConstants().button_container_radius,
|
||||
// onTap: onSecondaryTap,
|
||||
// colors: [
|
||||
// Colors.grey[300]!,
|
||||
// Colors.grey[400]!,
|
||||
// ],
|
||||
// child: Container(
|
||||
// width: MediaQuery.sizeOf(context).width,
|
||||
// height: MediaQuery.sizeOf(context).height * 0.055,
|
||||
// constraints: BoxConstraints(
|
||||
// minWidth: 500.rpx,
|
||||
// minHeight: 90.rpx,
|
||||
// ),
|
||||
// child: Row(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// Text(
|
||||
// secondaryButtonText,
|
||||
// style: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: AppConstants().normal_text_fontSize,
|
||||
// letterSpacing: 0.0,
|
||||
// ),
|
||||
// ),
|
||||
// ].divide(SizedBox(width: 17.rpx)),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
onWillPop: () async => false,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user