diff --git a/lib/src/actions.dart b/lib/src/actions.dart index 418a9fb..4022a22 100644 --- a/lib/src/actions.dart +++ b/lib/src/actions.dart @@ -138,8 +138,10 @@ class SlidableAction extends StatelessWidget { this.autoClose = _kAutoClose, required this.onPressed, this.icon, + this.iconWidget, this.spacing = 4, this.label, + this.style, this.borderRadius = BorderRadius.zero, this.padding, }) : assert(flex > 0), @@ -163,6 +165,7 @@ class SlidableAction extends StatelessWidget { /// An icon to display above the [label]. final IconData? icon; + final Widget? iconWidget; /// The space between [icon] and [label] if both set. /// @@ -171,6 +174,7 @@ class SlidableAction extends StatelessWidget { /// A label to display below the [icon]. final String? label; + final TextStyle? style; /// Padding of the OutlinedButton final BorderRadius borderRadius; @@ -187,6 +191,11 @@ class SlidableAction extends StatelessWidget { Icon(icon), ); } + if (iconWidget != null) { + children.add( + iconWidget, + ); + } if (label != null) { if (children.isNotEmpty) { @@ -198,6 +207,7 @@ class SlidableAction extends StatelessWidget { children.add( Text( label!, + style: style, overflow: TextOverflow.ellipsis, ), );