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