feat(ui_kit): add more control over flat button prefix/suffix color

This commit is contained in:
Hugo Pointcheval 2023-04-18 09:33:00 +02:00
parent 0ca4c41a27
commit 2baaf5c0bb
Signed by: hugo
GPG Key ID: 3AAC487E131E00BC

View File

@ -169,7 +169,11 @@ class FlatButtonScreen extends CubitScreen<ButtonCubit, ButtonState> {
mainAxisSize: mainAxisSize ?? MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if (style.foregroundColors?.color != null &&
if (prefix != null &&
(prefix is Icon?) &&
((prefix as Icon?)?.color != null)) ...[
prefix!
] else if (style.foregroundColors?.color != null &&
prefix != null) ...[
ColorFiltered(
colorFilter: ColorFilter.mode(
@ -208,7 +212,21 @@ class FlatButtonScreen extends CubitScreen<ButtonCubit, ButtonState> {
)
],
Gap(style.padding?.vertical ?? 10),
if (style.foregroundColors?.color != null &&
if (suffix != null &&
(suffix is Icon?) &&
((suffix as Icon?)?.color != null)) ...[
suffix!
] else if (style.foregroundColors?.colors != null &&
style.foregroundColors!.colors.isNotEmpty &&
suffix != null) ...[
ColorFiltered(
colorFilter: ColorFilter.mode(
style.foregroundColors!.colors.last,
BlendMode.srcIn,
),
child: suffix,
)
] else if (style.foregroundColors?.color != null &&
suffix != null) ...[
ColorFiltered(
colorFilter: ColorFilter.mode(