Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.9k
[animations] Add RouteSettings to OpenContainer#116
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
3bee2634bdcca2b557d684c66abe666238dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -4,3 +4,4 @@ | ||
| # Name/Organization <email address> | ||
| Google Inc. | ||
| George Herbert <georgeherby@gmail.com> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -56,22 +56,23 @@ class OpenContainer extends StatefulWidget { | ||
| /// | ||
| /// All arguments except for [key] must not be null. The arguments | ||
| /// [closedBuilder] and [closedBuilder] are required. | ||
| const OpenContainer({ | ||
| Key key, | ||
| this.closedColor = Colors.white, | ||
| this.openColor = Colors.white, | ||
| this.closedElevation = 1.0, | ||
| this.openElevation = 4.0, | ||
| this.closedShape = const RoundedRectangleBorder( | ||
| borderRadius: BorderRadius.all(Radius.circular(4.0)), | ||
| ), | ||
| this.openShape = const RoundedRectangleBorder(), | ||
| @required this.closedBuilder, | ||
| @required this.openBuilder, | ||
| this.tappable = true, | ||
| this.transitionDuration = const Duration(milliseconds: 300), | ||
| this.transitionType = ContainerTransitionType.fade, | ||
| }) : assert(closedColor != null), | ||
| const OpenContainer( | ||
| {Key key, | ||
| this.closedColor = Colors.white, | ||
| this.openColor = Colors.white, | ||
| this.closedElevation = 1.0, | ||
| this.openElevation = 4.0, | ||
| this.closedShape = const RoundedRectangleBorder( | ||
| borderRadius: BorderRadius.all(Radius.circular(4.0)), | ||
| ), | ||
| this.openShape = const RoundedRectangleBorder(), | ||
| @required this.closedBuilder, | ||
| @required this.openBuilder, | ||
| this.tappable = true, | ||
| this.transitionDuration = const Duration(milliseconds: 300), | ||
| this.transitionType = ContainerTransitionType.fade, | ||
| this.routeSettings}) | ||
Member 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. nit: please add a | ||
| : assert(closedColor != null), | ||
| assert(openColor != null), | ||
| assert(closedElevation != null), | ||
| assert(openElevation != null), | ||
| @@ -203,6 +204,9 @@ class OpenContainer extends StatefulWidget { | ||
| /// Defaults to [ContainerTransitionType.fade]. | ||
| final ContainerTransitionType transitionType; | ||
| /// Data for the route when navigating to the open widget from [OpenContainerBuilder] | ||
| final RouteSettings routeSettings; | ||
| @override | ||
| _OpenContainerState createState() => _OpenContainerState(); | ||
| } | ||
| @@ -222,19 +226,19 @@ class _OpenContainerState extends State<OpenContainer> { | ||
| void openContainer() { | ||
| Navigator.of(context).push(_OpenContainerRoute( | ||
| closedColor: widget.closedColor, | ||
| openColor: widget.openColor, | ||
| closedElevation: widget.closedElevation, | ||
| openElevation: widget.openElevation, | ||
| closedShape: widget.closedShape, | ||
| openShape: widget.openShape, | ||
| closedBuilder: widget.closedBuilder, | ||
| openBuilder: widget.openBuilder, | ||
| hideableKey: _hideableKey, | ||
| closedBuilderKey: _closedBuilderKey, | ||
| transitionDuration: widget.transitionDuration, | ||
| transitionType: widget.transitionType, | ||
| )); | ||
| closedColor: widget.closedColor, | ||
| openColor: widget.openColor, | ||
| closedElevation: widget.closedElevation, | ||
| openElevation: widget.openElevation, | ||
| closedShape: widget.closedShape, | ||
| openShape: widget.openShape, | ||
| closedBuilder: widget.closedBuilder, | ||
| openBuilder: widget.openBuilder, | ||
| hideableKey: _hideableKey, | ||
| closedBuilderKey: _closedBuilderKey, | ||
| transitionDuration: widget.transitionDuration, | ||
| transitionType: widget.transitionType, | ||
| settings: widget.routeSettings)); | ||
Member 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. nit: please add a trailing comma after routeSettings and reformat with dartfmt. | ||
| } | ||
| @override | ||
| @@ -331,6 +335,7 @@ class _HideableState extends State<_Hideable> { | ||
| class _OpenContainerRoute extends ModalRoute<void> { | ||
| _OpenContainerRoute({ | ||
| RouteSettings settings, | ||
| @required this.closedColor, | ||
| @required this.openColor, | ||
| @required double closedElevation, | ||
| @@ -367,7 +372,8 @@ class _OpenContainerRoute extends ModalRoute<void> { | ||
| openColor: openColor, | ||
| ), | ||
| _closedOpacityTween = _getClosedOpacityTween(transitionType), | ||
| _openOpacityTween = _getOpenOpacityTween(transitionType); | ||
| _openOpacityTween = _getOpenOpacityTween(transitionType), | ||
| super(settings: settings); | ||
| static _FlippableTweenSequence<Color> _getColorTween({ | ||
| @required ContainerTransitionType transitionType, | ||
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.
nit: please end file with a new line