Giter Club home page Giter Club logo

bubbleshowcase's Introduction

bubbleshowcase's People

Contributors

arielserafini avatar rodineijf avatar skyost avatar termtime avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bubbleshowcase's Issues

Adding passthrough Mode for AbsoluteBubbleSlide

Adding passthrough mode for the Absolute Bubble Slide will allow us to force the user to interact with a specific position and will not dismiss the showcase when pressing anywhere on the screen.

Highlight zone is up of widget

Screenshot_1600248320
Describe the bug
A clear and concise description of what the bug is.

Although I put the padding to slide bubbleShowcase, the highlight zone always is up from widget that I've vinculad with global key!!

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.
This is an code to RelativeBubbleSlide

As you can see the padding here:

RelativeBubbleSlide(

  widgetKey: key,
  child: RelativeBubbleSlideChild(
    widget: Padding(
      padding: EdgeInsets.only(top: 8.0),
      child: SpeechBubble(
        nipLocation: NipLocation.TOP,
        color: kColorCaption,
        child: Padding(
          padding: EdgeInsets.all(10),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisSize: MainAxisSize.min,
            children: [...]),),)

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Add a callback when a slide finished

Maybe i am missing something from the docs. But to me it seems like such a feature does not exist at the moment.
I basically would like to have a callback when one BubbleSlide was clicked on. So that a certain action, like changing the route, can be executed.

My Idea would be to add something like:

AbsoluteBubbleSlide(
   ...
   onFinished: () {}
   child: 
   ...
)

Child widget to display above highlight

Is your feature request related to a problem? Please describe.
I'm unable to get the child of a RelativeBubbleSlideChild to sit above the highlighted area.
Describe the solution you'd like
I would like a way to get the child of a RelativeBubbleSlideChild to sit on top of the highlighted area. When I set the direction: AxisDirection.up it just writes the letters underneath each other.

Describe alternatives you've considered
I tried the AbsoluteBubbleSlideChild but it becomes messy to get the positions of the different widgets that I'm trying to highlight. The NipLocation doesn't seem to dictate there the child is positioned relative to the highlighted widget either

Additional context
Screen Shot 2020-08-27 at 6 35 47 pm

BubbleShowcase doesn't work well with FittedBox

Describe the bug
When I use BubbleShowcase with a RelaitveBubbleSlide with a key that identifies a widget inside a FittedBox, the shape is not displayed in correct size. It looks like the FittedBox's resizing is not taken into consideration.

To Reproduce
Steps to reproduce the behavior:

  1. Use something like this in your app:
  BubbleShowcase(...,
      bubbleSlides: [RelativeBubbleSlide(
              widgetKey: _resizedWidgetKey,
              shape: Oval(),
              child: MyRelativeBubbleSlideChild(...)
          )],
      child: ...(FittedBox(child: ...(Text('Hello', key: _resizedWidgetKey))))

  1. Run the app and let the slides show.
  2. See that the oval shape displays wrongly sized (and the slide child is wrongly positioned).

Expected behavior
The FittedBox should affect the size of the slide shape.

For myself, I have fixed this by creating a subclass of RelativeBubbleSlide that converts not only the top left corner from local to global coordinates, but the bottom right as well. The code looks like this:

  Position getHighlightPosition(BuildContext context, BubbleShowcase bubbleShowcase, int currentSlideIndex) {
    RenderBox renderBox = widgetKey.currentContext.findRenderObject() as RenderBox;
    Offset offset = renderBox.localToGlobal(Offset.zero);
    Offset bottomRight = renderBox.localToGlobal(renderBox.size.bottomRight(Offset.zero)); // convert the bottom right corner from local to global coordinates

    return Position(
      top: offset.dy,
      right: bottomRight.dx, // instead of adding the local size to the global offset use the global coordinates of bottom right corner
      bottom: bottomRight.dy, // instead of adding the local size to the global offset use the global coordinates of bottom right corner
      left: offset.dx,
    );
  }

Error remove called on null

i got this error when navigating multiple times

flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following NoSuchMethodError was thrown while finalizing the widget tree:
flutter: The method 'remove' was called on null.
flutter: Receiver: null
flutter: Tried calling: remove()
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
flutter: #1      _BubbleShowcaseState.dispose (package:bubble_showcase/src/showcase.dart:88:24)
flutter: #2      StatefulElement.unmount (package:flutter/src/widgets/framework.dart:4435:12)
flutter: #3      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1748:13)
flutter: #4      _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #5      ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4272:14)
flutter: #6      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #7      _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #8      MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:5534:16)
flutter: #9      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #10     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #11     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4272:14)
flutter: #12     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #13     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #14     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:5433:14)
flutter: #15     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #16     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #17     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4272:14)
flutter: #18     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #19     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #20     MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:5534:16)
flutter: #21     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #22     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #23     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4272:14)
flutter: #24     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #25     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #26     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:5433:14)
flutter: #27     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #28     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #29     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:5433:14)
flutter: #30     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #31     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #32     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:5433:14)
flutter: #33     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #34     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #35     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:5433:14)
flutter: #36     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #37     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #38     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4272:14)
flutter: #39     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #40     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #41     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:5433:14)
flutter: #42     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #43     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #44     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4272:14)
flutter: #45     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #46     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #47     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:5433:14)
flutter: #48     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #49     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #50     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4272:14)
flutter: #51     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #52     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #53     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4272:14)
flutter: #54     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #55     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #56     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:5433:14)
flutter: #57     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #58     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #59     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4272:14)
flutter: #60     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)
flutter: #61     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:1746:7)
flutter: #62     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4272:14)
flutter: #63     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1744:13)

RangeError when setting doNotReopenOnClose to true

Describe the bug
I set up a few bubbles and showcases, and when I (later on) set doNotReopenOnClose to true, I get the following error:
RangeError (index): Invalid value: Not in range 0..1, inclusive: -1
This is at:
_BubbleShowcaseState._createCurrentSlideEntry. (package:bubble_showcase/src/showcase.dart:129:50)

To Reproduce

  1. Create some bubbles and showcases
  2. Enable doNotReopenOnClose

Expected behavior
No exception.

Smartphone (please complete the following information):
Nexus 5X API R Emulator on MacOS

Have the SpeechBubble display above the highlighted area

Is your feature request related to a problem? Please describe.
I need the Bubble to be displayed above the widget I want to highlight. Changing the direction property in the RelativeBubbleSlideChild should place it above right? :S But it does not. Otherwise, I simply used the code from the example.

Describe the solution you'd like
A way to put the SpeechBubble above the widget.

Describe alternatives you've considered
Using another plugin, but that one has other issues...

Additional context
Add any other context or screenshots about the feature request here.

const BubbleShowcaseNotification()..dispatch(context) is not continuing flow

Describe the bug
The function const BubbleShowcaseNotification()..dispatch(context); is not progressing the showcase

To Reproduce
Steps to reproduce the behavior:

  1. Set RelativeBubbleSlide with PassthroughMode.INSIDE_WITH_NOTIFICATION,
  2. Use const BubbleShowcaseNotification()..dispatch(context); to progress showcase

Screenshots
image

Defining the showcase slide:
image

Within the build function:
image

Additional context
Typical scenario is to progress the showcase using a custom button inside the showcase bubble like so:
image

** UPDATE **
I was able to get this to work by fetching the context directly from the RelativeBubbleSlide widgetKey. In this case (from the example above) _first.currentContext. Therefore using const BubbleShowcaseNotification()..dispatch(_first.currentContext); works to progress showcase

BubbleShowcase cannot exceed highlighted widget's dimensions

Describe the bug
If you set a RelativeBubbleSlide to be on a horizontal axis (AxisDirection.right or AxisDirection.left) the BubbleShowcase widget will at maximum be of the height of the widget and cannot exceed it.
If you set it to a vertical axis (AxisDirection.up or AxisDirection.down) the same happens but with the width of the RelativeBubbleSlide.

To Reproduce
Steps to reproduce the behavior:

  1. In a Scaffold, create a small widget, for example an IconButton
  2. Add a RelativeBubbleSlide that focuses on the key of the IconButton, the structure of the BubbleSlides follows the structure of the BubbleSlide _firstSlide in the example.dart file of this package.
  3. Set the RelativeBubbleSlide direction to be a horizontal axis.
  4. See how the container overflows from the text not being able to fit in the small height of the IconButton
  5. Set the RelativeBubbleSlide direction to be a vertical axis.
  6. See how the container overflows vertically from the text not being able to fit in the small width of the IconButton

Expected behavior
You should be able to go beyond the width/height of the widget you are highlighting.

Screenshots
image
image

Smartphone (please complete the following information):

  • Device: Pixel 2
  • OS: Android API 29
  • Flutter version: 2.2.3
  • bubble_showcase version: ^1.0.0

Allow async callback function in bubbleSlides Array

Is your feature request related to a problem? Please describe.
Some of the widgets I need to be scrolled to first, before highlighting them.

Describe the solution you'd like
Inside the bubbleSlides array, allow for void and async returns. Something like

bubbleSlides: [
      BubbleSlide(key1),
      () async {
            await Scrollable.ensureVisible(key2.currentContext);
      }(),
      BubbleSlide2(key2),
],

Describe alternatives you've considered
Other Packages allow for this feature but don't provide enough flexibility with regards to where to place the explanation text for the highlighted widget.

Additional context
Add any other context or screenshots about the feature request here.

Method to start projection

Is your feature request related to a problem? Please describe.
Issue occurs when you have a few pages in PageView.
You add BubbleShowcase to the third page.
So if you open this widget with PageView you are actually on the first page.

Go to the third page, BubbleShowcase started before the end of the animation (animations when you move from first to third page)

So, it does not properly highlight widgets (it highlights widget out of the screen and so on)

Describe the solution you'd like
We should have a possibility to start animations manually. Like in showcaseview.

WidgetsBinding.instance.addPostFrameCallback((_) =>
        ShowCaseWidget.startShowCase(context, [_one, _two, _three]));

Describe alternatives you've considered
The default behaviour of starting BubbleShowcase projections should wait until the UI build is completely finished.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.