diff --git a/example/lib/pages/components/button_example.dart b/example/lib/pages/components/button_example.dart index 926379d9..379f95f3 100644 --- a/example/lib/pages/components/button_example.dart +++ b/example/lib/pages/components/button_example.dart @@ -36,7 +36,7 @@ class _ButtonExampleState extends State { fabs = [ ZetaFAB( scrollController: _scrollController, - label: 'Small Circle Primary', + label: 'Small Circle Disabled', size: ZetaFabSize.small, expanded: false, shape: ZetaWidgetBorder.full, @@ -45,7 +45,7 @@ class _ButtonExampleState extends State { ZetaFAB( scrollController: _scrollController, expanded: false, - label: 'Small Rounded Primary', + label: 'Small Rounded Secondary', size: ZetaFabSize.small, shape: ZetaWidgetBorder.rounded, type: ZetaFabType.secondary, @@ -53,7 +53,7 @@ class _ButtonExampleState extends State { ), ZetaFAB( scrollController: _scrollController, - label: 'Small Sharp Primary', + label: 'Small Sharp Inverse', size: ZetaFabSize.small, shape: ZetaWidgetBorder.sharp, expanded: false, @@ -62,7 +62,7 @@ class _ButtonExampleState extends State { ), ZetaFAB( scrollController: _scrollController, - label: 'Large Circle Primary', + label: 'Large Circle Secondary', size: ZetaFabSize.large, shape: ZetaWidgetBorder.full, type: ZetaFabType.secondary, @@ -71,7 +71,7 @@ class _ButtonExampleState extends State { ), ZetaFAB( scrollController: _scrollController, - label: 'Large Rounded Secondary', + label: 'Large Rounded Inverse', size: ZetaFabSize.large, shape: ZetaWidgetBorder.rounded, expanded: false, @@ -80,7 +80,7 @@ class _ButtonExampleState extends State { ), ZetaFAB( scrollController: _scrollController, - label: 'Large Sharp Secondary', + label: 'Large Sharp Primary', size: ZetaFabSize.large, shape: ZetaWidgetBorder.sharp, type: ZetaFabType.primary, diff --git a/lib/src/components/fabs/fab.dart b/lib/src/components/fabs/fab.dart index 486a1749..d8e554da 100644 --- a/lib/src/components/fabs/fab.dart +++ b/lib/src/components/fabs/fab.dart @@ -162,7 +162,13 @@ class _ZetaFABState extends State { child: Row( mainAxisSize: MainAxisSize.min, children: [ - ZetaIcon(widget.icon, size: widget.size.iconSize(context)), + ZetaIcon( + widget.icon, + size: widget.size.iconSize(context), + color: widget.onPressed != null + ? widget.type.iconColors(context) + : Zeta.of(context).colors.iconDisabled, + ), if (widget.expanded && widget.label != null) Row( mainAxisSize: MainAxisSize.min, @@ -206,6 +212,17 @@ extension on ZetaFabType { return zetaColors.cool; } } + + Color iconColors(BuildContext context) { + final zetaColors = Zeta.of(context).colors; + switch (this) { + case ZetaFabType.primary: + case ZetaFabType.inverse: + return zetaColors.iconInverse; + case ZetaFabType.secondary: + return zetaColors.iconDefault; + } + } } extension on ZetaWidgetBorder {