Improve the order of members in the mock_canvas file. (#7573)

This will make it easier to understand what this file does.
This commit is contained in:
Ian Hickson 2017-01-20 22:31:41 -08:00 committed by GitHub
parent 2bb800a2e4
commit 2e196037f5

View File

@ -6,6 +6,22 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:test/test.dart';
/// Matches [RenderObject]s that paint a display list that matches the canvas
/// calls described by the pattern.
///
/// To specify the pattern, call the methods on the returned object. For example:
///
/// ```dart
/// expect(myRenderObject, paints..circle(radius: 10.0)..circle(radius: 20.0));
/// ```
///
/// This particular pattern would verify that the render object `myRenderObject`
/// paints, among other things, two circles of radius 10.0 and 20.0 (in that
/// order).
///
/// See [PaintPattern] for a discussion of the semantics of paint patterns.
PaintPattern get paints => new _TestRecordingCanvasPatternMatcher();
/// Signature for [PaintPattern.something] predicate argument.
///
/// Used by the [paints] matcher.
@ -121,22 +137,6 @@ abstract class PaintPattern {
void something(PaintPatternPredicate predicate);
}
/// Matches [RenderObject]s that paint a display list that matches the canvas
/// calls described by the pattern.
///
/// To specify the pattern, call the methods on the returned object. For example:
///
/// ```dart
/// expect(myRenderObject, paints..circle(radius: 10.0)..circle(radius: 20.0));
/// ```
///
/// This particular pattern would verify that the render object `myRenderObject`
/// paints, among other things, two circles of radius 10.0 and 20.0 (in that
/// order).
///
/// See [PaintPattern] for a discussion of the semantics of paint patterns.
PaintPattern get paints => new _TestRecordingCanvasPatternMatcher();
class _TestRecordingCanvasPatternMatcher extends Matcher implements PaintPattern {
final List<_PaintPredicate> _predicates = <_PaintPredicate>[];