更新返回按钮样式统一样式
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,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -329,7 +329,12 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
|||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Container(
|
||||||
|
width:
|
||||||
|
MediaQuery.sizeOf(context)
|
||||||
|
.width *
|
||||||
|
0.2,
|
||||||
|
child: Text(
|
||||||
'${device['person']?['name'] ?? '未命名'.tr}',
|
'${device['person']?['name'] ?? '未命名'.tr}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
@@ -338,6 +343,10 @@ class _InstantBodyPageState extends State<InstantBodyPage>
|
|||||||
color: themeController
|
color: themeController
|
||||||
.currentColor.sc3,
|
.currentColor.sc3,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow:
|
||||||
|
TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
// Text(
|
// Text(
|
||||||
// '${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(device['person']?['birthday'])) ?? '未知数据'.tr}',
|
// '${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(device['person']?['birthday'])) ?? '未知数据'.tr}',
|
||||||
|
|||||||
@@ -142,7 +142,11 @@ class _MessageReviewPageState extends State<MessageReviewPage> {
|
|||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Container(
|
||||||
|
width: MediaQuery.sizeOf(context)
|
||||||
|
.width *
|
||||||
|
0.2,
|
||||||
|
child: Text(
|
||||||
'${widget.data['person']?['name'] ?? '未命名'.tr}',
|
'${widget.data['person']?['name'] ?? '未命名'.tr}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
@@ -151,6 +155,9 @@ class _MessageReviewPageState extends State<MessageReviewPage> {
|
|||||||
color: themeController
|
color: themeController
|
||||||
.currentColor.sc3,
|
.currentColor.sc3,
|
||||||
),
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
// Text(
|
// Text(
|
||||||
// '${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(widget.data['person']?['birthday'])) ?? '未知数据'.tr}',
|
// '${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(widget.data['person']?['birthday'])) ?? '未知数据'.tr}',
|
||||||
|
|||||||
Reference in New Issue
Block a user