diff --git a/lib/src/actions.dart b/lib/src/actions.dart index 418a9fb..2713181 100644 --- a/lib/src/actions.dart +++ b/lib/src/actions.dart @@ -8,6 +8,11 @@ typedef SlidableActionCallback = void Function(BuildContext context); const int _kFlex = 1; const Color _kBackgroundColor = Colors.white; const bool _kAutoClose = true; +const TextStyle _kDefaultlabelTextStyle = TextStyle( + color: Colors.white, + fontSize: 13, + fontWeight: FontWeight.w500, +); /// Represents an action of an [ActionPane]. class CustomSlidableAction extends StatelessWidget { @@ -136,6 +141,7 @@ class SlidableAction extends StatelessWidget { this.backgroundColor = _kBackgroundColor, this.foregroundColor, this.autoClose = _kAutoClose, + this.labelTextStyle = _kDefaultlabelTextStyle, required this.onPressed, this.icon, this.spacing = 4, @@ -169,6 +175,11 @@ class SlidableAction extends StatelessWidget { /// Defaults to 4. final double spacing; + /// The default text style for the label. + /// + /// Defaults to [ThemeData.textTheme.bodyText1]. + final TextStyle? labelTextStyle; + /// A label to display below the [icon]. final String? label; @@ -199,6 +210,7 @@ class SlidableAction extends StatelessWidget { Text( label!, overflow: TextOverflow.ellipsis, + style: labelTextStyle, ), ); }