diff --git a/README.md b/README.md index 6e2ae2b..ba5532c 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ routeBlur | Default is 0.0. If different than 0.0, creates a blurred overlay tha routeColor | Default is [Colors.transparent]. Only takes effect if [routeBlur] > 0.0. Make sure you use a color with transparency e.g. `Colors.grey[600].withOpacity(0.2)`. It does not take effect if [blockBackgroundInteraction] is false userInputForm | A [TextFormField] in case you want a simple user input. Every other widget is ignored if this is not null. onStatusChanged | a callback for you to listen to the different Flushbar status +titleTopSpacing | The spacing between [title] or [titleText] and [message] or [messageText] This spacing is applied if [title] or [titleText] provided #### Quick tip diff --git a/lib/flushbar.dart b/lib/flushbar.dart index 43c38ab..e1f0247 100644 --- a/lib/flushbar.dart +++ b/lib/flushbar.dart @@ -61,6 +61,7 @@ class Flushbar extends StatefulWidget { this.routeColor, this.userInputForm, this.endOffset, + this.titleTopSpacing = 6.0, this.flushbarRoute // Please dont init this }) // ignore: prefer_initializing_formals @@ -226,6 +227,10 @@ class Flushbar extends StatefulWidget { /// For custom safeArea you can use margin instead final bool safeArea; + /// The spacing between [title] or [titleText] and [message] or [messageText] + /// This spacing is applied if [title] or [titleText] provided + final double titleTopSpacing; + route.FlushbarRoute? flushbarRoute; /// Show the flushbar. Kicks in [FlushbarStatus.IS_APPEARING] state followed by [FlushbarStatus.SHOWING] @@ -327,7 +332,8 @@ class _FlushbarState extends State> 'A message is mandatory if you are not using userInputForm. Set either a message or messageText'); _isTitlePresent = (widget.title != null || widget.titleText != null); - _messageTopMargin = _isTitlePresent ? 6.0 : widget.padding.top; + _messageTopMargin = + _isTitlePresent ? widget.titleTopSpacing : widget.padding.top; _configureLeftBarFuture(); _configureProgressIndicatorAnimation();