diff --git a/lib/tools/submitBtn.dart b/lib/tools/submitBtn.dart index 01511077..81a57c62 100755 --- a/lib/tools/submitBtn.dart +++ b/lib/tools/submitBtn.dart @@ -53,15 +53,11 @@ class SubmitBtn extends StatelessWidget { ), child: ElevatedButton( style: ElevatedButton.styleFrom( - backgroundColor: isDisabled == false + backgroundColor: isDisabled == true ? AppColors.btnDisableColor : (isDelete == true ? Colors.red : AppColors.mainColor), ), - onPressed: () { - if (onClick != null) { - onClick!(); - } - }, + onPressed: isDisabled == true ? null : onClick, child: Text( btnName!, textAlign: TextAlign.center, // 文本居中对齐