-
Notifications
You must be signed in to change notification settings - Fork 455
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: ✨Add staticContainer into ToolTipWidget for a custom tooltip th… #396
base: master
Are you sure you want to change the base?
feat: ✨Add staticContainer into ToolTipWidget for a custom tooltip th… #396
Conversation
I need to integrate a skip button and I don't want to rely on custom buttons for now if this is going to be implemented. This was opened 7 months ago. Any plan to merge this soon? |
@aditya-css any update? |
Is it possible to add it for the Showcase() constructor too ? (when container is null) |
any update on this PR? |
8a55dac
to
f2d362e
Compare
716860e
to
e612eb9
Compare
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 also consider providing an option to disable the global floating action widget for particular showcase.
README.md
Outdated
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 update for globalFloatingActionWidget as well.
example/lib/main.dart
Outdated
child: ElevatedButton( | ||
style: ButtonStyle( | ||
backgroundColor: MaterialStateProperty.all<Color>( | ||
Theme.of(context).primaryColor), | ||
shape: MaterialStateProperty.all< | ||
RoundedRectangleBorder>( | ||
RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(18.0), | ||
side: BorderSide( | ||
color: Theme.of(context).primaryColor, | ||
width: 2.0, | ||
), | ||
), | ||
), | ||
), |
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 keep this minimal.
double? left; | ||
double? right; |
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 have default values.
bff83f1
to
1e054f1
Compare
lib/src/showcase.dart
Outdated
@@ -777,6 +785,8 @@ class _ShowcaseState extends State<Showcase> { | |||
titleTextStyle: widget.titleTextStyle, | |||
descTextStyle: widget.descTextStyle, | |||
container: widget.container, | |||
floatingActionWidget: widget.floatingActionWidget ?? | |||
showCaseWidgetState.globalFloatingActionWidget?.call(context), |
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 take this as late class member as to avoid calling this function over and over again.
/// Hides [globalFloatingActionWidget] for the provided showcase widgets. Add key of | ||
/// showcase in which [globalFloatingActionWidget] should be hidden this list. | ||
/// Defaults to []. | ||
final List<GlobalKey> hideFloatingActionWidgetForShowcase; |
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.
This should rather be a function as to make it more dynamic.
lib/src/showcase_widget.dart
Outdated
/// Return a [widget.globalFloatingActionWidget] if not need to hide this for | ||
/// current showcase | ||
FloatingActionWidget Function(BuildContext)? get globalFloatingActionWidget => | ||
widget.hideFloatingActionWidgetForShowcase.contains(ids![activeWidgetId!]) |
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 avoid force null checks.
lib/src/tooltip_widget.dart
Outdated
@@ -651,8 +654,22 @@ class _ToolTipWidgetState extends State<ToolTipWidget> | |||
), | |||
), | |||
); | |||
|
|||
if (widget.floatingActionWidget != 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.
Please prefer positive condition.
lib/src/showcase_widget.dart
Outdated
@@ -187,6 +202,13 @@ class ShowCaseWidgetState extends State<ShowCaseWidget> { | |||
/// Returns value of [ShowCaseWidget.blurValue] | |||
double get blurValue => widget.blurValue; | |||
|
|||
/// Return a [widget.globalFloatingActionWidget] if not need to hide this for | |||
/// current showcase | |||
FloatingActionWidget Function(BuildContext)? get globalFloatingActionWidget => |
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 use typedef.
1e054f1
to
e0a2d12
Compare
…at can be placed anywhere on screen and is not affected by the animation Signed-off-by: Michael Angelo Cadavillo <[email protected]>
…oatingAction Widget for the default showcase widget
e0a2d12
to
7dfee8b
Compare
example/lib/main.dart
Outdated
child: Padding( | ||
padding: const EdgeInsets.all(16.0), | ||
child: ElevatedButton( | ||
onPressed: () => ShowCaseWidget.of(showcaseContext).dismiss(), |
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 tear-off
d85829f
to
5db4ffd
Compare
5db4ffd
to
0ea94f5
Compare
lib/src/showcase_widget.dart
Outdated
/// This Stores keys of showcase for which we will hide the | ||
/// [globalFloatingActionWidget]. | ||
late var _hideFloatingWidgetKeys = { | ||
for (var item in widget.hideFloatingActionWidgetForShowcase) item: true |
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 make this final.
lib/src/showcase_widget.dart
Outdated
@@ -184,9 +203,37 @@ class ShowCaseWidgetState extends State<ShowCaseWidget> { | |||
|
|||
bool get isShowCaseCompleted => ids == null && activeWidgetId == null; | |||
|
|||
List<GlobalKey> get hideFloatingActionWidgetForShowcase => |
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 rename this as to make it differ from the function.
lib/src/showcase_widget.dart
Outdated
void hideFloatingActionWidgetForKeys( | ||
List<GlobalKey> updatedList, | ||
) { | ||
_hideFloatingWidgetKeys = {for (var item in updatedList) item: true}; |
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 make this final.
0ea94f5
to
da37b4e
Compare
da37b4e
to
b55f5cf
Compare
feat: ✨Provided a parameter to add a static widget which can be placed anywhere on the screen and is not affected by the animation.
Description
Implemented a
FloatingActionWidget
to show static widget at any place on the screen. Primarily used for when we want to show another widget (perhaps a 'Skip Showcases' button) which is not affected by the animation that is given to the tooltip.We have also added a directional constructor for the use cases where directionality is important.
Checklist
fix:
,feat:
,docs:
etc).docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?
Related Issues
Closes #395
Sample implementation
Screen_recording_20241203_180104.webm