更新返回按钮样式统一样式
This commit is contained in:
@@ -20,11 +20,11 @@ LanguageController languageController = Get.find();
|
|||||||
MHLanguageController mhLanguageController = Get.find();
|
MHLanguageController mhLanguageController = Get.find();
|
||||||
|
|
||||||
class MyUtils {
|
class MyUtils {
|
||||||
|
|
||||||
static String formatTimestampToSleep(int milliseconds) {
|
static String formatTimestampToSleep(int milliseconds) {
|
||||||
final date = DateTime.fromMillisecondsSinceEpoch(milliseconds);
|
final date = DateTime.fromMillisecondsSinceEpoch(milliseconds);
|
||||||
return "${date.year}-${date.month}-${date.day}";
|
return "${date.year}-${date.month}-${date.day}";
|
||||||
}
|
}
|
||||||
|
|
||||||
static String formatDate(DateTime dateTime) {
|
static String formatDate(DateTime dateTime) {
|
||||||
return "${dateTime.year}-${dateTime.month}-${dateTime.day.toString().padLeft(2, '0')}";
|
return "${dateTime.year}-${dateTime.month}-${dateTime.day.toString().padLeft(2, '0')}";
|
||||||
}
|
}
|
||||||
@@ -382,32 +382,13 @@ var closeIconWhite = GestureDetector(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
var returnIconButtom = IconButton(
|
var returnIconButtom = returnIconButtomNew(
|
||||||
// padding: EdgeInsets.zero, // 去除默认 padding
|
onBack: () {
|
||||||
// constraints: BoxConstraints(), // 去除最小尺寸限制
|
// ⚡这里写你需要在返回前执行的逻辑
|
||||||
onPressed: () => Get.back(),
|
Get.back();
|
||||||
icon: Icon(Icons.navigate_before, size: 60.rpx),
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// 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}) {
|
Widget returnIconButtomNew({VoidCallback? onBack}) {
|
||||||
return ClickableContainer(
|
return ClickableContainer(
|
||||||
backgroundColor: Colors.transparent,
|
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 = (
|
var returnIconButtomAddCallback = (
|
||||||
VoidCallback? returnCallBack, {
|
VoidCallback? returnCallBack, {
|
||||||
bool enableBack = true,
|
bool enableBack = true,
|
||||||
}) {
|
}) {
|
||||||
return IconButton(
|
return ClickableContainer(
|
||||||
onPressed: () {
|
backgroundColor: Colors.transparent,
|
||||||
|
highlightColor: Colors.transparent,
|
||||||
|
padding: EdgeInsets.fromLTRB(20.rpx, 20.rpx, 20.rpx, 20.rpx),
|
||||||
|
onTap: () {
|
||||||
returnCallBack?.call();
|
returnCallBack?.call();
|
||||||
if (enableBack) {
|
if (enableBack) {
|
||||||
Get.back();
|
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(
|
SizedBox(
|
||||||
height: 30.rpx,
|
height: 30.rpx,
|
||||||
),
|
),
|
||||||
CircularProgressIndicator(
|
CircularProgressIndicator(
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
themeController.currentColor.sc1,
|
themeController.currentColor.sc1,
|
||||||
|
|||||||
@@ -329,14 +329,23 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
|||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Container(
|
||||||
'${device['person']?['name'] ?? '未命名'.tr}',
|
width:
|
||||||
style: TextStyle(
|
MediaQuery.sizeOf(context)
|
||||||
fontFamily: 'Inter',
|
.width *
|
||||||
fontSize: 26.rpx,
|
0.2,
|
||||||
letterSpacing: 0.0,
|
child: Text(
|
||||||
color: themeController
|
'${device['person']?['name'] ?? '未命名'.tr}',
|
||||||
.currentColor.sc3,
|
style: TextStyle(
|
||||||
|
fontFamily: 'Inter',
|
||||||
|
fontSize: 26.rpx,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
color: themeController
|
||||||
|
.currentColor.sc3,
|
||||||
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Text(
|
// Text(
|
||||||
|
|||||||
@@ -142,14 +142,21 @@ class _MessageReviewPageState extends State<MessageReviewPage> {
|
|||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Container(
|
||||||
'${widget.data['person']?['name'] ?? '未命名'.tr}',
|
width: MediaQuery.sizeOf(context)
|
||||||
style: TextStyle(
|
.width *
|
||||||
fontFamily: 'Inter',
|
0.2,
|
||||||
fontSize: 26.rpx,
|
child: Text(
|
||||||
letterSpacing: 0.0,
|
'${widget.data['person']?['name'] ?? '未命名'.tr}',
|
||||||
color: themeController
|
style: TextStyle(
|
||||||
.currentColor.sc3,
|
fontFamily: 'Inter',
|
||||||
|
fontSize: 26.rpx,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
color: themeController
|
||||||
|
.currentColor.sc3,
|
||||||
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Text(
|
// Text(
|
||||||
@@ -233,7 +240,7 @@ class _MessageReviewPageState extends State<MessageReviewPage> {
|
|||||||
// color: themeController
|
// color: themeController
|
||||||
// .currentColor.sc3,
|
// .currentColor.sc3,
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
].divide(SizedBox(height: 34.rpx)),
|
].divide(SizedBox(height: 34.rpx)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user