| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import '../animation/animation.dart'; | 5 import '../animation/animation.dart'; |
| 6 import '../animation/curves.dart'; | 6 import '../animation/curves.dart'; |
| 7 import '../fn.dart'; | 7 import '../fn.dart'; |
| 8 import '../theme/colors.dart'; | 8 import '../theme/colors.dart'; |
| 9 import '../theme/shadows.dart'; | 9 import '../theme/shadows.dart'; |
| 10 import 'dart:async'; | 10 import 'dart:async'; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 Node build() { | 143 Node build() { |
| 144 _ensureListening(); | 144 _ensureListening(); |
| 145 | 145 |
| 146 bool isClosed = _position <= -_kWidth; | 146 bool isClosed = _position <= -_kWidth; |
| 147 String inlineStyle = 'display: ${isClosed ? 'none' : ''}'; | 147 String inlineStyle = 'display: ${isClosed ? 'none' : ''}'; |
| 148 String maskInlineStyle = 'opacity: ${(_position / _kWidth + 1) * 0.25}'; | 148 String maskInlineStyle = 'opacity: ${(_position / _kWidth + 1) * 0.25}'; |
| 149 String contentInlineStyle = 'transform: translateX(${_position}px)'; | 149 String contentInlineStyle = 'transform: translateX(${_position}px)'; |
| 150 | 150 |
| 151 Container mask = new Container( | 151 Container mask = new Container( |
| 152 key: 'Mask', | 152 key: 'Mask', |
| 153 styles: [_maskStyle], | 153 style: _maskStyle, |
| 154 inlineStyle: maskInlineStyle | 154 inlineStyle: maskInlineStyle |
| 155 )..events.listen('gesturetap', animation.handleMaskTap) | 155 )..events.listen('gesturetap', animation.handleMaskTap) |
| 156 ..events.listen('gestureflingstart', animation.handleFlingStart); | 156 ..events.listen('gestureflingstart', animation.handleFlingStart); |
| 157 | 157 |
| 158 Material content = new Material( | 158 Material content = new Material( |
| 159 key: 'Content', | 159 key: 'Content', |
| 160 styles: [_contentStyle], | 160 style: _contentStyle, |
| 161 inlineStyle: contentInlineStyle, | 161 inlineStyle: contentInlineStyle, |
| 162 children: children, | 162 children: children, |
| 163 level: level | 163 level: level |
| 164 ); | 164 ); |
| 165 | 165 |
| 166 return new Container( | 166 return new Container( |
| 167 styles: [_style], | 167 style: _style, |
| 168 inlineStyle: inlineStyle, | 168 inlineStyle: inlineStyle, |
| 169 children: [ mask, content ] | 169 children: [ mask, content ] |
| 170 ); | 170 ); |
| 171 } | 171 } |
| 172 } | 172 } |
| OLD | NEW |