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

Portal refactor & Anchor implementation #1

Closed
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
20e8efe
docs: updated version in `README.md` (#31)
nilsreichardt Jun 5, 2021
f1a9152
Clean up project setup
creativecreatorormaybenot Oct 24, 2021
862420b
Fix warnings
creativecreatorormaybenot Oct 24, 2021
88eec62
Adjust example to expect high-level result with backup logic
creativecreatorormaybenot Oct 24, 2021
93435cb
Fix tests
creativecreatorormaybenot Oct 24, 2021
ae63d22
Add failing tests for TDD
creativecreatorormaybenot Oct 24, 2021
2dc2248
Fix warnings
creativecreatorormaybenot Oct 24, 2021
0ea781c
Improve Anchor docs for better understanding
creativecreatorormaybenot Oct 24, 2021
2f6a6ff
Implement root bounds
creativecreatorormaybenot Oct 24, 2021
c3fac4b
Finalize custom follower implementation
creativecreatorormaybenot Oct 24, 2021
b629834
Implement custom FollowerLayer
creativecreatorormaybenot Oct 24, 2021
5c7833a
Revert from debug example
creativecreatorormaybenot Oct 24, 2021
ab6079b
Make tests pass
creativecreatorormaybenot Oct 25, 2021
da7a6dc
Declare the main concepts
creativecreatorormaybenot Jan 28, 2022
05f4406
Document all concepts
creativecreatorormaybenot Jan 28, 2022
69d56ae
try to fix #42
fzyzcjy Feb 1, 2022
51fc9dd
Apply new namings
creativecreatorormaybenot Feb 7, 2022
3b5facb
Further enforce naming
creativecreatorormaybenot Feb 7, 2022
1c318c4
Introduce `PortalFollower`
creativecreatorormaybenot Feb 7, 2022
b88c21b
Add todo for target docs
creativecreatorormaybenot Feb 7, 2022
ec457c5
Clean up docs
creativecreatorormaybenot Feb 7, 2022
9612bb2
Make tests pass
creativecreatorormaybenot Feb 7, 2022
71d286e
Add rounded corners example
creativecreatorormaybenot Feb 7, 2022
954a808
Setup popup
creativecreatorormaybenot Feb 7, 2022
ab00951
Adapt example for use case
creativecreatorormaybenot Feb 7, 2022
20a33ec
Clip rect
creativecreatorormaybenot Feb 7, 2022
1db3ac5
Add examples
creativecreatorormaybenot Feb 13, 2022
3298639
Add ExpandedAligned
creativecreatorormaybenot Feb 13, 2022
0858850
Make tests pass
creativecreatorormaybenot Feb 13, 2022
d7a62ea
Refactor alignedTo
creativecreatorormaybenot Feb 13, 2022
8953b14
Revert `ExpandedAligned`
creativecreatorormaybenot Feb 13, 2022
b2b298d
Add todo
creativecreatorormaybenot Feb 13, 2022
73ded7b
follow flutter linter and fix warnings or hints
fzyzcjy Feb 21, 2022
ac02415
remove `top_level_function_literal_block` since flutter linter says `…
fzyzcjy Feb 21, 2022
81614d4
remove `authors` since flutter linter says `warning: The 'authors' fi…
fzyzcjy Feb 21, 2022
af4ba40
Merge branch 'master' into portal-anchor-refactor
creativecreatorormaybenot Feb 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make tests pass
  • Loading branch information
creativecreatorormaybenot committed Oct 25, 2021
commit ab6079b723868f5b1de8e1c0b9fbd9e0d6e431f3
17 changes: 16 additions & 1 deletion lib/src/anchor.dart
Original file line number Diff line number Diff line change
@@ -203,5 +203,20 @@ extension _RectAnchorExt on Rect {
/// If the [rect] has any part that lies outside of this parent
/// false will be returned
bool fullyContains(Rect rect) =>
contains(rect.topLeft) && contains(rect.bottomRight);
containsIncludingBottomAndRightEdge(rect.topLeft) &&
containsIncludingBottomAndRightEdge(rect.bottomRight);

/// Whether the point specified by the given offset (which is assumed to be
/// relative to the origin) lies between the left and right and the top and
/// bottom edges of this rectangle.
///
/// This is like [contains] but also includes the bottom edge and the right
/// edge because in the context of painting, it would make no sense to
/// consider a rect as overflowing when it lines up exactly with another rect.
bool containsIncludingBottomAndRightEdge(Offset offset) {
return offset.dx >= left &&
offset.dx <= right &&
offset.dy >= top &&
offset.dy <= bottom;
}
}
8 changes: 3 additions & 5 deletions test/anchor_test.dart
Original file line number Diff line number Diff line change
@@ -96,11 +96,9 @@ void main() {
width: 20,
height: 20,
),
child: const Center(
child: SizedBox(
width: 10,
height: 10,
),
child: const SizedBox(
width: 10,
height: 10,
),
);