From 117453eb52945ad2bcf7ac141c7690cbfa71b806 Mon Sep 17 00:00:00 2001 From: Stanislav Ilin Date: Fri, 18 Aug 2023 02:33:50 +0500 Subject: [PATCH 1/3] Add titleTopSpacing customization field --- lib/flushbar.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(); From ca8df8c238e749e844a45979fef019c49728366b Mon Sep 17 00:00:00 2001 From: Stanislav Ilin Date: Fri, 18 Aug 2023 02:44:30 +0500 Subject: [PATCH 2/3] Add titleTopSpacing description in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e2ae2b..82dd241 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ blockBackgroundInteraction | Determines if user can interact with the screen beh routeBlur | Default is 0.0. If different than 0.0, creates a blurred overlay that prevents the user from interacting with the screen. The greater the value, the greater the blur. It does not take effect if [blockBackgroundInteraction] is false 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 From 3904293054d6e021091a17c88e5702f6f79d75e6 Mon Sep 17 00:00:00 2001 From: Stanislav Ilin Date: Fri, 18 Aug 2023 02:44:54 +0500 Subject: [PATCH 3/3] Fix README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 82dd241..ba5532c 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ blockBackgroundInteraction | Determines if user can interact with the screen beh routeBlur | Default is 0.0. If different than 0.0, creates a blurred overlay that prevents the user from interacting with the screen. The greater the value, the greater the blur. It does not take effect if [blockBackgroundInteraction] is false 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