Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
GIfatahTH committed May 12, 2023
1 parent f1c01b3 commit 46b5406
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions test/animate_widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -520,33 +520,38 @@ void main() {
expect(outVal, null);

inVal = BoxDecoration(border: Border.all(width: 1));

model.notify();
await tester.pump();
expect('$outVal',
'BoxDecoration(border: Border.all(BorderSide(width: 0.0, style: none)))');

expect((outVal as BoxDecoration).border!.top.width, 0);

await tester.pump(Duration(milliseconds: 200));
expect('$outVal',
'BoxDecoration(border: Border.all(BorderSide(width: 0.2)))');
expect((outVal as BoxDecoration).border!.top.width, 0.2);

await tester.pump(Duration(milliseconds: 300));
expect('$outVal',
'BoxDecoration(border: Border.all(BorderSide(width: 0.5)))');
expect((outVal as BoxDecoration).border!.top.width, 0.5);

await tester.pump(Duration(milliseconds: 500));
expect('$outVal', 'BoxDecoration(border: Border.all(BorderSide))');
expect((outVal as BoxDecoration).border!.top.width, 1);

//

inVal = BoxDecoration(border: Border.all(width: 2));
model.notify();
await tester.pump();
expect('$outVal', 'BoxDecoration(border: Border.all(BorderSide))');
expect((outVal as BoxDecoration).border!.top.width, 1);

await tester.pump(Duration(milliseconds: 200));
expect('$outVal',
'BoxDecoration(border: Border.all(BorderSide(width: 1.2)))');
expect((outVal as BoxDecoration).border!.top.width.toStringAsFixed(1),
'1.2');

await tester.pump(Duration(milliseconds: 300));
expect('$outVal',
'BoxDecoration(border: Border.all(BorderSide(width: 1.5)))');
expect((outVal as BoxDecoration).border!.top.width.toStringAsFixed(1),
'1.5');

await tester.pump(Duration(milliseconds: 500));
expect('$outVal',
'BoxDecoration(border: Border.all(BorderSide(width: 2.0)))');
expect((outVal as BoxDecoration).border!.top.width, 2);
},
);

Expand Down

0 comments on commit 46b5406

Please sign in to comment.