Use constant durations in more places (#24306)

This commit is contained in:
Brian Wilkerson
2018-11-14 08:16:12 -08:00
committed by Devon Carew
parent 2ae1379995
commit 29d5210d8b
2 changed files with 7 additions and 7 deletions

View File

@@ -113,7 +113,7 @@ void main() {
await tester.tap(find.byType(Icon));
await tester.pump();
await tester.pump(Duration(milliseconds: 10));
await tester.pump(const Duration(milliseconds: 10));
expect(tester.hasRunningAnimations, isTrue);
await tester.pumpAndSettle();
@@ -126,7 +126,7 @@ void main() {
await tester.tap(find.byType(Icon));
await tester.pump();
await tester.pump(Duration(milliseconds: 10));
await tester.pump(const Duration(milliseconds: 10));
expect(tester.hasRunningAnimations, isTrue);
await tester.pumpAndSettle();
@@ -149,25 +149,25 @@ void main() {
// Icon starts to rotate down.
await tester.tap(find.byType(Icon));
await tester.pump();
await tester.pump(Duration(milliseconds: 100));
await tester.pump(const Duration(milliseconds: 100));
expect(tester.hasRunningAnimations, isTrue);
// Icon starts to rotate up mid animation.
await tester.tap(find.byType(Icon));
await tester.pump();
await tester.pump(Duration(milliseconds: 100));
await tester.pump(const Duration(milliseconds: 100));
expect(tester.hasRunningAnimations, isTrue);
// Icon starts to rotate down again still mid animation.
await tester.tap(find.byType(Icon));
await tester.pump();
await tester.pump(Duration(milliseconds: 100));
await tester.pump(const Duration(milliseconds: 100));
expect(tester.hasRunningAnimations, isTrue);
// Icon starts to rotate up to its original position mid animation.
await tester.tap(find.byType(Icon));
await tester.pump();
await tester.pump(Duration(milliseconds: 100));
await tester.pump(const Duration(milliseconds: 100));
expect(tester.hasRunningAnimations, isTrue);
await tester.pumpAndSettle();

View File

@@ -15,7 +15,7 @@ void main() {
test('can find a time ago', () {
final SystemClock clock = SystemClock.fixed(DateTime(1991, 8, 23));
expect(clock.ago(Duration(days: 10)), DateTime(1991, 8, 13));
expect(clock.ago(const Duration(days: 10)), DateTime(1991, 8, 13));
});
});
}