Skip to content

Commit

Permalink
✨ (#148) Add feasibility to add textDirection of title and `descr…
Browse files Browse the repository at this point in the history
…iption`.
  • Loading branch information
dhvanit-v-simformsolutions committed Mar 15, 2023
1 parent 45e8225 commit cc9d15e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## (Unreleased)
- Feature [#148](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/148) Add feasibility to add `textDirection` of `title` and `description`.

## [2.0.2]
- Fixed [#335](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/335) - Fixed flutter inspector makes screen grey
- Fixed [#346](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/346) - Dont respond to any clicks in target.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ WidgetsBinding.instance.addPostFrameCallback((_) =>
| tooltipPosition | TooltipPosition? | | Defines vertical position of tooltip respective to Target widget |||
| titlePadding | EdgeInsets? | EdgeInsets.zero | Padding to title || |
| descriptionPadding | EdgeInsets? | EdgeInsets.zero | Padding to description || |
| titleTextDirection | TextDirection? | | Give textDirection to title || |
| descriptionPadding | TextDirection? | | Give textDirection to description || |

## How to use

Expand Down
12 changes: 12 additions & 0 deletions lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ class Showcase extends StatefulWidget {
/// Provides padding around the description. Default padding is zero.
final EdgeInsets? descriptionPadding;

/// Provides text direction of tooltip title.
final TextDirection? titleTextDirection;

/// Provides text direction of tooltip description.
final TextDirection? descriptionTextDirection;

const Showcase({
required this.key,
required this.child,
Expand Down Expand Up @@ -273,6 +279,8 @@ class Showcase extends StatefulWidget {
this.tooltipPosition,
this.titlePadding,
this.descriptionPadding,
this.titleTextDirection,
this.descriptionTextDirection,
}) : height = null,
width = null,
container = null,
Expand Down Expand Up @@ -327,6 +335,8 @@ class Showcase extends StatefulWidget {
tooltipPadding = const EdgeInsets.symmetric(vertical: 8),
titlePadding = null,
descriptionPadding = null,
titleTextDirection = null,
descriptionTextDirection = null,
assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0,
"overlay opacity must be between 0 and 1.");

Expand Down Expand Up @@ -552,6 +562,8 @@ class _ShowcaseState extends State<Showcase> {
tooltipPosition: widget.tooltipPosition,
titlePadding: widget.titlePadding,
descriptionPadding: widget.descriptionPadding,
titleTextDirection: widget.titleTextDirection,
descriptionTextDirection: widget.descriptionTextDirection,
),
],
],
Expand Down
8 changes: 8 additions & 0 deletions lib/src/tooltip_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class ToolTipWidget extends StatefulWidget {
final TooltipPosition? tooltipPosition;
final EdgeInsets? titlePadding;
final EdgeInsets? descriptionPadding;
final TextDirection? titleTextDirection;
final TextDirection? descriptionTextDirection;

const ToolTipWidget({
Key? key,
Expand Down Expand Up @@ -90,6 +92,8 @@ class ToolTipWidget extends StatefulWidget {
this.tooltipPosition,
this.titlePadding,
this.descriptionPadding,
this.titleTextDirection,
this.descriptionTextDirection,
}) : super(key: key);

@override
Expand Down Expand Up @@ -425,6 +429,8 @@ class _ToolTipWidgetState extends State<ToolTipWidget>
child: Text(
widget.title!,
textAlign: widget.titleAlignment,
textDirection:
widget.titleTextDirection,
style: widget.titleTextStyle ??
Theme.of(context)
.textTheme
Expand All @@ -442,6 +448,8 @@ class _ToolTipWidgetState extends State<ToolTipWidget>
child: Text(
widget.description!,
textAlign: widget.descriptionAlignment,
textDirection:
widget.descriptionTextDirection,
style: widget.descTextStyle ??
Theme.of(context)
.textTheme
Expand Down

0 comments on commit cc9d15e

Please sign in to comment.