TF-3704 Fix height composer button

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-05-09 10:45:29 +07:00
committed by Dat H. Pham
parent aca0538b6b
commit b7e4eb6245
3 changed files with 31 additions and 33 deletions
@@ -14,6 +14,7 @@ class TMailButtonWidget extends StatelessWidget {
final double borderRadius; final double borderRadius;
final double? width; final double? width;
final double? height;
final double maxWidth; final double maxWidth;
final double maxHeight; final double maxHeight;
final double minWidth; final double minWidth;
@@ -50,6 +51,7 @@ class TMailButtonWidget extends StatelessWidget {
this.onLongPressActionCallback, this.onLongPressActionCallback,
this.borderRadius = 20, this.borderRadius = 20,
this.width, this.width,
this.height,
this.maxWidth = double.infinity, this.maxWidth = double.infinity,
this.maxHeight = double.infinity, this.maxHeight = double.infinity,
this.minWidth = 0, this.minWidth = 0,
@@ -86,6 +88,7 @@ class TMailButtonWidget extends StatelessWidget {
OnLongPressActionCallback? onLongPressActionCallback, OnLongPressActionCallback? onLongPressActionCallback,
double borderRadius = 20, double borderRadius = 20,
double? width, double? width,
double? height,
double maxWidth = double.infinity, double maxWidth = double.infinity,
double maxHeight = double.infinity, double maxHeight = double.infinity,
double minWidth = 0, double minWidth = 0,
@@ -110,6 +113,7 @@ class TMailButtonWidget extends StatelessWidget {
onLongPressActionCallback: onLongPressActionCallback, onLongPressActionCallback: onLongPressActionCallback,
borderRadius: borderRadius, borderRadius: borderRadius,
width: width, width: width,
height: height,
maxWidth : maxWidth, maxWidth : maxWidth,
maxHeight: maxHeight, maxHeight: maxHeight,
minWidth: minWidth, minWidth: minWidth,
@@ -137,6 +141,7 @@ class TMailButtonWidget extends StatelessWidget {
OnLongPressActionCallback? onLongPressActionCallback, OnLongPressActionCallback? onLongPressActionCallback,
double borderRadius = 20, double borderRadius = 20,
double? width, double? width,
double? height,
double maxWidth = double.infinity, double maxWidth = double.infinity,
double maxHeight = double.infinity, double maxHeight = double.infinity,
double minWidth = 0, double minWidth = 0,
@@ -161,6 +166,7 @@ class TMailButtonWidget extends StatelessWidget {
onLongPressActionCallback: onLongPressActionCallback, onLongPressActionCallback: onLongPressActionCallback,
borderRadius: borderRadius, borderRadius: borderRadius,
width: width, width: width,
height: height,
maxWidth : maxWidth, maxWidth : maxWidth,
maxHeight: maxHeight, maxHeight: maxHeight,
minWidth: minWidth, minWidth: minWidth,
@@ -354,6 +360,7 @@ class TMailButtonWidget extends StatelessWidget {
onLongPressActionCallback: onLongPressActionCallback, onLongPressActionCallback: onLongPressActionCallback,
borderRadius: borderRadius, borderRadius: borderRadius,
width: width, width: width,
height: height,
maxWidth: maxWidth, maxWidth: maxWidth,
maxHeight: maxHeight, maxHeight: maxHeight,
minWidth: minWidth, minWidth: minWidth,
@@ -12,6 +12,7 @@ class TMailContainerWidget extends StatelessWidget {
final Widget child; final Widget child;
final double borderRadius; final double borderRadius;
final double? width; final double? width;
final double? height;
final double maxWidth; final double maxWidth;
final double maxHeight; final double maxHeight;
final double minWidth; final double minWidth;
@@ -31,6 +32,7 @@ class TMailContainerWidget extends StatelessWidget {
this.onLongPressActionCallback, this.onLongPressActionCallback,
this.borderRadius = 20, this.borderRadius = 20,
this.width, this.width,
this.height,
this.maxWidth = double.infinity, this.maxWidth = double.infinity,
this.maxHeight = double.infinity, this.maxHeight = double.infinity,
this.minWidth = 0, this.minWidth = 0,
@@ -45,6 +47,24 @@ class TMailContainerWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final item = Container(
decoration: BoxDecoration(
color: backgroundColor ?? AppColor.colorButtonHeaderThread,
borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
border: border,
boxShadow: boxShadow,
),
width: width,
height: height,
constraints: BoxConstraints(
maxWidth: maxWidth,
maxHeight: maxHeight,
minWidth: minWidth,
),
padding: padding ?? const EdgeInsetsDirectional.all(8),
child: child,
);
final materialChild = Material( final materialChild = Material(
type: MaterialType.transparency, type: MaterialType.transparency,
child: InkWell( child: InkWell(
@@ -70,39 +90,9 @@ class TMailContainerWidget extends StatelessWidget {
child: tooltipMessage != null child: tooltipMessage != null
? Tooltip( ? Tooltip(
message: tooltipMessage, message: tooltipMessage,
child: Container( child: item,
decoration: BoxDecoration(
color: backgroundColor ?? AppColor.colorButtonHeaderThread,
borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
border: border,
boxShadow: boxShadow
),
width: width,
constraints: BoxConstraints(
maxWidth: maxWidth,
maxHeight: maxHeight,
minWidth: minWidth
),
padding: padding ?? const EdgeInsetsDirectional.all(8),
child: child
)
)
: Container(
decoration: BoxDecoration(
color: backgroundColor ?? AppColor.colorButtonHeaderThread,
borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
border: border,
boxShadow: boxShadow
),
width: width,
constraints: BoxConstraints(
maxWidth: maxWidth,
maxHeight: maxHeight,
minWidth: minWidth
),
padding: padding ?? const EdgeInsetsDirectional.all(8),
child: child
) )
: item
), ),
); );
@@ -35,8 +35,9 @@ class ComposeButtonWidget extends StatelessWidget {
icon: imagePaths.icComposeWeb, icon: imagePaths.icComposeWeb,
borderRadius: 10, borderRadius: 10,
iconSize: 24, iconSize: 24,
height: 44,
iconColor: Colors.white, iconColor: Colors.white,
padding: const EdgeInsetsDirectional.symmetric(vertical: 8), padding: const EdgeInsetsDirectional.symmetric(horizontal: 12),
backgroundColor: AppColor.blue700, backgroundColor: AppColor.blue700,
textStyle: ThemeUtils.textStyleBodyBody2(color: Colors.white), textStyle: ThemeUtils.textStyleBodyBody2(color: Colors.white),
onTapActionCallback: onTapAction, onTapActionCallback: onTapAction,