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

[visibility_detector] add custom visible bounds #523

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

Conversation

lllttt06
Copy link

Description

Problem

Even though Stack or something is used and visibility_detector is covered with other widgets, VisibilityInfo.visibleFraction doesn't consider this situation.

Not only Stack, but something like ↓, visibility_detector doesn't consider BottomNavigationBar and AppBar.

Scaffold(
      appBar: // AppBar,
      extendBody: true,
      body: VisibilityDetector(),
      bottomNavigationBar: // BottomNavigationBar    
);

Solution

Added customVisibleBounds which is visibility_detector's detection area.

Related Issues

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I signed the CLA.
  • All tests from running flutter test pass.
  • flutter analyze does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

@jamesderlin
Copy link
Collaborator

Hi, sorry I didn't notice this earlier. If you still want to merge this, you should:

  1. Add some unit tests.
  2. Add more documentation about what customVisibleBounds is and how it's supposed to be used? (For example, it'd be helpful to explain that it can specify a smaller area for the VisibilityDetector when some other rectangular widget overlaps it.) What coordinate system is it in?

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.

2 participants