Commit 953dabc7 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Fix some typos (#12233)

parent 260353f2
...@@ -27,7 +27,7 @@ import 'route.dart'; ...@@ -27,7 +27,7 @@ import 'route.dart';
/// 4. Finally if all else fails [onUnknownRoute] is called. /// 4. Finally if all else fails [onUnknownRoute] is called.
/// ///
/// These navigation properties are not shared with any sibling [CupertinoTabView] /// These navigation properties are not shared with any sibling [CupertinoTabView]
/// nor any ancestor or descendent [Navigator] instances. /// nor any ancestor or descendant [Navigator] instances.
/// ///
/// See also: /// See also:
/// ///
...@@ -70,7 +70,7 @@ class CupertinoTabView extends StatelessWidget { ...@@ -70,7 +70,7 @@ class CupertinoTabView extends StatelessWidget {
/// instead. /// instead.
/// ///
/// This routing table is not shared with any routing tables of ancestor or /// This routing table is not shared with any routing tables of ancestor or
/// descendent [Navigator]s. /// descendant [Navigator]s.
final Map<String, WidgetBuilder> routes; final Map<String, WidgetBuilder> routes;
/// The route generator callback used when the tab view is navigated to a named route. /// The route generator callback used when the tab view is navigated to a named route.
...@@ -90,7 +90,7 @@ class CupertinoTabView extends StatelessWidget { ...@@ -90,7 +90,7 @@ class CupertinoTabView extends StatelessWidget {
/// The list of observers for the [Navigator] created in this tab view. /// The list of observers for the [Navigator] created in this tab view.
/// ///
/// This list of observers is not shared with ancestor or descendent [Navigator]s. /// This list of observers is not shared with ancestor or descendant [Navigator]s.
final List<NavigatorObserver> navigatorObservers; final List<NavigatorObserver> navigatorObservers;
@override @override
......
...@@ -238,7 +238,7 @@ abstract class PointerEvent { ...@@ -238,7 +238,7 @@ abstract class PointerEvent {
/// We occasionally synthesize PointerEvents that aren't exact translations /// We occasionally synthesize PointerEvents that aren't exact translations
/// of [ui.PointerData] from the engine to cover small cross-OS discrepancies /// of [ui.PointerData] from the engine to cover small cross-OS discrepancies
/// in pointer behaviours. /// in pointer behaviors.
/// ///
/// For instance, on end events, Android always drops any location changes /// For instance, on end events, Android always drops any location changes
/// that happened between its reporting intervals when emiting the end events. /// that happened between its reporting intervals when emiting the end events.
......
...@@ -1317,7 +1317,7 @@ class PipelineOwner { ...@@ -1317,7 +1317,7 @@ class PipelineOwner {
/// Hit testing is even more open-ended than layout. There is no method to /// Hit testing is even more open-ended than layout. There is no method to
/// override, you are expected to provide one. /// override, you are expected to provide one.
/// ///
/// The general behaviour of your hit-testing method should be similar to the /// The general behavior of your hit-testing method should be similar to the
/// behavior described for [RenderBox]. The main difference is that the input /// behavior described for [RenderBox]. The main difference is that the input
/// need not be an [Offset]. You are also allowed to use a different subclass of /// need not be an [Offset]. You are also allowed to use a different subclass of
/// [HitTestEntry] when adding entries to the [HitTestResult]. When the /// [HitTestEntry] when adding entries to the [HitTestResult]. When the
......
...@@ -1488,7 +1488,7 @@ class SizedBox extends SingleChildRenderObjectWidget { ...@@ -1488,7 +1488,7 @@ class SizedBox extends SingleChildRenderObjectWidget {
/// ) /// )
/// ``` /// ```
/// ///
/// The same behaviour can be obtained using the [new SizedBox.expand] widget. /// The same behavior can be obtained using the [new SizedBox.expand] widget.
/// ///
/// See also: /// See also:
/// ///
......
...@@ -134,7 +134,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget { ...@@ -134,7 +134,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// _See [BoxConstraints] for an introduction to box layout models._ /// _See [BoxConstraints] for an introduction to box layout models._
/// ///
/// Since [Container] combines a number of other widgets each with their own /// Since [Container] combines a number of other widgets each with their own
/// layout behavior, [Container]'s layout behaviour is somewhat complicated. /// layout behavior, [Container]'s layout behavior is somewhat complicated.
/// ///
/// tl;dr: [Container] tries, in order: to honor [alignment], to size itself to /// tl;dr: [Container] tries, in order: to honor [alignment], to size itself to
/// the [child], to honor the `width`, `height`, and [constraints], to expand to /// the [child], to honor the `width`, `height`, and [constraints], to expand to
......
...@@ -14,7 +14,7 @@ void main() { ...@@ -14,7 +14,7 @@ void main() {
return new CupertinoPageRoute<Null>( return new CupertinoPageRoute<Null>(
settings: settings, settings: settings,
builder: (BuildContext context) { builder: (BuildContext context) {
final String pageNumber = settings.name == '/' ? "1" : "2"; final String pageNumber = settings.name == '/' ? '1' : '2';
return new Center(child: new Text('Page $pageNumber')); return new Center(child: new Text('Page $pageNumber'));
} }
); );
...@@ -150,7 +150,7 @@ void main() { ...@@ -150,7 +150,7 @@ void main() {
return new CupertinoPageRoute<Null>( return new CupertinoPageRoute<Null>(
settings: settings, settings: settings,
builder: (BuildContext context) { builder: (BuildContext context) {
final String pageNumber = settings.name == '/' ? "1" : "2"; final String pageNumber = settings.name == '/' ? '1' : '2';
return new Center(child: new Text('Page $pageNumber')); return new Center(child: new Text('Page $pageNumber'));
} }
); );
......
...@@ -7,7 +7,7 @@ import 'dart:ui'; ...@@ -7,7 +7,7 @@ import 'dart:ui';
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {
test("color accessors should work", () { test('color accessors should work', () {
final Color foo = const Color(0x12345678); final Color foo = const Color(0x12345678);
expect(foo.alpha, equals(0x12)); expect(foo.alpha, equals(0x12));
expect(foo.red, equals(0x34)); expect(foo.red, equals(0x34));
...@@ -15,14 +15,14 @@ void main() { ...@@ -15,14 +15,14 @@ void main() {
expect(foo.blue, equals(0x78)); expect(foo.blue, equals(0x78));
}); });
test("paint set to black", () { test('paint set to black', () {
final Color c = const Color(0x00000000); final Color c = const Color(0x00000000);
final Paint p = new Paint(); final Paint p = new Paint();
p.color = c; p.color = c;
expect(c.toString(), equals('Color(0x00000000)')); expect(c.toString(), equals('Color(0x00000000)'));
}); });
test("color created with out of bounds value", () { test('color created with out of bounds value', () {
try { try {
final Color c = const Color(0x100 << 24); final Color c = const Color(0x100 << 24);
final Paint p = new Paint(); final Paint p = new Paint();
...@@ -32,7 +32,7 @@ void main() { ...@@ -32,7 +32,7 @@ void main() {
} }
}); });
test("color created with wildly out of bounds value", () { test('color created with wildly out of bounds value', () {
try { try {
final Color c = const Color(1 << 1000000); final Color c = const Color(1 << 1000000);
final Paint p = new Paint(); final Paint p = new Paint();
......
...@@ -7,7 +7,7 @@ import 'dart:ui'; ...@@ -7,7 +7,7 @@ import 'dart:ui';
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {
test("Should be able to build and layout a paragraph", () { test('Should be able to build and layout a paragraph', () {
final ParagraphBuilder builder = new ParagraphBuilder(new ParagraphStyle()); final ParagraphBuilder builder = new ParagraphBuilder(new ParagraphStyle());
builder.addText('Hello'); builder.addText('Hello');
final Paragraph paragraph = builder.build(); final Paragraph paragraph = builder.build();
......
...@@ -7,7 +7,7 @@ import 'dart:ui'; ...@@ -7,7 +7,7 @@ import 'dart:ui';
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {
test("rect accessors", () { test('rect accessors', () {
final Rect r = new Rect.fromLTRB(1.0, 3.0, 5.0, 7.0); final Rect r = new Rect.fromLTRB(1.0, 3.0, 5.0, 7.0);
expect(r.left, equals(1.0)); expect(r.left, equals(1.0));
expect(r.top, equals(3.0)); expect(r.top, equals(3.0));
...@@ -15,7 +15,7 @@ void main() { ...@@ -15,7 +15,7 @@ void main() {
expect(r.bottom, equals(7.0)); expect(r.bottom, equals(7.0));
}); });
test("rect created by width and height", () { test('rect created by width and height', () {
final Rect r = new Rect.fromLTWH(1.0, 3.0, 5.0, 7.0); final Rect r = new Rect.fromLTWH(1.0, 3.0, 5.0, 7.0);
expect(r.left, equals(1.0)); expect(r.left, equals(1.0));
expect(r.top, equals(3.0)); expect(r.top, equals(3.0));
...@@ -23,7 +23,7 @@ void main() { ...@@ -23,7 +23,7 @@ void main() {
expect(r.bottom, equals(10.0)); expect(r.bottom, equals(10.0));
}); });
test("rect intersection", () { test('rect intersection', () {
final Rect r1 = new Rect.fromLTRB(0.0, 0.0, 100.0, 100.0); final Rect r1 = new Rect.fromLTRB(0.0, 0.0, 100.0, 100.0);
final Rect r2 = new Rect.fromLTRB(50.0, 50.0, 200.0, 200.0); final Rect r2 = new Rect.fromLTRB(50.0, 50.0, 200.0, 200.0);
final Rect r3 = r1.intersect(r2); final Rect r3 = r1.intersect(r2);
......
...@@ -6,12 +6,12 @@ import 'package:flutter/foundation.dart'; ...@@ -6,12 +6,12 @@ import 'package:flutter/foundation.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
// We run our tests in debug mode, to this will always evaluate to false... // We run our tests in debug mode, to this will always evaluate to false...
const bool isReleaseMode = const bool.fromEnvironment("dart.vm.product"); const bool isReleaseMode = const bool.fromEnvironment('dart.vm.product');
void main() { void main() {
// TODO(devoncarew): This test - while very nice - isn't testing what we really want to know: // TODO(devoncarew): This test - while very nice - isn't testing what we really want to know:
// that the code in the `profile` closure is omitted in release mode. // that the code in the `profile` closure is omitted in release mode.
test("profile invokes its closure in debug or profile mode", () { test('profile invokes its closure in debug or profile mode', () {
int count = 0; int count = 0;
profile(() { profile(() {
count++; count++;
......
...@@ -127,7 +127,7 @@ void main() { ...@@ -127,7 +127,7 @@ void main() {
}); });
router.addRoute(2, (PointerEvent event) { router.addRoute(2, (PointerEvent event) {
log.add('per-pointer 2'); log.add('per-pointer 2');
throw "Having a bad day!"; throw 'Having a bad day!';
}); });
router.addRoute(2, (PointerEvent event) { router.addRoute(2, (PointerEvent event) {
log.add('per-pointer 3'); log.add('per-pointer 3');
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {
test("should pass", () { test('should pass', () {
expect(1 + 1, equals(2)); expect(1 + 1, equals(2));
}); });
} }
...@@ -40,7 +40,7 @@ Widget buildFrame({ ...@@ -40,7 +40,7 @@ Widget buildFrame({
return new DropdownMenuItem<String>( return new DropdownMenuItem<String>(
key: new ValueKey<String>(item), key: new ValueKey<String>(item),
value: item, value: item,
child: new Text(item, key: new ValueKey<String>(item + "Text")), child: new Text(item, key: new ValueKey<String>(item + 'Text')),
); );
}).toList(), }).toList(),
), ),
...@@ -403,7 +403,7 @@ void main() { ...@@ -403,7 +403,7 @@ void main() {
Rect getMenuRect() { Rect getMenuRect() {
Rect menuRect; Rect menuRect;
tester.element(find.byType(ListView)).visitAncestorElements((Element element) { tester.element(find.byType(ListView)).visitAncestorElements((Element element) {
if (element.toString().startsWith("_DropdownMenu")) { if (element.toString().startsWith('_DropdownMenu')) {
final RenderBox box = element.findRenderObject(); final RenderBox box = element.findRenderObject();
assert(box != null); assert(box != null);
menuRect = box.localToGlobal(Offset.zero) & box.size; menuRect = box.localToGlobal(Offset.zero) & box.size;
......
...@@ -11,9 +11,9 @@ import 'package:flutter/services.dart'; ...@@ -11,9 +11,9 @@ import 'package:flutter/services.dart';
class FeedbackTester { class FeedbackTester {
FeedbackTester() { FeedbackTester() {
SystemChannels.platform.setMockMethodCallHandler((MethodCall methodCall) { SystemChannels.platform.setMockMethodCallHandler((MethodCall methodCall) {
if (methodCall.method == "HapticFeedback.vibrate") if (methodCall.method == 'HapticFeedback.vibrate')
_hapticCount++; _hapticCount++;
if (methodCall.method == "SystemSound.play" && if (methodCall.method == 'SystemSound.play' &&
methodCall.arguments == SystemSoundType.click.toString()) methodCall.arguments == SystemSoundType.click.toString())
_clickSoundCount++; _clickSoundCount++;
}); });
......
...@@ -135,8 +135,8 @@ void main() { ...@@ -135,8 +135,8 @@ void main() {
expect(localizations.selectAllButtonLabel, isNotNull); expect(localizations.selectAllButtonLabel, isNotNull);
expect(localizations.viewLicensesButtonLabel, isNotNull); expect(localizations.viewLicensesButtonLabel, isNotNull);
expect(localizations.aboutListTileTitle("FOO"), isNotNull); expect(localizations.aboutListTileTitle('FOO'), isNotNull);
expect(localizations.aboutListTileTitle("FOO"), contains("FOO")); expect(localizations.aboutListTileTitle('FOO'), contains('FOO'));
expect(localizations.selectedRowCountTitle(0), isNotNull); expect(localizations.selectedRowCountTitle(0), isNotNull);
expect(localizations.selectedRowCountTitle(1), isNotNull); expect(localizations.selectedRowCountTitle(1), isNotNull);
......
...@@ -62,7 +62,7 @@ void main() { ...@@ -62,7 +62,7 @@ void main() {
onTap: () { onTap: () {
snackBarCount += 1; snackBarCount += 1;
Scaffold.of(context).showSnackBar(new SnackBar( Scaffold.of(context).showSnackBar(new SnackBar(
content: new Text("bar$snackBarCount"), content: new Text('bar$snackBarCount'),
duration: const Duration(seconds: 2) duration: const Duration(seconds: 2)
)); ));
}, },
...@@ -139,7 +139,7 @@ void main() { ...@@ -139,7 +139,7 @@ void main() {
onTap: () { onTap: () {
snackBarCount += 1; snackBarCount += 1;
lastController = Scaffold.of(context).showSnackBar(new SnackBar( lastController = Scaffold.of(context).showSnackBar(new SnackBar(
content: new Text("bar$snackBarCount"), content: new Text('bar$snackBarCount'),
duration: new Duration(seconds: time) duration: new Duration(seconds: time)
)); ));
}, },
...@@ -223,7 +223,7 @@ void main() { ...@@ -223,7 +223,7 @@ void main() {
onTap: () { onTap: () {
snackBarCount += 1; snackBarCount += 1;
Scaffold.of(context).showSnackBar(new SnackBar( Scaffold.of(context).showSnackBar(new SnackBar(
content: new Text("bar$snackBarCount"), content: new Text('bar$snackBarCount'),
duration: const Duration(seconds: 2) duration: const Duration(seconds: 2)
)); ));
}, },
......
...@@ -960,7 +960,7 @@ void main() { ...@@ -960,7 +960,7 @@ void main() {
expect(find.text('Suffix'), findsOneWidget); expect(find.text('Suffix'), findsOneWidget);
// Enter some text, and the prefix should still display. // Enter some text, and the prefix should still display.
await tester.enterText(find.byKey(secondKey), "Hi"); await tester.enterText(find.byKey(secondKey), 'Hi');
await tester.pump(); await tester.pump();
await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1));
...@@ -1014,7 +1014,7 @@ void main() { ...@@ -1014,7 +1014,7 @@ void main() {
// Enter some text, and the hint should disappear and the prefix and suffix // Enter some text, and the hint should disappear and the prefix and suffix
// should appear. // should appear.
await tester.enterText(find.byKey(secondKey), "Hi"); await tester.enterText(find.byKey(secondKey), 'Hi');
await tester.pump(); await tester.pump();
await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1));
...@@ -1086,7 +1086,7 @@ void main() { ...@@ -1086,7 +1086,7 @@ void main() {
// Enter some text, and the label should stay and the prefix should // Enter some text, and the label should stay and the prefix should
// remain. // remain.
await tester.enterText(find.byKey(secondKey), "Hi"); await tester.enterText(find.byKey(secondKey), 'Hi');
await tester.pump(); await tester.pump();
await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1));
......
...@@ -269,7 +269,7 @@ void main() { ...@@ -269,7 +269,7 @@ void main() {
}); });
testWidgets( testWidgets(
'Same ThemeData reapplied does not trigger descendents rebuilds', 'Same ThemeData reapplied does not trigger descendants rebuilds',
(WidgetTester tester) async { (WidgetTester tester) async {
testBuildCalled = 0; testBuildCalled = 0;
ThemeData themeData = new ThemeData(primaryColor: const Color(0xFF000000)); ThemeData themeData = new ThemeData(primaryColor: const Color(0xFF000000));
......
...@@ -37,8 +37,8 @@ void main() { ...@@ -37,8 +37,8 @@ void main() {
child: const Text('E'), child: const Text('E'),
) )
], ],
accountName: const Text("name"), accountName: const Text('name'),
accountEmail: const Text("email"), accountEmail: const Text('email'),
), ),
), ),
), ),
......
...@@ -7,7 +7,7 @@ import 'package:test/test.dart'; ...@@ -7,7 +7,7 @@ import 'package:test/test.dart';
import 'package:vector_math/vector_math_64.dart'; import 'package:vector_math/vector_math_64.dart';
void main() { void main() {
test("MatrixUtils.getAsTranslation()", () { test('MatrixUtils.getAsTranslation()', () {
Matrix4 test; Matrix4 test;
test = new Matrix4.identity(); test = new Matrix4.identity();
expect(MatrixUtils.getAsTranslation(test), equals(Offset.zero)); expect(MatrixUtils.getAsTranslation(test), equals(Offset.zero));
......
...@@ -9,7 +9,7 @@ import 'package:test/test.dart'; ...@@ -9,7 +9,7 @@ import 'package:test/test.dart';
import 'rendering_tester.dart'; import 'rendering_tester.dart';
void main() { void main() {
test("RenderBaseline", () { test('RenderBaseline', () {
RenderBaseline parent; RenderBaseline parent;
RenderSizedBox child; RenderSizedBox child;
final RenderBox root = new RenderPositionedBox( final RenderBox root = new RenderPositionedBox(
......
...@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart'; ...@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'rendering_tester.dart'; import 'rendering_tester.dart';
void main() { void main() {
test("should size to render view", () { test('should size to render view', () {
final RenderBox root = new RenderDecoratedBox( final RenderBox root = new RenderDecoratedBox(
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: const Color(0xFF00FF00), color: const Color(0xFF00FF00),
...@@ -65,7 +65,7 @@ void main() { ...@@ -65,7 +65,7 @@ void main() {
expect(outer.size.height, equals(600.0)); expect(outer.size.height, equals(600.0));
}); });
test("should not have a 0 sized colored Box", () { test('should not have a 0 sized colored Box', () {
final RenderBox coloredBox = new RenderDecoratedBox( final RenderBox coloredBox = new RenderDecoratedBox(
decoration: const BoxDecoration(), decoration: const BoxDecoration(),
); );
...@@ -107,7 +107,7 @@ void main() { ...@@ -107,7 +107,7 @@ void main() {
); );
}); });
test("reparenting should clear position", () { test('reparenting should clear position', () {
final RenderDecoratedBox coloredBox = new RenderDecoratedBox( final RenderDecoratedBox coloredBox = new RenderDecoratedBox(
decoration: const BoxDecoration(), decoration: const BoxDecoration(),
); );
......
...@@ -8,7 +8,7 @@ import 'package:test/test.dart'; ...@@ -8,7 +8,7 @@ import 'package:test/test.dart';
import 'rendering_tester.dart'; import 'rendering_tester.dart';
void main() { void main() {
test("RenderFractionallySizedBox constraints", () { test('RenderFractionallySizedBox constraints', () {
RenderBox root, leaf, test; RenderBox root, leaf, test;
root = new RenderPositionedBox( root = new RenderPositionedBox(
child: new RenderConstrainedBox( child: new RenderConstrainedBox(
...@@ -31,7 +31,7 @@ void main() { ...@@ -31,7 +31,7 @@ void main() {
expect(leaf.size.height, equals(100.0)); expect(leaf.size.height, equals(100.0));
}); });
test("BoxConstraints with NaN", () { test('BoxConstraints with NaN', () {
String result; String result;
result = 'no exception'; result = 'no exception';
......
...@@ -43,7 +43,7 @@ class RealRoot extends AbstractNode { ...@@ -43,7 +43,7 @@ class RealRoot extends AbstractNode {
} }
void main() { void main() {
test("non-RenderObject roots", () { test('non-RenderObject roots', () {
RenderPositionedBox child; RenderPositionedBox child;
final RealRoot root = new RealRoot( final RealRoot root = new RealRoot(
child = new RenderPositionedBox( child = new RenderPositionedBox(
......
...@@ -7,7 +7,7 @@ import 'package:flutter/rendering.dart'; ...@@ -7,7 +7,7 @@ import 'package:flutter/rendering.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {
test("ensure frame is scheduled for markNeedsSemanticsUpdate", () { test('ensure frame is scheduled for markNeedsSemanticsUpdate', () {
final TestRenderObject renderObject = new TestRenderObject(); final TestRenderObject renderObject = new TestRenderObject();
int onNeedVisualUpdateCallCount = 0; int onNeedVisualUpdateCallCount = 0;
final PipelineOwner owner = new PipelineOwner(onNeedVisualUpdate: () { final PipelineOwner owner = new PipelineOwner(onNeedVisualUpdate: () {
...@@ -22,7 +22,7 @@ void main() { ...@@ -22,7 +22,7 @@ void main() {
expect(onNeedVisualUpdateCallCount, 2); expect(onNeedVisualUpdateCallCount, 2);
}); });
test("ensure frame is scheduled for markNeedsSemanticsUpdate with onlyChanges: true", () { test('ensure frame is scheduled for markNeedsSemanticsUpdate with onlyChanges: true', () {
final TestRenderObject renderObject = new TestRenderObject(); final TestRenderObject renderObject = new TestRenderObject();
int onNeedVisualUpdateCallCount = 0; int onNeedVisualUpdateCallCount = 0;
final PipelineOwner owner = new PipelineOwner(onNeedVisualUpdate: () { final PipelineOwner owner = new PipelineOwner(onNeedVisualUpdate: () {
......
...@@ -9,7 +9,7 @@ import 'package:test/test.dart'; ...@@ -9,7 +9,7 @@ import 'package:test/test.dart';
import 'rendering_tester.dart'; import 'rendering_tester.dart';
void main() { void main() {
test("offstage", () { test('offstage', () {
RenderBox child; RenderBox child;
bool painted = false; bool painted = false;
// incoming constraints are tight 800x600 // incoming constraints are tight 800x600
......
...@@ -8,7 +8,7 @@ import 'package:test/test.dart'; ...@@ -8,7 +8,7 @@ import 'package:test/test.dart';
import 'rendering_tester.dart'; import 'rendering_tester.dart';
void main() { void main() {
test("nested repaint boundaries - smoke test", () { test('nested repaint boundaries - smoke test', () {
RenderOpacity a, b, c; RenderOpacity a, b, c;
a = new RenderOpacity( a = new RenderOpacity(
opacity: 1.0, opacity: 1.0,
......
...@@ -17,7 +17,7 @@ class TestStrategy { ...@@ -17,7 +17,7 @@ class TestStrategy {
} }
void main() { void main() {
test("Tasks are executed in the right order", () { test('Tasks are executed in the right order', () {
final SchedulerBinding scheduler = new TestSchedulerBinding(); final SchedulerBinding scheduler = new TestSchedulerBinding();
final TestStrategy strategy = new TestStrategy(); final TestStrategy strategy = new TestStrategy();
scheduler.schedulingStrategy = strategy.shouldRunTaskWithPriority; scheduler.schedulingStrategy = strategy.shouldRunTaskWithPriority;
......
...@@ -35,7 +35,7 @@ void main() { ...@@ -35,7 +35,7 @@ void main() {
expect(log, equals(<MethodCall>[new MethodCall( expect(log, equals(<MethodCall>[new MethodCall(
'SystemChrome.setPreferredOrientations', 'SystemChrome.setPreferredOrientations',
<String>["DeviceOrientation.portraitUp"], <String>['DeviceOrientation.portraitUp'],
)])); )]));
}); });
...@@ -52,7 +52,7 @@ void main() { ...@@ -52,7 +52,7 @@ void main() {
expect(log, equals(<MethodCall>[new MethodCall( expect(log, equals(<MethodCall>[new MethodCall(
'SystemChrome.setApplicationSwitcherDescription', 'SystemChrome.setApplicationSwitcherDescription',
<String, dynamic>{"label":"Example label","primaryColor":4278255360} <String, dynamic>{'label':'Example label','primaryColor':4278255360}
)])); )]));
}); });
...@@ -82,7 +82,7 @@ void main() { ...@@ -82,7 +82,7 @@ void main() {
expect(log, equals(<MethodCall>[new MethodCall( expect(log, equals(<MethodCall>[new MethodCall(
'SystemChrome.setEnabledSystemUIOverlays', 'SystemChrome.setEnabledSystemUIOverlays',
<String>["SystemUiOverlay.top"], <String>['SystemUiOverlay.top'],
)])); )]));
}); });
} }
...@@ -15,6 +15,6 @@ void main() { ...@@ -15,6 +15,6 @@ void main() {
await SystemSound.play(SystemSoundType.click); await SystemSound.play(SystemSoundType.click);
expect(log, equals(<MethodCall>[const MethodCall('SystemSound.play', "SystemSoundType.click")])); expect(log, equals(<MethodCall>[const MethodCall('SystemSound.play', 'SystemSoundType.click')]));
}); });
} }
...@@ -7,7 +7,7 @@ import 'package:flutter/painting.dart'; ...@@ -7,7 +7,7 @@ import 'package:flutter/painting.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
void main() { void main() {
test("RRect.contains()", () { test('RRect.contains()', () {
final RRect rrect = new RRect.fromRectAndCorners( final RRect rrect = new RRect.fromRectAndCorners(
new Rect.fromLTRB(1.0, 1.0, 2.0, 2.0), new Rect.fromLTRB(1.0, 1.0, 2.0, 2.0),
topLeft: const Radius.circular(0.5), topLeft: const Radius.circular(0.5),
...@@ -26,7 +26,7 @@ void main() { ...@@ -26,7 +26,7 @@ void main() {
expect(rrect.contains(const Offset(1.0, 1.99)), isTrue); expect(rrect.contains(const Offset(1.0, 1.99)), isTrue);
}); });
test("RRect.contains() large radii", () { test('RRect.contains() large radii', () {
final RRect rrect = new RRect.fromRectAndCorners( final RRect rrect = new RRect.fromRectAndCorners(
new Rect.fromLTRB(1.0, 1.0, 2.0, 2.0), new Rect.fromLTRB(1.0, 1.0, 2.0, 2.0),
topLeft: const Radius.circular(5000.0), topLeft: const Radius.circular(5000.0),
......
...@@ -93,7 +93,7 @@ Future<Null> dismissElement(WidgetTester tester, Finder finder, { DismissDirecti ...@@ -93,7 +93,7 @@ Future<Null> dismissElement(WidgetTester tester, Finder finder, { DismissDirecti
upLocation = tester.getBottomLeft(finder); upLocation = tester.getBottomLeft(finder);
break; break;
default: default:
fail("unsupported gestureDirection"); fail('unsupported gestureDirection');
} }
final TestGesture gesture = await tester.startGesture(downLocation, pointer: 5); final TestGesture gesture = await tester.startGesture(downLocation, pointer: 5);
......
...@@ -10,7 +10,7 @@ class Item { ...@@ -10,7 +10,7 @@ class Item {
GlobalKey key2 = new GlobalKey(); GlobalKey key2 = new GlobalKey();
@override @override
String toString() => "Item($key1, $key2)"; String toString() => 'Item($key1, $key2)';
} }
List<Item> items = <Item>[new Item(), new Item()]; List<Item> items = <Item>[new Item(), new Item()];
......
...@@ -33,13 +33,13 @@ void main() { ...@@ -33,13 +33,13 @@ void main() {
expect(tester.renderObjectList<RenderBox>(find.byType(DecoratedBox)), hasLength(4)); expect(tester.renderObjectList<RenderBox>(find.byType(DecoratedBox)), hasLength(4));
for (RenderBox box in tester.renderObjectList<RenderBox>(find.byType(DecoratedBox))) { for (RenderBox box in tester.renderObjectList<RenderBox>(find.byType(DecoratedBox))) {
expect(box.size.width, equals(100.0), reason: "child width"); expect(box.size.width, equals(100.0), reason: 'child width');
expect(box.size.height, equals(100.0), reason: "child height"); expect(box.size.height, equals(100.0), reason: 'child height');
} }
final RenderBox grid = tester.renderObject(find.byType(GridView)); final RenderBox grid = tester.renderObject(find.byType(GridView));
expect(grid.size.width, equals(200.0), reason: "grid width"); expect(grid.size.width, equals(200.0), reason: 'grid width');
expect(grid.size.height, equals(200.0), reason: "grid height"); expect(grid.size.height, equals(200.0), reason: 'grid height');
expect(grid.debugNeedsLayout, false); expect(grid.debugNeedsLayout, false);
...@@ -60,11 +60,11 @@ void main() { ...@@ -60,11 +60,11 @@ void main() {
); );
for (RenderBox box in tester.renderObjectList<RenderBox>(find.byType(DecoratedBox))) { for (RenderBox box in tester.renderObjectList<RenderBox>(find.byType(DecoratedBox))) {
expect(box.size.width, equals(50.0), reason: "child width"); expect(box.size.width, equals(50.0), reason: 'child width');
expect(box.size.height, equals(50.0), reason: "child height"); expect(box.size.height, equals(50.0), reason: 'child height');
} }
expect(grid.size.width, equals(200.0), reason: "grid width"); expect(grid.size.width, equals(200.0), reason: 'grid width');
expect(grid.size.height, equals(50.0), reason: "grid height"); expect(grid.size.height, equals(50.0), reason: 'grid height');
}); });
} }
...@@ -92,7 +92,7 @@ class TriggerableState extends State<TriggerableWidget> { ...@@ -92,7 +92,7 @@ class TriggerableState extends State<TriggerableWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
widget.counter.count++; widget.counter.count++;
return new Text("Bang $_count!", textDirection: TextDirection.ltr); return new Text('Bang $_count!', textDirection: TextDirection.ltr);
} }
} }
......
...@@ -25,7 +25,7 @@ void main() { ...@@ -25,7 +25,7 @@ void main() {
return new Container( return new Container(
key: new ValueKey<int>(index), key: new ValueKey<int>(index),
height: 100.0, height: 100.0,
child: new Text("$index"), child: new Text('$index'),
); );
}, },
), ),
......
...@@ -8,10 +8,10 @@ import 'package:flutter/material.dart'; ...@@ -8,10 +8,10 @@ import 'package:flutter/material.dart';
void main() { void main() {
testWidgets('Back during pushReplacement', (WidgetTester tester) async { testWidgets('Back during pushReplacement', (WidgetTester tester) async {
await tester.pumpWidget(new MaterialApp( await tester.pumpWidget(new MaterialApp(
home: const Material(child: const Text("home")), home: const Material(child: const Text('home')),
routes: <String, WidgetBuilder> { routes: <String, WidgetBuilder> {
'/a': (BuildContext context) => const Material(child: const Text("a")), '/a': (BuildContext context) => const Material(child: const Text('a')),
'/b': (BuildContext context) => const Material(child: const Text("b")), '/b': (BuildContext context) => const Material(child: const Text('b')),
}, },
)); ));
...@@ -41,10 +41,10 @@ void main() { ...@@ -41,10 +41,10 @@ void main() {
testWidgets('pushAndRemoveUntil', (WidgetTester tester) async { testWidgets('pushAndRemoveUntil', (WidgetTester tester) async {
await tester.pumpWidget(new MaterialApp( await tester.pumpWidget(new MaterialApp(
home: const Material(child: const Text("home")), home: const Material(child: const Text('home')),
routes: <String, WidgetBuilder> { routes: <String, WidgetBuilder> {
'/a': (BuildContext context) => const Material(child: const Text("a")), '/a': (BuildContext context) => const Material(child: const Text('a')),
'/b': (BuildContext context) => const Material(child: const Text("b")), '/b': (BuildContext context) => const Material(child: const Text('b')),
}, },
)); ));
......
...@@ -334,7 +334,7 @@ void main() { ...@@ -334,7 +334,7 @@ void main() {
expect(isPopped, isTrue); expect(isPopped, isTrue);
}); });
testWidgets("Add and remove an observer should work", (WidgetTester tester) async { testWidgets('Add and remove an observer should work', (WidgetTester tester) async {
final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
'/': (BuildContext context) => new OnTapPage(id: '/', onTap: () { Navigator.pushNamed(context, '/A'); }), '/': (BuildContext context) => new OnTapPage(id: '/', onTap: () { Navigator.pushNamed(context, '/A'); }),
'/A': (BuildContext context) => new OnTapPage(id: 'A', onTap: () { Navigator.pop(context); }), '/A': (BuildContext context) => new OnTapPage(id: 'A', onTap: () { Navigator.pop(context); }),
......
...@@ -72,13 +72,13 @@ void main() { ...@@ -72,13 +72,13 @@ void main() {
); );
final StateMarkerState leftState = left.currentState; final StateMarkerState leftState = left.currentState;
leftState.marker = "left"; leftState.marker = 'left';
final StateMarkerState rightState = right.currentState; final StateMarkerState rightState = right.currentState;
rightState.marker = "right"; rightState.marker = 'right';
final StateMarkerState grandchildState = tester.state(find.byWidget(grandchild)); final StateMarkerState grandchildState = tester.state(find.byWidget(grandchild));
expect(grandchildState, isNotNull); expect(grandchildState, isNotNull);
grandchildState.marker = "grandchild"; grandchildState.marker = 'grandchild';
final StateMarker newGrandchild = const StateMarker(); final StateMarker newGrandchild = const StateMarker();
await tester.pumpWidget( await tester.pumpWidget(
...@@ -99,14 +99,14 @@ void main() { ...@@ -99,14 +99,14 @@ void main() {
); );
expect(left.currentState, equals(leftState)); expect(left.currentState, equals(leftState));
expect(leftState.marker, equals("left")); expect(leftState.marker, equals('left'));
expect(right.currentState, equals(rightState)); expect(right.currentState, equals(rightState));
expect(rightState.marker, equals("right")); expect(rightState.marker, equals('right'));
final StateMarkerState newGrandchildState = tester.state(find.byWidget(newGrandchild)); final StateMarkerState newGrandchildState = tester.state(find.byWidget(newGrandchild));
expect(newGrandchildState, isNotNull); expect(newGrandchildState, isNotNull);
expect(newGrandchildState, equals(grandchildState)); expect(newGrandchildState, equals(grandchildState));
expect(newGrandchildState.marker, equals("grandchild")); expect(newGrandchildState.marker, equals('grandchild'));
await tester.pumpWidget( await tester.pumpWidget(
new Center( new Center(
...@@ -120,7 +120,7 @@ void main() { ...@@ -120,7 +120,7 @@ void main() {
); );
expect(left.currentState, equals(leftState)); expect(left.currentState, equals(leftState));
expect(leftState.marker, equals("left")); expect(leftState.marker, equals('left'));
expect(right.currentState, isNull); expect(right.currentState, isNull);
}); });
...@@ -143,13 +143,13 @@ void main() { ...@@ -143,13 +143,13 @@ void main() {
); );
final StateMarkerState leftState = left.currentState; final StateMarkerState leftState = left.currentState;
leftState.marker = "left"; leftState.marker = 'left';
final StateMarkerState rightState = right.currentState; final StateMarkerState rightState = right.currentState;
rightState.marker = "right"; rightState.marker = 'right';
final StateMarkerState grandchildState = tester.state(find.byWidget(grandchild)); final StateMarkerState grandchildState = tester.state(find.byWidget(grandchild));
expect(grandchildState, isNotNull); expect(grandchildState, isNotNull);
grandchildState.marker = "grandchild"; grandchildState.marker = 'grandchild';
final StateMarker newGrandchild = const StateMarker(); final StateMarker newGrandchild = const StateMarker();
await tester.pumpWidget( await tester.pumpWidget(
...@@ -166,14 +166,14 @@ void main() { ...@@ -166,14 +166,14 @@ void main() {
); );
expect(left.currentState, equals(leftState)); expect(left.currentState, equals(leftState));
expect(leftState.marker, equals("left")); expect(leftState.marker, equals('left'));
expect(right.currentState, equals(rightState)); expect(right.currentState, equals(rightState));
expect(rightState.marker, equals("right")); expect(rightState.marker, equals('right'));
final StateMarkerState newGrandchildState = tester.state(find.byWidget(newGrandchild)); final StateMarkerState newGrandchildState = tester.state(find.byWidget(newGrandchild));
expect(newGrandchildState, isNotNull); expect(newGrandchildState, isNotNull);
expect(newGrandchildState, equals(grandchildState)); expect(newGrandchildState, equals(grandchildState));
expect(newGrandchildState.marker, equals("grandchild")); expect(newGrandchildState.marker, equals('grandchild'));
await tester.pumpWidget( await tester.pumpWidget(
new Center( new Center(
...@@ -187,7 +187,7 @@ void main() { ...@@ -187,7 +187,7 @@ void main() {
); );
expect(left.currentState, equals(leftState)); expect(left.currentState, equals(leftState));
expect(leftState.marker, equals("left")); expect(leftState.marker, equals('left'));
expect(right.currentState, isNull); expect(right.currentState, isNull);
}); });
...@@ -197,7 +197,7 @@ void main() { ...@@ -197,7 +197,7 @@ void main() {
await tester.pumpWidget(new StateMarker(key: key)); await tester.pumpWidget(new StateMarker(key: key));
final StateMarkerState keyState = key.currentState; final StateMarkerState keyState = key.currentState;
keyState.marker = "marked"; keyState.marker = 'marked';
await tester.pumpWidget( await tester.pumpWidget(
new Directionality( new Directionality(
...@@ -216,12 +216,12 @@ void main() { ...@@ -216,12 +216,12 @@ void main() {
); );
expect(key.currentState, equals(keyState)); expect(key.currentState, equals(keyState));
expect(keyState.marker, equals("marked")); expect(keyState.marker, equals('marked'));
await tester.pumpWidget(new StateMarker(key: key)); await tester.pumpWidget(new StateMarker(key: key));
expect(key.currentState, equals(keyState)); expect(key.currentState, equals(keyState));
expect(keyState.marker, equals("marked")); expect(keyState.marker, equals('marked'));
}); });
testWidgets('Reparent during update children', (WidgetTester tester) async { testWidgets('Reparent during update children', (WidgetTester tester) async {
...@@ -236,7 +236,7 @@ void main() { ...@@ -236,7 +236,7 @@ void main() {
)); ));
final StateMarkerState keyState = key.currentState; final StateMarkerState keyState = key.currentState;
keyState.marker = "marked"; keyState.marker = 'marked';
await tester.pumpWidget(new Stack( await tester.pumpWidget(new Stack(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
...@@ -247,7 +247,7 @@ void main() { ...@@ -247,7 +247,7 @@ void main() {
)); ));
expect(key.currentState, equals(keyState)); expect(key.currentState, equals(keyState));
expect(keyState.marker, equals("marked")); expect(keyState.marker, equals('marked'));
await tester.pumpWidget(new Stack( await tester.pumpWidget(new Stack(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
...@@ -258,7 +258,7 @@ void main() { ...@@ -258,7 +258,7 @@ void main() {
)); ));
expect(key.currentState, equals(keyState)); expect(key.currentState, equals(keyState));
expect(keyState.marker, equals("marked")); expect(keyState.marker, equals('marked'));
}); });
testWidgets('Reparent to child during update children', (WidgetTester tester) async { testWidgets('Reparent to child during update children', (WidgetTester tester) async {
...@@ -274,7 +274,7 @@ void main() { ...@@ -274,7 +274,7 @@ void main() {
)); ));
final StateMarkerState keyState = key.currentState; final StateMarkerState keyState = key.currentState;
keyState.marker = "marked"; keyState.marker = 'marked';
await tester.pumpWidget(new Stack( await tester.pumpWidget(new Stack(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
...@@ -285,7 +285,7 @@ void main() { ...@@ -285,7 +285,7 @@ void main() {
)); ));
expect(key.currentState, equals(keyState)); expect(key.currentState, equals(keyState));
expect(keyState.marker, equals("marked")); expect(keyState.marker, equals('marked'));
await tester.pumpWidget(new Stack( await tester.pumpWidget(new Stack(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
...@@ -297,7 +297,7 @@ void main() { ...@@ -297,7 +297,7 @@ void main() {
)); ));
expect(key.currentState, equals(keyState)); expect(key.currentState, equals(keyState));
expect(keyState.marker, equals("marked")); expect(keyState.marker, equals('marked'));
await tester.pumpWidget(new Stack( await tester.pumpWidget(new Stack(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
...@@ -308,7 +308,7 @@ void main() { ...@@ -308,7 +308,7 @@ void main() {
)); ));
expect(key.currentState, equals(keyState)); expect(key.currentState, equals(keyState));
expect(keyState.marker, equals("marked")); expect(keyState.marker, equals('marked'));
await tester.pumpWidget(new Stack( await tester.pumpWidget(new Stack(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
...@@ -320,7 +320,7 @@ void main() { ...@@ -320,7 +320,7 @@ void main() {
)); ));
expect(key.currentState, equals(keyState)); expect(key.currentState, equals(keyState));
expect(keyState.marker, equals("marked")); expect(keyState.marker, equals('marked'));
}); });
testWidgets('Deactivate implies build', (WidgetTester tester) async { testWidgets('Deactivate implies build', (WidgetTester tester) async {
......
...@@ -373,7 +373,7 @@ void main() { ...@@ -373,7 +373,7 @@ void main() {
expect(scrolled, isFalse); expect(scrolled, isFalse);
}); });
testWidgets('physics:AlwaysScrollableScrollPhysics actually overrides primary:false default behaviour', (WidgetTester tester) async { testWidgets('physics:AlwaysScrollableScrollPhysics actually overrides primary:false default behavior', (WidgetTester tester) async {
bool scrolled = false; bool scrolled = false;
await tester.pumpWidget( await tester.pumpWidget(
new Directionality( new Directionality(
...@@ -392,7 +392,7 @@ void main() { ...@@ -392,7 +392,7 @@ void main() {
expect(scrolled, isTrue); expect(scrolled, isTrue);
}); });
testWidgets('physics:ScrollPhysics actually overrides primary:true default behaviour', (WidgetTester tester) async { testWidgets('physics:ScrollPhysics actually overrides primary:true default behavior', (WidgetTester tester) async {
bool scrolled = false; bool scrolled = false;
await tester.pumpWidget( await tester.pumpWidget(
new Directionality( new Directionality(
......
...@@ -24,7 +24,7 @@ class _ScrollPositionListenerState extends State<ScrollPositionListener> { ...@@ -24,7 +24,7 @@ class _ScrollPositionListenerState extends State<ScrollPositionListener> {
_position?.removeListener(listener); _position?.removeListener(listener);
_position = Scrollable.of(context)?.position; _position = Scrollable.of(context)?.position;
_position?.addListener(listener); _position?.addListener(listener);
widget.log("didChangeDependencies ${_position?.pixels}"); widget.log('didChangeDependencies ${_position?.pixels}');
} }
@override @override
...@@ -37,7 +37,7 @@ class _ScrollPositionListenerState extends State<ScrollPositionListener> { ...@@ -37,7 +37,7 @@ class _ScrollPositionListenerState extends State<ScrollPositionListener> {
Widget build(BuildContext context) => widget.child; Widget build(BuildContext context) => widget.child;
void listener() { void listener() {
widget.log("listener ${_position?.pixels}"); widget.log('listener ${_position?.pixels}');
} }
} }
...@@ -62,24 +62,24 @@ void main() { ...@@ -62,24 +62,24 @@ void main() {
} }
await tester.pumpWidget(buildFrame(null)); await tester.pumpWidget(buildFrame(null));
expect(logValue, "didChangeDependencies 0.0"); expect(logValue, 'didChangeDependencies 0.0');
controller.jumpTo(100.0); controller.jumpTo(100.0);
expect(logValue, "listener 100.0"); expect(logValue, 'listener 100.0');
await tester.pumpWidget(buildFrame(const ClampingScrollPhysics())); await tester.pumpWidget(buildFrame(const ClampingScrollPhysics()));
expect(logValue, "didChangeDependencies 100.0"); expect(logValue, 'didChangeDependencies 100.0');
controller.jumpTo(200.0); controller.jumpTo(200.0);
expect(logValue, "listener 200.0"); expect(logValue, 'listener 200.0');
controller.jumpTo(300.0); controller.jumpTo(300.0);
expect(logValue, "listener 300.0"); expect(logValue, 'listener 300.0');
await tester.pumpWidget(buildFrame(const BouncingScrollPhysics())); await tester.pumpWidget(buildFrame(const BouncingScrollPhysics()));
expect(logValue, "didChangeDependencies 300.0"); expect(logValue, 'didChangeDependencies 300.0');
controller.jumpTo(400.0); controller.jumpTo(400.0);
expect(logValue, "listener 400.0"); expect(logValue, 'listener 400.0');
}); });
} }
...@@ -71,7 +71,7 @@ class RenderTest extends RenderProxyBox { ...@@ -71,7 +71,7 @@ class RenderTest extends RenderProxyBox {
void _annotate(SemanticsNode node) { void _annotate(SemanticsNode node) {
labelWasReset.add(node.label == ''); labelWasReset.add(node.label == '');
node.label = "Label ${labelWasReset.length}"; node.label = 'Label ${labelWasReset.length}';
node.textDirection = TextDirection.ltr; node.textDirection = TextDirection.ltr;
} }
} }
...@@ -388,7 +388,7 @@ void main() { ...@@ -388,7 +388,7 @@ void main() {
children: <Widget>[ children: <Widget>[
new GestureDetector( new GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { print("HELLO"); tapped = true; }, onTap: () { tapped = true; },
child: const SizedBox( child: const SizedBox(
width: 200.0, width: 200.0,
height: 200.0, height: 200.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