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

Implemented various improvements #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ahmednfwela
Copy link

  1. Added a builder instead of child
  2. Separated preview widget from the full screen widget

@japborst
Copy link

I like that the builders are separated 👍 Would directly solve my current issue.

final Color backgroundColor;
final bool backgroundIsTransparent;
final DisposeLevel disposeLevel;

const FullScreenWidget({
Key key,
this.builderWithChild,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not do either/or? So either provide a child or a builder, this is more in line with the usage of builders in the rest of Flutter.

Then assert that only one is provided, before the super

: assert(child = null | builder = null), super(key: key)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can split the constructor into 3 factories, one with builder, another with child and another with both child and builder
what do you think about that ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think that makes it much better. Point was that it'd be weird to have multiple builders that can be defined at the same time, without any errors, though it will actually choose one.

@@ -120,7 +135,7 @@ class _FullScreenPageState extends State<FullScreenPage> {
}
}

_endVerticalDrag(DragEndDetails details) {
void _endVerticalDrag(DragEndDetails details) {
if (positionYDelta > disposeLimit || positionYDelta < -disposeLimit) {
Navigator.of(context).pop();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if we were to be able to access this context through the builder somehow. Especially for the non-preview version.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the non-preview version is in a different route, thus a different context.
What exactly do you want to access with the preview context?

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