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

migrate to null-safety #23

Merged
merged 2 commits into from
Jan 21, 2021
Merged

Conversation

bierbaumtim
Copy link
Contributor

fixes #22

Copy link
Owner

@FilledStacks FilledStacks left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Just one thing that I'd like changed back and that's using the normal UI builder as the default builder instead of the small UI builder.

@required this.normal,
this.small,
this.normal,
required this.small,
Copy link
Owner

Choose a reason for hiding this comment

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

Please make normal required and not small. the normal view is what you want to show if there's no UI defined.

// If none of the layouts above are supplied or we're on the normal size layout then we show the normal layout
return normal(context);
// If none of the layouts above are supplied or we're on the small size layout then we show the small layout
return small(context);
Copy link
Owner

Choose a reason for hiding this comment

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

Change back to using the normal function when there's nothing defined.

@bierbaumtim
Copy link
Contributor Author

The problem is that if normal is required, the small function never gets used, because the normal function can't be null. So this will make the small function useless.
To solve the problem we should introduce a RefinedSize.small. With this we can check if the size is RefinedSize.small and than use the small one.

@FilledStacks
Copy link
Owner

You're right. Then we can instead update the case before the final return to check for small and then return the small() in there. Then we can leave the default if nothing is defined to return normal()

* add RefinedSize.small
* add more tests for RefinedSize
* use normal WidgetBuilder as default in RefinedLayoutBuilder
Copy link
Owner

@FilledStacks FilledStacks left a comment

Choose a reason for hiding this comment

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

Great!

@FilledStacks FilledStacks merged commit 21b3642 into FilledStacks:master Jan 21, 2021
@FilledStacks
Copy link
Owner

@bierbaumtim Thanks a lot for the help! I've published it.

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.

Support for null-safety
2 participants