fix:调整禁用按钮逻辑
This commit is contained in:
parent
3a262d80dd
commit
6a848ac23e
@ -53,15 +53,11 @@ class SubmitBtn extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: isDisabled == false
|
backgroundColor: isDisabled == true
|
||||||
? AppColors.btnDisableColor
|
? AppColors.btnDisableColor
|
||||||
: (isDelete == true ? Colors.red : AppColors.mainColor),
|
: (isDelete == true ? Colors.red : AppColors.mainColor),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: isDisabled == true ? null : onClick,
|
||||||
if (onClick != null) {
|
|
||||||
onClick!();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Text(
|
child: Text(
|
||||||
btnName!,
|
btnName!,
|
||||||
textAlign: TextAlign.center, // 文本居中对齐
|
textAlign: TextAlign.center, // 文本居中对齐
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user