| 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 'basic.dart'; | 5 import 'package:sky/widgets/basic.dart'; |
| 6 import 'widget.dart'; | 6 import 'package:sky/widgets/widget.dart'; |
| 7 | 7 |
| 8 class ModalOverlay extends Component { | 8 class ModalOverlay extends Component { |
| 9 | 9 |
| 10 ModalOverlay({ String key, this.children, this.onDismiss }) : super(key: key); | 10 ModalOverlay({ String key, this.children, this.onDismiss }) : super(key: key); |
| 11 | 11 |
| 12 final List<Widget> children; | 12 final List<Widget> children; |
| 13 final Function onDismiss; | 13 final Function onDismiss; |
| 14 | 14 |
| 15 Widget build() { | 15 Widget build() { |
| 16 return new Listener( | 16 return new Listener( |
| 17 onGestureTap: (_) { | 17 onGestureTap: (_) { |
| 18 if (onDismiss != null) | 18 if (onDismiss != null) |
| 19 onDismiss(); | 19 onDismiss(); |
| 20 }, | 20 }, |
| 21 child: new Stack(children) | 21 child: new Stack(children) |
| 22 ); | 22 ); |
| 23 } | 23 } |
| 24 | 24 |
| 25 } | 25 } |
| OLD | NEW |