Skip to content

Commit

Permalink
✨ Add padding to title and description
Browse files Browse the repository at this point in the history
  • Loading branch information
ujas-m-simformsolutions committed Jan 3, 2023
1 parent bdaae57 commit 2842d3d
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ changed.
## Checklist
<!--
Before you create this PR confirm that it meets all requirements listed below by checking the
relevant checkboxes with `[x]`. If some checkbox is not applicable, mark it as `[-]`.
relevant checkboxes with `[x]`. If some checkbox is not applicable, mark it as `[ ]`.
-->

- [ ] The title of my PR starts with a [Conventional Commit] prefix (`fix:`, `feat:`, `docs:` etc).
Expand Down
29 changes: 15 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## [2.0.1] - December 30, 2022 (Unreleased)
## [2.0.1] (Unreleased)
- Added PR title validation workflow
- Fixed [#316](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/316) - Add title and description padding

## [2.0.0+1] - November 2, 2022
## [2.0.0+1]
- Fixed [#237](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/261) - Feature added to enable/disable default gesture of ShowcaseView child using `disableDefaultTargetGestures` parameter
- Fixed [#206](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/206) - getLeft and getRight return wrong result when in middle with a little offset
- Fixed issue of duplicate key found in example.
Expand All @@ -11,24 +12,24 @@
- Fixed [#268](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/268) - Added smooth scale transition when tooltip appear on the screen
- Updated parameter name of `ShowCaseWidget` and `Showcase` class

## [1.1.8] - August 5, 2022
## [1.1.8]
- Fixed [#237](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/237) - Feature added to enable/disable overlay click using `disableBarrierInteraction` parameters
- ToolTip BorderRadius setting support

## [1.1.7] - July 11, 2022
## [1.1.7]

- Fixed [#235](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/235) - 1.1.6 scrolling behavior in PageView.
- Fixed [#242](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/242) - Error when display showcase on FloatingActionBar inside a TabBar (with more than 1 tab).

## [1.1.6] - June 23, 2022
## [1.1.6]

- Fixed [#62](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/62) - While using ShowCase widget, not scrolling to respective widget when it's not visible.
- Fixed [#131](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/131) - Support of other gestures onTargetLongPress and onTargetDoubleTap
- Fixed [#140](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/140) - disableAnimation at ShowcaseWidget level
- Fixed [#71](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/71) - Highlight Not working when widget is not visible on screen
- Add flutter 3.0 support.

## [1.1.5] - March 4, 2022
## [1.1.5]

- Fixed [#173](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/173) - showArrow not working
- Fixed [#150](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/150) - Add condition for determine state is active
Expand All @@ -38,35 +39,35 @@
- Fixed [#162](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/162) - Add feature to move back
- Fixed [#181](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/181) - Add feature to go to previous item

## [1.1.4] - November 26, 2021
## [1.1.4]

- Add glassmorphism effect in showcase background.
- Fixed [#166](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/166) - shapeBorder need to be more customisable
- Fixed [#163](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/163) - Null check operator used on a null value

## [1.1.3] - October 28, 2021
## [1.1.3]

- Fixed [#158](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/158) - Arrow animation is not synchronized with tooltip

## [1.1.2] - October 12, 2021
## [1.1.2]

- Fixed [#78](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/78) - Exception:BoxConstraints has NaN values #78
- Fixed [#139](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/139) - Weird position #139
- Fixed [#138](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/138) - show Unhandled Exception: Null check operator used on a null value error

## [1.1.1] - July 24, 2021
## [1.1.1]

- Fixed [#92](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/92) - Showcase in ReorderableListView show at incorrect position
- License update from BSD 2-Clause "Simplified" to MIT

## [1.1.0] - June 28, 2021
## [1.1.0]

- Fixed [#103](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/103) - add overlay padding.
- Fixed [#105](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/105) - showcase not showing text in one line even if it is not so big.
- Fixed [#56](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/56) - Landscape mode issue
- Fixed [#86](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/86) - Showcase isn't rendering responsively

## [1.0.0] - March 07, 2021
## [1.0.0]

- Fixed [#95](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/95) - Migrated to null safety.
- Fixed [#74](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/74) - Long text description is hidden.
Expand All @@ -75,14 +76,14 @@
- Fixed [#84](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/84) - Background dim does not work in some screens.
- Fixed [#90](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/90) - ListView Item Support.

## [0.1.6] - August 21, 2020
## [0.1.6]

- [Feature #63](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/63) method callback after individual showcase start and end
- [Fix #57](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/57) Position of the Showcase.withWidget is different on iPhone 11
- [Feature #49](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/pull/49) Add autoplay tooltip on showcase view plugin.


## [0.1.5] - January 09, 2020
## [0.1.5]

* Refactor usage of deprecated methods
* Add support for `disableAnimation` option.
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ WidgetsBinding.instance.addPostFrameCallback((_) =>
| onTargetClick | VoidCallback? | | Triggers when target widget is being clicked |||
| onTargetDoubleTap | VoidCallback? | | Triggers when target widget is being double clicked |||
| onTargetLongPress | VoidCallback? | | Triggers when target widget is being long pressed |||

| titlePadding | EdgeInsets? | EdgeInsets.zero | Padding to title || |
| descriptionPadding | EdgeInsets? | EdgeInsets.zero | Padding to description || |

## How to use

Expand Down
1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:exported="true"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
Expand Down
14 changes: 13 additions & 1 deletion lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,20 @@ class Showcase extends StatefulWidget {
///
/// Alignment will be pre-calculated but if pre-calculated
/// alignment doesn't work then this parameter can be
/// used to customise the direct of the tooltip animation.
/// used to customise the direction of the tooltip animation.
///
/// eg.
/// ```dart
/// Alignment(-0.2,0.3) or Alignment.centerLeft
/// ```
final Alignment? scaleAnimationAlignment;

/// Provides padding around the title. Default padding is zero.
final EdgeInsets? titlePadding;

/// Provides padding around the description. Default padding is zero.
final EdgeInsets? descriptionPadding;

const Showcase({
required this.key,
required this.child,
Expand Down Expand Up @@ -260,6 +266,8 @@ class Showcase extends StatefulWidget {
this.scaleAnimationDuration = const Duration(milliseconds: 300),
this.scaleAnimationCurve = Curves.easeIn,
this.scaleAnimationAlignment,
this.titlePadding,
this.descriptionPadding,
}) : height = null,
width = null,
container = null,
Expand Down Expand Up @@ -317,6 +325,8 @@ class Showcase extends StatefulWidget {
textColor = Colors.black,
tooltipBorderRadius = null,
tooltipPadding = const EdgeInsets.symmetric(vertical: 8),
titlePadding = null,
descriptionPadding = null,
assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0,
"overlay opacity must be between 0 and 1.");

Expand Down Expand Up @@ -540,6 +550,8 @@ class _ShowcaseState extends State<Showcase> {
scaleAnimationCurve: widget.scaleAnimationCurve,
scaleAnimationAlignment: widget.scaleAnimationAlignment,
isTooltipDismissed: _isTooltipDismissed,
titlePadding: widget.titlePadding,
descriptionPadding: widget.descriptionPadding,
),
],
)
Expand Down
60 changes: 37 additions & 23 deletions lib/src/tooltip_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class ToolTipWidget extends StatefulWidget {
final Curve scaleAnimationCurve;
final Alignment? scaleAnimationAlignment;
final bool isTooltipDismissed;
final EdgeInsets? titlePadding;
final EdgeInsets? descriptionPadding;

const ToolTipWidget({
Key? key,
Expand Down Expand Up @@ -83,6 +85,8 @@ class ToolTipWidget extends StatefulWidget {
required this.scaleAnimationCurve,
this.scaleAnimationAlignment,
this.isTooltipDismissed = false,
this.titlePadding,
this.descriptionPadding,
}) : super(key: key);

@override
Expand Down Expand Up @@ -414,33 +418,43 @@ class _ToolTipWidgetState extends State<ToolTipWidget>
: CrossAxisAlignment.center,
children: <Widget>[
widget.title != null
? Text(
widget.title!,
textAlign: widget.titleAlignment,
style: widget.titleTextStyle ??
Theme.of(context)
.textTheme
.headline6!
.merge(
TextStyle(
color:
widget.textColor,
? Padding(
padding: widget.titlePadding ??
EdgeInsets.zero,
child: Text(
widget.title!,
textAlign:
widget.titleAlignment,
style: widget.titleTextStyle ??
Theme.of(context)
.textTheme
.headline6!
.merge(
TextStyle(
color: widget
.textColor,
),
),
),
),
)
: const SizedBox(),
Text(
widget.description!,
textAlign: widget.descriptionAlignment,
style: widget.descTextStyle ??
Theme.of(context)
.textTheme
.subtitle2!
.merge(
TextStyle(
color: widget.textColor,
Padding(
padding: widget.descriptionPadding ??
EdgeInsets.zero,
child: Text(
widget.description!,
textAlign:
widget.descriptionAlignment,
style: widget.descTextStyle ??
Theme.of(context)
.textTheme
.subtitle2!
.merge(
TextStyle(
color: widget.textColor,
),
),
),
),
),
],
)
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: showcaseview
description: A Flutter package to Showcase/Highlight widgets step by step.
version: 2.0.0+1
version: 2.0.1
homepage: https://github.com/simformsolutions/flutter_showcaseview
issue_tracker: https://github.com/simformsolutions/flutter_showcaseview/issues

Expand Down

0 comments on commit 2842d3d

Please sign in to comment.