更新返回按钮样式统一样式

This commit is contained in:
wyf
2025-11-17 11:09:40 +08:00
parent fa11e2c937
commit 2cb2d7643f
3 changed files with 50 additions and 57 deletions

View File

@@ -20,11 +20,11 @@ LanguageController languageController = Get.find();
MHLanguageController mhLanguageController = Get.find();
class MyUtils {
static String formatTimestampToSleep(int milliseconds) {
final date = DateTime.fromMillisecondsSinceEpoch(milliseconds);
return "${date.year}-${date.month}-${date.day}";
}
static String formatDate(DateTime dateTime) {
return "${dateTime.year}-${dateTime.month}-${dateTime.day.toString().padLeft(2, '0')}";
}
@@ -382,32 +382,13 @@ var closeIconWhite = GestureDetector(
),
);
var returnIconButtom = IconButton(
// padding: EdgeInsets.zero, // 去除默认 padding
// constraints: BoxConstraints(), // 去除最小尺寸限制
onPressed: () => Get.back(),
icon: Icon(Icons.navigate_before, size: 60.rpx),
var returnIconButtom = returnIconButtomNew(
onBack: () {
// ⚡这里写你需要在返回前执行的逻辑
Get.back();
},
);
// var returnIconButtomNew = ClickableContainer(
// backgroundColor: Colors.transparent,
// highlightColor: Colors.transparent,
// padding: EdgeInsets.fromLTRB(20.rpx, 20.rpx, 20.rpx, 20.rpx),
// onTap: () => Get.back(),
// child: Container(
// // height: 42.rpx,
// // width: 42.rpx,
// child: SvgPicture.asset(
// 'assets/img/icon/return_buttom.svg',
// width: 42.rpx,
// height: 42.rpx,
// ),
// // SvgPicture.asset(
// // 'assets/img/icon/expand.svg',
// // color: Colors.white,
// // )
// ));
Widget returnIconButtomNew({VoidCallback? onBack}) {
return ClickableContainer(
backgroundColor: Colors.transparent,
@@ -425,29 +406,25 @@ Widget returnIconButtomNew({VoidCallback? onBack}) {
);
}
// IconButton(
// padding: EdgeInsets.zero, // 去除默认 padding
// constraints: BoxConstraints(), // 去除最小尺寸限制
// onPressed: () => Get.back(),
// icon: SvgPicture.asset(
// 'assets/img/icon/return_buttom.svg',
// width: 42.rpx,
// height: 42.rpx,
// ),
// );
var returnIconButtomAddCallback = (
VoidCallback? returnCallBack, {
bool enableBack = true,
}) {
return IconButton(
onPressed: () {
return ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: Colors.transparent,
padding: EdgeInsets.fromLTRB(20.rpx, 20.rpx, 20.rpx, 20.rpx),
onTap: () {
returnCallBack?.call();
if (enableBack) {
Get.back();
}
},
icon: Icon(Icons.navigate_before, size: 60.rpx),
child: SvgPicture.asset(
'assets/img/icon/return_buttom.svg',
width: 42.rpx,
height: 42.rpx,
),
);
};
@@ -533,7 +510,7 @@ class LoadingDialog {
SizedBox(
height: 30.rpx,
),
CircularProgressIndicator(
CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
themeController.currentColor.sc1,