Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ❇️ Provide tooltip action buttons #466

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

harsh-u-simform
Copy link

Description

This PR allows us to provide the list of tooltip action button with configurations.

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have followed the Contributor Guide when preparing my PR.
  • [ ] I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

@harsh-u-simform harsh-u-simform self-assigned this Aug 2, 2024
@harsh-u-simform harsh-u-simform force-pushed the feature/tooltip_button_action_widget branch 2 times, most recently from 3507ecb to 2408212 Compare August 2, 2024 12:52
faiyaz-shaikh and others added 6 commits October 24, 2024 15:01
- Added `toolTipAction` parameter in `Showcase` which is used to get action widget configuration and defaults to `null`
- Added `DefaultToolTipActionWidget` class for default tooltip action widgets
- Added `ToolTipActionButton` class for tooltip action buttons
@Sahil-Simform Sahil-Simform force-pushed the feature/tooltip_button_action_widget branch 6 times, most recently from 34cb40f to 685adf3 Compare October 25, 2024 06:36
@@ -1,500 +0,0 @@
// !$*UTF8*$!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should not be changed.

## [4.0.0]

- Feature ✨: Added Action widget for tooltip

## [3.0.1]

- Feature [#475](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/475) - Add

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we haven't released 3.0.1 so please add a changelog of that release in 4.0.0

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@@ -221,7 +236,34 @@ class _MailPageState extends State<MailPage> {
"Tap to see profile which contains user's name, profile picture, mobile number and country",
tooltipBackgroundColor: Theme.of(context).primaryColor,
textColor: Colors.white,
onTargetClick: () {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unrelated changes from this PR.

backgroundColor: Colors.pink.shade50,
textStyle: const TextStyle(
color: Colors.pink,
)),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format the code.

@@ -26,11 +26,10 @@ import 'dart:ui';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import 'enum.dart';
import '../showcaseview.dart';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason for this import?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No particular reason for this import; it just reduces the number of other imports needed.

Removing this and adding individual file imports.

@@ -299,12 +309,14 @@ class Showcase extends StatefulWidget {
this.tooltipPosition,
this.titlePadding,
this.descriptionPadding,
this.tooltipActions,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put action and config together in constructor

: widget.tooltipActions ?? [];

final actionWidgets = <Widget>[];
for (var action = 0; action < actionData.length; action++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use for in loop

),
],
],
);
}

List<Widget> _getTooltipActions() {
final showCaseState = ShowCaseWidget.of(context);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use context check before this

),
child: TooltipActionButtonWidget(
config: actionData[action],
showCaseState: ShowCaseWidget.of(context),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to pass this state? We can access it directly from the widget.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToolTip is not a child of the ShowCaseWidget, so we won't get the showCaseState directly in the tooltip action using the context. Therefore, we passed that as an argument.

image

@Sahil-Simform Sahil-Simform force-pushed the feature/tooltip_button_action_widget branch 5 times, most recently from 8434d67 to 3e9f6de Compare October 25, 2024 12:41
@Sahil-Simform Sahil-Simform force-pushed the feature/tooltip_button_action_widget branch from 3e9f6de to f2180b7 Compare October 25, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants