TF-3985 Display Increase your space button when premium is available on web desktop

This commit is contained in:
dab246
2025-09-09 13:13:53 +07:00
committed by Dat H. Pham
parent 066557110d
commit 9671822f78
10 changed files with 165 additions and 12 deletions
@@ -243,6 +243,7 @@ extension AppColor on Color {
static const m3Tertiary20 = Color(0xFF71767C);
static const m3Neutral70 = Color(0xFFAEAAAE);
static const m3Neutral90 = Color(0xFFE6E1E5);
static const m3SysLightSecondaryBlue = Color(0xFF5C9CE6);
static const grayBackgroundColor = Color(0xFFF3F6F9);
static const m3SurfaceBackground = Color(0xFF1C1B1F);
static const warningColor = Color(0xFFFFC107);
@@ -239,6 +239,7 @@ class ImagePaths {
String get icTwakeWorkplace => _getIconPath('icon_twp.png');
String get animLottieTmail => _getAnimationPath('lottie-tmail.json');
String get icExpandArrows => _getImagePath('ic_expand_arrows.svg');
String get icPremium => _getImagePath('ic_premium.svg');
String _getImagePath(String imageName) {
return AssetsPaths.images + imageName;
@@ -1,11 +1,19 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/presentation/utils/theme_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class ConfirmDialogButton extends StatelessWidget {
final String label;
final Color? backgroundColor;
final Color? textColor;
final Color? borderColor;
final String? icon;
final double? iconSize;
final Color? iconColor;
final TextStyle? textStyle;
final double? radius;
final EdgeInsetsGeometry? padding;
final VoidCallback? onTapAction;
const ConfirmDialogButton({
@@ -14,6 +22,12 @@ class ConfirmDialogButton extends StatelessWidget {
this.backgroundColor,
this.textColor,
this.borderColor,
this.icon,
this.iconSize,
this.iconColor,
this.textStyle,
this.radius,
this.padding,
this.onTapAction,
});
@@ -21,11 +35,11 @@ class ConfirmDialogButton extends StatelessWidget {
Widget build(BuildContext context) {
final outlineBorder = borderColor != null
? RoundedRectangleBorder(
borderRadius: const BorderRadius.all(Radius.circular(100)),
borderRadius: BorderRadius.all(Radius.circular(radius ?? 100)),
side: BorderSide(width: 1, color: borderColor!),
)
: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(100)),
: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(radius ?? 100)),
);
return TextButton(
@@ -33,15 +47,37 @@ class ConfirmDialogButton extends StatelessWidget {
backgroundColor: backgroundColor,
overlayColor: Theme.of(context).colorScheme.outline.withValues(alpha: 0.08),
shape: outlineBorder,
padding: const EdgeInsets.symmetric(horizontal: 10),
padding: padding ?? const EdgeInsets.symmetric(horizontal: 10),
),
onPressed: onTapAction,
child: Text(
label,
style: ThemeUtils.textStyleM3LabelLarge(color: textColor),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
child: icon == null
? Text(
label,
style: textStyle ?? ThemeUtils.textStyleM3LabelLarge(color: textColor),
maxLines: 1,
overflow: TextOverflow.ellipsis,
)
: Row(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset(
icon!,
width: iconSize ?? 14,
height: iconSize ?? 14,
fit: BoxFit.fill,
colorFilter: iconColor?.toInt() == Colors.transparent.toInt()
? null
: iconColor?.asFilter() ?? AppColor.primaryMain.asFilter(),
),
const SizedBox(width: 8),
Text(
label,
style: textStyle ?? ThemeUtils.textStyleM3LabelLarge(color: textColor),
maxLines: 1,
overflow: TextOverflow.ellipsis,
)
],
),
);
}
}