Skip to content

Commit

Permalink
fix: 🩹Resolved merge conflict and PR review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahil-Simform committed Dec 2, 2024
1 parent dbbf5fe commit bc9995a
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 70 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,26 @@ A Flutter package allows you to Showcase/Highlight your widgets step by step.
![The example app running in Android](https://raw.githubusercontent.com/SimformSolutionsPvtLtd/flutter_showcaseview/master/preview/showcaseview.gif)

## Migration guide for release 4.0.0
Renamed parameters `titleAlignment` to `titleTextAlign` and `descriptionAlignment` to `descriptionTextAlign` to correspond it more with the TextAlign property

Renamed parameters `titleAlignment` to `titleTextAlign` and `descriptionAlignment`
to `descriptionTextAlign` to correspond it more with the TextAlign property.`titleAlignment`
and `descriptionAlignment` will be used for widget alignment.

Before:
```dart
Showcase(
titleAlignment: TextAlign.center,
descriptionAlignment: TextAlign.center,
),
```

After:
```dart
Showcase(
titleTextAlign: TextAlign.center,
descriptionTextAlign: TextAlign.center,
),
```

## Migration guide for release 3.0.0
Removed builder widget from `ShowCaseWidget` and replaced it with builder function
Expand Down
28 changes: 14 additions & 14 deletions lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ class Showcase extends StatefulWidget {
/// Represents subject line of target widget
final String? title;

/// Title text alignment with in tooltip widget
///
/// Defaults to [TextAlign.start]
/// To understand how text is aligned, check [TextAlign]
final TextAlign titleTextAlign;

/// Represents summary description of target widget
final String? description;

Expand Down Expand Up @@ -178,12 +172,6 @@ class Showcase extends StatefulWidget {
/// Default to [BorderRadius.circular(8)]
final BorderRadius? tooltipBorderRadius;

/// Description text alignment with in tooltip widget
///
/// Defaults to [TextAlign.start]
/// To understand how text is aligned, check [TextAlign]
final TextAlign descriptionTextAlign;

/// if `disableDefaultTargetGestures` parameter is true
/// onTargetClick, onTargetDoubleTap, onTargetLongPress and
/// disposeOnTap parameter will not work
Expand Down Expand Up @@ -257,16 +245,28 @@ class Showcase extends StatefulWidget {
/// Defaults to 7.
final double toolTipSlideEndDistance;

/// Title alignment within tooltip widget
/// Title widget alignment within tooltip widget
///
/// Defaults to [Alignment.center]
final AlignmentGeometry titleAlignment;

/// Description alignment within tooltip widget
/// Title text alignment with in tooltip widget
///
/// Defaults to [TextAlign.start]
/// To understand how text is aligned, check [TextAlign]
final TextAlign titleTextAlign;

/// Description widget alignment within tooltip widget
///
/// Defaults to [Alignment.center]
final AlignmentGeometry descriptionAlignment;

/// Description text alignment with in tooltip widget
///
/// Defaults to [TextAlign.start]
/// To understand how text is aligned, check [TextAlign]
final TextAlign descriptionTextAlign;

/// Defines the margin for the tooltip.
/// Which is from 0 to [toolTipSlideEndDistance].
///
Expand Down
117 changes: 62 additions & 55 deletions lib/src/tooltip_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class ToolTipWidget extends StatefulWidget {
required this.offset,
required this.screenSize,
required this.title,
required this.titleTextAlign,
required this.description,
required this.titleTextStyle,
required this.descTextStyle,
Expand All @@ -87,6 +86,7 @@ class ToolTipWidget extends StatefulWidget {
required this.contentWidth,
required this.onTooltipTap,
required this.movingAnimationDuration,
required this.titleTextAlign,
required this.descriptionTextAlign,
required this.titleAlignment,
required this.descriptionAlignment,
Expand Down Expand Up @@ -553,69 +553,76 @@ class _ToolTipWidgetState extends State<ToolTipWidget>
),
color: widget.tooltipBackgroundColor,
child: Column(
crossAxisAlignment: widget.title != null
? CrossAxisAlignment.start
: CrossAxisAlignment.center,
children: <Widget>[
if (widget.title != null)
Padding(
padding: (widget.titlePadding ??
zeroPadding)
.add(
EdgeInsets.only(
left:
widget.tooltipPadding?.left ??
0,
right: widget
.tooltipPadding?.right ??
0,
Align(
alignment: widget.titleAlignment,
child: Padding(
padding: (widget.titlePadding ??
zeroPadding)
.add(
EdgeInsets.only(
left: widget
.tooltipPadding?.left ??
0,
right: widget.tooltipPadding
?.right ??
0,
),
),
),
child: Text(
widget.title!,
textAlign: widget.titleAlignment,
textDirection:
widget.titleTextDirection,
style: widget.titleTextStyle ??
Theme.of(context)
.textTheme
.titleLarge!
.merge(
TextStyle(
color: widget.textColor,
child: Text(
widget.title!,
textAlign: widget.titleTextAlign,
textDirection:
widget.titleTextDirection,
style: widget.titleTextStyle ??
Theme.of(context)
.textTheme
.titleLarge!
.merge(
TextStyle(
color:
widget.textColor,
),
),
),
),
),
),
if (widget.description != null)
Padding(
padding: (widget.descriptionPadding ??
zeroPadding)
.add(
EdgeInsets.only(
left:
widget.tooltipPadding?.left ??
0,
right: widget
.tooltipPadding?.right ??
0,
Align(
alignment:
widget.descriptionAlignment,
child: Padding(
padding:
(widget.descriptionPadding ??
zeroPadding)
.add(
EdgeInsets.only(
left: widget
.tooltipPadding?.left ??
0,
right: widget.tooltipPadding
?.right ??
0,
),
),
),
child: Text(
widget.description!,
textAlign:
widget.descriptionAlignment,
textDirection:
widget.descriptionTextDirection,
style: widget.descTextStyle ??
Theme.of(context)
.textTheme
.titleSmall!
.merge(
TextStyle(
color: widget.textColor,
child: Text(
widget.description!,
textAlign:
widget.descriptionTextAlign,
textDirection: widget
.descriptionTextDirection,
style: widget.descTextStyle ??
Theme.of(context)
.textTheme
.titleSmall!
.merge(
TextStyle(
color:
widget.textColor,
),
),
),
),
),
),
if (widget.tooltipActions.isNotEmpty &&
Expand Down

0 comments on commit bc9995a

Please sign in to comment.