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