TF-913 Fix button text line break in advanced search view

This commit is contained in:
dab246
2022-09-21 11:52:42 +07:00
committed by Dat H. Pham
parent 7fe899daf5
commit d0ff07edfb
7 changed files with 182 additions and 139 deletions
@@ -120,9 +120,15 @@ Widget buildTextButton(String text, {
backgroundColor: MaterialStateProperty.resolveWith((states) => backgroundColor ?? AppColor.colorTextButton),
elevation: MaterialStateProperty.resolveWith((states) => 0),
padding: MaterialStateProperty.resolveWith<EdgeInsets>(
(Set<MaterialState> states) => padding ?? EdgeInsets.zero),
(Set<MaterialState> states) => padding ?? EdgeInsets.symmetric(horizontal: 8)),
shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.circular(radius ?? 0)))),
child: Text(text, style: textStyle ?? TextStyle(fontSize: 17, color: Colors.white, fontWeight: FontWeight.w500)),
child: Text(
text,
textAlign: TextAlign.center,
style: textStyle ?? TextStyle(
fontSize: 17,
color: Colors.white,
fontWeight: FontWeight.w500)),
onPressed: () => onTap?.call()
),
);
@@ -134,13 +140,17 @@ Widget buildButtonWrapText(String name, {
Color? borderColor,
double? radius,
double? height,
double? minWidth,
EdgeInsets? padding,
FocusNode? focusNode,
IconWebCallback? onTap
}) {
return Container(
height: height ?? 40,
padding: padding,
constraints: BoxConstraints(minWidth: minWidth ?? 0),
child: ElevatedButton(
focusNode: focusNode,
onPressed: () => onTap?.call(),
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith<Color>(