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()) {
}
}
/// Arguments to whitelist [Timeline] events in order to be shown in the
/// developer centric version of the Observatory Timeline.
/// Argument passed to [Timeline] events in order to cause those events to be
/// 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>{
'mode': 'basic'
};
......@@ -66,7 +66,7 @@ class HitTestResult {
/// 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
/// 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;
/// Add a [HitTestEntry] to the path.
......
......@@ -140,10 +140,10 @@ class _LineBetweenPointers{
/// Recognizes a scale gesture.
///
/// [ScaleGestureRecognizer] tracks the pointers in contact with the screen and
/// calculates their focal point, indicated scale and rotation. When a focal pointer is
/// established, the recognizer calls [onStart]. As the focal point, scale, rotation
/// change, the recognizer calls [onUpdate]. When the pointers are no longer in
/// contact with the screen, the recognizer calls [onEnd].
/// calculates their focal point, indicated scale, and rotation. When a focal
/// pointer is established, the recognizer calls [onStart]. As the focal point,
/// scale, rotation change, the recognizer calls [onUpdate]. When the pointers
/// are no longer in contact with the screen, the recognizer calls [onEnd].
class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
/// Create a gesture recognizer for interactions intended for scaling content.
ScaleGestureRecognizer({ Object debugOwner }) : super(debugOwner: debugOwner);
......
......@@ -14,8 +14,8 @@ import 'framework.dart';
/// [Flex.mainAxisAlignment] on a flex container that contains a [Spacer] to
/// [MainAxisAlignment.spaceAround], [MainAxisAlignment.spaceBetween], or
/// [MainAxisAlignment.spaceEvenly] will not have any visible effect: the
/// [Spacer] has taken up all of the additional space, so there is none left to
/// redistribute.
/// [Spacer] has taken up all of the additional space, therefore there is none
/// left to redistribute.
///
/// ## Sample code
///
......@@ -59,10 +59,7 @@ class Spacer extends StatelessWidget {
Widget build(BuildContext context) {
return Expanded(
flex: flex,
child: const SizedBox(
height: 0.0,
width: 0.0,
),
child: const SizedBox.shrink(),
);
}
}
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