-
Notifications
You must be signed in to change notification settings - Fork 447
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: ✨ Tooltip action widget #358
base: master
Are you sure you want to change the base?
Conversation
lib/src/tooltip_action.dart
Outdated
alignment: WrapAlignment.spaceBetween, | ||
crossAxisAlignment: WrapCrossAlignment.center, | ||
children: [ | ||
getActionWidget(actionOne), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we pass List<ActionWidgetConfig>
here? I guess the user gets more feasibility to add more than two actions.
eee3129
to
15896f6
Compare
76bab00
to
a7c83ff
Compare
cf90e13
to
6fa0643
Compare
6fa0643
to
92c089b
Compare
lib/src/tooltip_action.dart
Outdated
} | ||
|
||
Widget getActionWidget(ActionWidgetConfig? actionWidgetConfig) { | ||
if (actionWidgetConfig == null) return const SizedBox(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use SizedBox.shrink() and can you please check if we turn on flutter inspector it doesn't make whole screen grey when actionWidgetConfig is null.
lib/src/tooltip_action.dart
Outdated
child: Wrap( | ||
alignment: alignment, | ||
crossAxisAlignment: crossAxisAlignment, | ||
children: actions != null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also check if actions
is empty or not
lib/src/tooltip_action.dart
Outdated
|
||
const ToolTipAction.customAction({ | ||
Key? key, | ||
this.actions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for custom actions this should be a required
field
lib/src/tooltip_action.dart
Outdated
this.padding, | ||
this.margin, | ||
this.textStyle, | ||
required this.onActionTap, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required fields should be at top
lib/src/tooltip_widget.dart
Outdated
} | ||
|
||
// ignore: unused_element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not using this function why not remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have started using this function so no need to remove it.
lib/src/tooltip_widget.dart
Outdated
), | ||
], | ||
), | ||
SizedBox(child: widget.toolTipAction), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we add this without a SizedBox
lib/src/showcase.dart
Outdated
@@ -232,6 +234,9 @@ class Showcase extends StatefulWidget { | |||
/// Provides padding around the description. Default padding is zero. | |||
final EdgeInsets? descriptionPadding; | |||
|
|||
/// Provides tooltip action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please describe more on what this field does.
lib/src/tooltip_action.dart
Outdated
), | ||
), | ||
getActionWidget( | ||
actionTwo ?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if user doesn't want to provide 2nd action. I think Instead of making user to pass a sizedbox, we should only show this if they have provided the config.
84a5883
to
f4a88fb
Compare
- 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
f4a88fb
to
001c0b2
Compare
I hope we can land this PR soon? It's been open for too long |
Description
✨ Added Tooltip action widget
Checklist
fix:
,feat:
,docs:
etc).docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?
Related Issues