Visitar URL original
[animations] update fade_scale_transition.dart by cuong1112035 · Pull Request #158 · flutter/packages · GitHub
Skip to content
Closed
Changes from 1 commit
Commits
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
add const satisfy the analyze tool
  • Loading branch information
cuong1112035 committed May 16, 2020
commit 9a1dc50afd18eeb3f885d552c1e5ecf827f3f4dd
2 changes: 1 addition & 1 deletion packages/animations/example/lib/fade_scale_transition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class _FadeScaleTransitionDemoState extends State<FadeScaleTransitionDemo>
onPressed: () {
showModal<void>(
context: context,
configuration: FadeScaleTransitionConfiguration(),
configuration: const FadeScaleTransitionConfiguration(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this necessary? I think showModal currently defaults to FadeScaleTransitionConfiguration.

@cuong1112035 cuong1112035 May 27, 2020 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I did copy the code from the example then past it into my project to see how it work. But without the configuration object, my code could not run and threw me an error.
I'm using flutter v1.17.1 and after jumping into showModal function, I could not find out the configuration object so that I decided to send a PR to help
Code in showModal function from my side

Future<T> showModal<T>({
  @required BuildContext context,
  @required ModalConfiguration configuration,
  bool useRootNavigator = true,
  WidgetBuilder builder,
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you test this with the master branch for flutter/packages/? The update has not been pushed onto pub yet AFAIK

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, this code change only updates the example app and does not make any changes to the code in the source code for showModal

builder: (BuildContext context) {
return _ExampleAlertDialog();
},
Expand Down