fix: roll button colors

This commit is contained in:
2025-04-01 23:44:25 +03:00
parent 5bcf9f5eb6
commit 2a65c19e3b
2 changed files with 7 additions and 4 deletions

View File

@@ -36,13 +36,16 @@ class RoundIconButton extends StatelessWidget {
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
final bgColor = Color.alphaBlend(
backgroundColor ?? Colors.transparent, colorScheme.primary);
backgroundColor ?? Colors.transparent,
colorScheme.secondary,
);
final fgColor = Color.alphaBlend(
foregroundColor ?? Colors.transparent,
(ThemeData.estimateBrightnessForColor(bgColor) == Brightness.light
? Colors.black
: Colors.white),
);
debugPrint('fgColor: $fgColor, bgColor: $bgColor');
return ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.zero,
@@ -53,7 +56,7 @@ class RoundIconButton extends StatelessWidget {
onPressed: onPressed,
child: IconTheme.merge(
child: icon,
data: IconThemeData(size: size / 2),
data: IconThemeData(size: size / 2, color: fgColor),
),
);
}

View File

@@ -115,7 +115,7 @@ class DynamicActionCardMini extends StatelessWidget {
color: Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.3),
.withValues(alpha: 0.3),
),
child: starred
? starredIcon ??
@@ -204,4 +204,4 @@ class RectClipper extends CustomClipper<Rect> {
bool shouldReclip(covariant RectClipper oldClipper) =>
oldClipper.size.width != size.width ||
oldClipper.size.height != size.height;
}
}