This commit is contained in:
wyf
2025-05-23 14:51:09 +08:00
parent 8a418c9c98
commit c650bad8b1
36 changed files with 1297 additions and 892 deletions

View File

@@ -38,6 +38,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
@override
void initState() {
super.initState();
personController.dateTime = null;
personController.getDiseaseData().then((apiResponse) {
if (apiResponse.code != HttpStatusCodes.ok) {
TopSlideNotification.show(
@@ -108,7 +109,6 @@ class _UpdatePageState extends State<UpdatePersonPage> {
if (apiRespons.code == HttpStatusCodes.ok) {
TopSlideNotification.show(context,
text: apiRespons.msg!);
} else {
TopSlideNotification.show(context,
text: apiRespons.msg!,
@@ -201,6 +201,8 @@ class _UpdatePageState extends State<UpdatePersonPage> {
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController
.currentColor.sc4,
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
@@ -269,7 +271,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
children: [
Obx(
() {
bool isMaleGreyed =
@@ -441,6 +443,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
personController.dateTime = d;
personController.updateAll();
},
title: "生日".tr,
);
});
},
@@ -488,7 +491,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
alignment: AlignmentDirectional(0, 0),
child: Stack(
alignment: Alignment.center,
children: [
children: [
TextFormField(
keyboardType: TextInputType.number,
inputFormatters: [
@@ -499,8 +502,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
.height.value
.toString(),
onChanged: (value) {
personController.height.value =
int.tryParse(value) ?? 0;
personController.height.value = value;
},
autofocus: false,
obscureText: false,
@@ -573,7 +575,8 @@ class _UpdatePageState extends State<UpdatePersonPage> {
Obx(() {
final height =
personController.height.value;
return height == 0
return (height == null ||
height.isEmpty)
? const SizedBox.shrink() // 不显示任何内容
: Text(
'${height}cm',
@@ -625,8 +628,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
.weight.value
.toString(),
onChanged: (value) {
personController.weight.value =
int.tryParse(value) ?? 0;
personController.weight.value = value;
},
autofocus: false,
obscureText: false,
@@ -698,8 +700,9 @@ class _UpdatePageState extends State<UpdatePersonPage> {
),
Obx(() {
final weight =
personController.weight.value;
return weight == 0
personController.weight?.value;
return (weight == null ||
weight.isEmpty)
? const SizedBox.shrink() // 不显示任何内容
: Text(
'${weight}kg',