feat(ui_kit): add more control over flat button prefix/suffix color
This commit is contained in:
parent
0ca4c41a27
commit
2baaf5c0bb
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user