-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[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]. | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We usually specify the default at the end of the API doc. Could you shift this to be the last line? Thank you! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the review again 🙏 But, I don't understand what change is desired 🤔 I think current packages/packages/animations/lib/src/modal.dart Lines 157 to 167 in f5411da
Could you suggest the change by using multi-line code suggestions?
mono0926 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||
/// | ||||||||||||||||||||||||
/// The `useRootNavigator` argument is used to determine whether to push the | ||||||||||||||||||||||||
/// modal to the [Navigator] furthest from or nearest to the given `context`. | ||||||||||||||||||||||||
|
@@ -45,7 +48,7 @@ typedef _ModalTransitionBuilder = Widget Function( | |||||||||||||||||||||||
/// the modal's characteristics. | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Specify in the API documentation for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to add new tests to What I would do is call You can use some of the existing tests in that test file and the tests from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I've added the tests: b158029 |
||||||||||||||||||||||||
Future<T> showModal<T>({ | ||||||||||||||||||||||||
@required BuildContext context, | ||||||||||||||||||||||||
@required ModalConfiguration configuration, | ||||||||||||||||||||||||
ModalConfiguration configuration = const FadeScaleTransitionConfiguration(), | ||||||||||||||||||||||||
bool useRootNavigator = true, | ||||||||||||||||||||||||
WidgetBuilder builder, | ||||||||||||||||||||||||
}) { | ||||||||||||||||||||||||
|
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 🤔