feat(ui_kit): use MultiColor in button style
This commit is contained in:
@@ -40,20 +40,17 @@ class FlatButton extends FlatButtonComponent with $FlatButtonCWMixin {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Material(
|
||||
color: const Color(0x00000000),
|
||||
child: Ink(
|
||||
decoration: BoxDecoration(
|
||||
color: style?.backgroundColor ??
|
||||
Theme.of(context).buttonTheme.colorScheme?.onPrimary,
|
||||
gradient: LinearGradient(
|
||||
colors: (style?.borderColors != null &&
|
||||
style!.borderColors!.length >= 2)
|
||||
? style!.borderColors!
|
||||
: [
|
||||
// TODO(hpcl): change this
|
||||
Theme.of(context).cardColor,
|
||||
Theme.of(context).cardColor
|
||||
],
|
||||
),
|
||||
color: (style != null)
|
||||
? style!.backgroundColors?.color
|
||||
: Theme.of(context).buttonTheme.colorScheme?.onPrimary,
|
||||
gradient: (style?.backgroundColors?.isGradient ?? false)
|
||||
? LinearGradient(
|
||||
colors: style!.backgroundColors!.colors,
|
||||
)
|
||||
: null,
|
||||
boxShadow: [
|
||||
if (style?.shadow != null) ...[style!.shadow!]
|
||||
],
|
||||
|
||||
+12
-15
@@ -42,23 +42,20 @@ class OutlinedButton extends OutlinedButtonComponent
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Material(
|
||||
color: const Color(0x00000000),
|
||||
child: Ink(
|
||||
decoration: BoxDecoration(
|
||||
color: style?.backgroundColor ??
|
||||
Theme.of(context).buttonTheme.colorScheme?.onPrimary,
|
||||
border: GradientBoxBorder(
|
||||
gradient: LinearGradient(
|
||||
colors: (style?.borderColors != null &&
|
||||
style!.borderColors!.length >= 2)
|
||||
? style!.borderColors!
|
||||
: [
|
||||
// TODO(hpcl): change this
|
||||
Theme.of(context).cardColor,
|
||||
Theme.of(context).cardColor
|
||||
],
|
||||
),
|
||||
width: style?.stroke ?? 2,
|
||||
),
|
||||
color: (style != null)
|
||||
? style!.backgroundColors?.color
|
||||
: Theme.of(context).buttonTheme.colorScheme?.onPrimary,
|
||||
border: (style?.borderColors?.isGradient ?? false)
|
||||
? GradientBoxBorder(
|
||||
gradient: LinearGradient(
|
||||
colors: style!.borderColors!.colors,
|
||||
),
|
||||
width: style?.stroke ?? 2,
|
||||
)
|
||||
: null,
|
||||
boxShadow: [
|
||||
if (style?.shadow != null) ...[style!.shadow!]
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user