-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[animations] Set FadeScaleTransitionConfiguration to configuration default value #136
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
Changes from 3 commits
bb3a9fb
4c9f4d2
b158029
0bd1dcf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,8 @@ | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| import 'package:flutter/material.dart'; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| import 'fade_scale_transition.dart'; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| /// Signature for a function that creates a widget that builds a | ||||||||||||||||||||||||
| /// transition. | ||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||
|
|
@@ -27,6 +29,7 @@ typedef _ModalTransitionBuilder = Widget Function( | |||||||||||||||||||||||
| /// modal route that will be displayed, such as the enter and exit | ||||||||||||||||||||||||
| /// transitions, the duration of the transitions, and modal barrier | ||||||||||||||||||||||||
| /// properties. | ||||||||||||||||||||||||
| /// By default, `configuration` is [FadeScaleTransitionConfiguration]. | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| /// A configuration object containing the properties needed to implement a | |
| /// modal route. | |
| /// | |
| /// The `barrierDismissible` argument is used to determine whether this route | |
| /// can be dismissed by tapping the modal barrier. This argument defaults | |
| /// to true. If `barrierDismissible` is true, a non-null `barrierLabel` must be | |
| /// provided. | |
| /// | |
| /// The `barrierLabel` argument is the semantic label used for a dismissible | |
| /// barrier. This argument defaults to "Dismiss". | |
| abstract class ModalConfiguration { |
Could you suggest the change by using multi-line code suggestions?
mono0926 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify in the API documentation for showModal that FadeScaleTransitionConfiguration will be used by default if it not specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add new tests to packages/animations/test/modal.dart ensuring that configuration is FadeScaleTransitionConfiguration by default.
What I would do is call showModal without specifying a configuration, but making sure that the animations forwards and reverse are the ones for FadeScaleTransitionConfiguration. Another thing that would be good to test here is that the barrier properties for FadeScaleTransitionConfiguration are used as well.
You can use some of the existing tests in that test file and the tests from packages/animations/test/fade_scale_transition_test.dart to guide you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've added the tests: b158029

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just leave this here, but it's up to you if this becomes the default behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think the sample code should be simple, so omitting default value is better 🤔