Skip to content

Commit

Permalink
Merge pull request #1 from Agriaku/dev/content-y-offset
Browse files Browse the repository at this point in the history
Dev/content y offset
  • Loading branch information
syaiful-aa authored Sep 25, 2023
2 parents ba344d1 + b839771 commit ae9521d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/src/target/target_focus.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class TargetFocus {
this.focusAnimationDuration,
this.unFocusAnimationDuration,
this.pulseVariation,
this.yOffset = 0,
}) : assert(keyTarget != null || targetPosition != null);

final dynamic identify;
Expand All @@ -37,6 +38,7 @@ class TargetFocus {
final Duration? focusAnimationDuration;
final Duration? unFocusAnimationDuration;
final Tween<double>? pulseVariation;
final double yOffset;

@override
String toString() {
Expand Down
5 changes: 3 additions & 2 deletions lib/src/widgets/tutorial_coach_mark_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,15 @@ class TutorialCoachMarkWidgetState extends State<TutorialCoachMarkWidget>
double? bottom;
double? left;
double? right;
final double yOffset = currentTarget?.yOffset ?? 0;

children = currentTarget!.contents!.map<Widget>((i) {
switch (i.align) {
case ContentAlign.bottom:
{
weight = MediaQuery.of(context).size.width;
left = 0;
top = positioned.dy + haloHeight;
top = positioned.dy + haloHeight + yOffset;
bottom = null;
}
break;
Expand All @@ -188,7 +189,7 @@ class TutorialCoachMarkWidgetState extends State<TutorialCoachMarkWidget>
left = 0;
top = null;
bottom = haloHeight +
(MediaQuery.of(context).size.height - positioned.dy);
(MediaQuery.of(context).size.height - positioned.dy - yOffset);
}
break;
case ContentAlign.left:
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: tutorial_coach_mark
description: Guide that helps you to present your app and its features in a beautiful, simple and customizable way. Tutorial | Guide | Coach.
version: 1.2.9
version: 1.3.0
homepage: https://github.com/RafaelBarbosatec/tutorial_coach_mark

environment:
Expand Down

0 comments on commit ae9521d

Please sign in to comment.