Unverified Commit 48a5804d authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

[O] Cleanup (#23530)

* Improve documentation

* Potential performance win in hit testing

Rather than copying the list every time we access `path`, this just
exposes it as an `Iterable`. People who want to copy it can use
`toList()`.

(This isn't a breaking change since code that expects a `List` is
still going to get one.)

* Enforce the Oxford Comma.
parent 6827d092
...@@ -63,8 +63,13 @@ Future<T> debugInstrumentAction<T>(String description, Future<T> action()) { ...@@ -63,8 +63,13 @@ Future<T> debugInstrumentAction<T>(String description, Future<T> action()) {
} }
} }
/// Arguments to whitelist [Timeline] events in order to be shown in the /// Argument passed to [Timeline] events in order to cause those events to be
/// developer centric version of the Observatory Timeline. /// shown in the developer-centric version of the Observatory Timeline.
///
/// See also:
///
/// * [Timeline.startSync], which typically takes this value as its `arguments`
/// argument.
const Map<String, String> timelineWhitelistArguments = <String, String>{ const Map<String, String> timelineWhitelistArguments = <String, String>{
'mode': 'basic' 'mode': 'basic'
}; };
...@@ -66,7 +66,7 @@ class HitTestResult { ...@@ -66,7 +66,7 @@ class HitTestResult {
/// The first entry in the path is the most specific, typically the one at /// The first entry in the path is the most specific, typically the one at
/// the leaf of tree being hit tested. Event propagation starts with the most /// the leaf of tree being hit tested. Event propagation starts with the most
/// specific (i.e., first) entry and proceeds in order through the path. /// specific (i.e., first) entry and proceeds in order through the path.
List<HitTestEntry> get path => List<HitTestEntry>.unmodifiable(_path); Iterable<HitTestEntry> get path => _path;
final List<HitTestEntry> _path; final List<HitTestEntry> _path;
/// Add a [HitTestEntry] to the path. /// Add a [HitTestEntry] to the path.
......
...@@ -140,10 +140,10 @@ class _LineBetweenPointers{ ...@@ -140,10 +140,10 @@ class _LineBetweenPointers{
/// Recognizes a scale gesture. /// Recognizes a scale gesture.
/// ///
/// [ScaleGestureRecognizer] tracks the pointers in contact with the screen and /// [ScaleGestureRecognizer] tracks the pointers in contact with the screen and
/// calculates their focal point, indicated scale and rotation. When a focal pointer is /// calculates their focal point, indicated scale, and rotation. When a focal
/// established, the recognizer calls [onStart]. As the focal point, scale, rotation /// pointer is established, the recognizer calls [onStart]. As the focal point,
/// change, the recognizer calls [onUpdate]. When the pointers are no longer in /// scale, rotation change, the recognizer calls [onUpdate]. When the pointers
/// contact with the screen, the recognizer calls [onEnd]. /// are no longer in contact with the screen, the recognizer calls [onEnd].
class ScaleGestureRecognizer extends OneSequenceGestureRecognizer { class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
/// Create a gesture recognizer for interactions intended for scaling content. /// Create a gesture recognizer for interactions intended for scaling content.
ScaleGestureRecognizer({ Object debugOwner }) : super(debugOwner: debugOwner); ScaleGestureRecognizer({ Object debugOwner }) : super(debugOwner: debugOwner);
......
...@@ -14,8 +14,8 @@ import 'framework.dart'; ...@@ -14,8 +14,8 @@ import 'framework.dart';
/// [Flex.mainAxisAlignment] on a flex container that contains a [Spacer] to /// [Flex.mainAxisAlignment] on a flex container that contains a [Spacer] to
/// [MainAxisAlignment.spaceAround], [MainAxisAlignment.spaceBetween], or /// [MainAxisAlignment.spaceAround], [MainAxisAlignment.spaceBetween], or
/// [MainAxisAlignment.spaceEvenly] will not have any visible effect: the /// [MainAxisAlignment.spaceEvenly] will not have any visible effect: the
/// [Spacer] has taken up all of the additional space, so there is none left to /// [Spacer] has taken up all of the additional space, therefore there is none
/// redistribute. /// left to redistribute.
/// ///
/// ## Sample code /// ## Sample code
/// ///
...@@ -59,10 +59,7 @@ class Spacer extends StatelessWidget { ...@@ -59,10 +59,7 @@ class Spacer extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Expanded( return Expanded(
flex: flex, flex: flex,
child: const SizedBox( child: const SizedBox.shrink(),
height: 0.0,
width: 0.0,
),
); );
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment