Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jonny Borges
2023-02-26 02:29:28 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
debc71c9c161078cdd7e32a3295a2c33b00bcd44
debc71c9
1 parent
01994919
add more animation tests
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
426 additions
and
78 deletions
lib/get_animations/animations.dart
lib/get_animations/extensions.dart
test/animations/extensions_test.dart
test/animations/get_animated_builder_test.dart
lib/get_animations/animations.dart
View file @
debc71c
import
'dart:math'
;
import
'dart:ui'
;
import
'package:flutter/widgets.dart'
;
import
'get_animated_builder.dart'
;
typedef
OffsetBuilder
=
Offset
Function
(
BuildContext
,
double
);
class
FadeInAnimation
extends
OpacityAnimation
{
FadeInAnimation
({
super
.
key
,
...
...
@@ -89,47 +92,83 @@ class ScaleAnimation extends GetAnimatedBuilder<double> {
);
}
class
SlideAnimation
extends
GetAnimatedBuilder
<
Offset
>
{
SlideAnimation
({
// class SlideAnimation extends GetAnimatedBuilder<Offset> {
// SlideAnimation({
// super.key,
// required super.duration,
// required super.delay,
// required super.child,
// super.onComplete,
// required Offset begin,
// required Offset end,
// super.idleValue = const Offset(0, 0),
// }) : super(
// builder: (context, value, child) => Transform.translate(
// offset: value,
// child: child,
// ),
// tween: Tween(begin: begin, end: end),
// );
// }
class
BounceAnimation
extends
GetAnimatedBuilder
<
double
>
{
BounceAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
required
super
.
child
,
super
.
onComplete
,
required
Offset
begin
,
required
Offset
end
,
super
.
idleValue
=
const
Offset
(
0
,
0
),
super
.
curve
=
Curves
.
bounceOut
,
required
double
begin
,
required
double
end
,
super
.
idleValue
=
0
,
})
:
super
(
builder:
(
context
,
value
,
child
)
=>
Transform
.
translate
(
offset:
value
,
builder:
(
context
,
value
,
child
)
=>
Transform
.
scale
(
scale:
1
+
value
.
abs
(),
child:
child
,
),
tween:
Tween
(
begin:
begin
,
end:
end
),
tween:
Tween
<
double
>
(
begin:
begin
,
end:
end
),
);
}
class
BounceAnimation
extends
GetAnimatedBuilder
<
double
>
{
BounceAnimation
({
class
SpinAnimation
extends
GetAnimatedBuilder
<
double
>
{
SpinAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
required
super
.
child
,
super
.
onComplete
,
super
.
curve
=
Curves
.
bounceOut
,
super
.
idleValue
=
0
,
})
:
super
(
builder:
(
context
,
value
,
child
)
=>
Transform
.
rotate
(
angle:
value
*
pi
/
180.0
,
child:
child
,
),
tween:
Tween
<
double
>(
begin:
0
,
end:
360
),
);
}
class
SizeAnimation
extends
GetAnimatedBuilder
<
double
>
{
SizeAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
required
super
.
child
,
super
.
onComplete
,
super
.
idleValue
=
0
,
required
double
begin
,
required
double
end
,
super
.
idleValue
=
0
,
})
:
super
(
builder:
(
context
,
value
,
child
)
=>
Transform
.
scale
(
scale:
1
+
value
.
abs
()
,
scale:
value
,
child:
child
,
),
tween:
Tween
<
double
>(
begin:
begin
,
end:
end
),
);
}
class
ShakeAnimation
extends
GetAnimatedBuilder
<
double
>
{
ShakeAnimation
({
class
BlurAnimation
extends
GetAnimatedBuilder
<
double
>
{
BlurAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
...
...
@@ -139,69 +178,207 @@ class ShakeAnimation extends GetAnimatedBuilder<double> {
required
double
end
,
super
.
idleValue
=
0
,
})
:
super
(
builder:
(
context
,
value
,
child
)
=>
Transform
.
rotate
(
angle:
value
*
pi
/
180.0
,
builder:
(
context
,
value
,
child
)
=>
BackdropFilter
(
filter:
ImageFilter
.
blur
(
sigmaX:
value
,
sigmaY:
value
,
),
child:
child
,
),
tween:
Tween
<
double
>(
begin:
begin
,
end:
end
),
);
}
class
SpinAnimation
extends
GetAnimatedBuilder
<
double
>
{
SpinAnimation
({
class
FlipAnimation
extends
GetAnimatedBuilder
<
double
>
{
FlipAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
required
super
.
child
,
super
.
onComplete
,
required
double
begin
,
required
double
end
,
super
.
idleValue
=
0
,
})
:
super
(
builder:
(
context
,
value
,
child
)
=>
Transform
.
rotate
(
angle:
value
*
pi
/
180.0
,
builder:
(
context
,
value
,
child
)
{
final
radians
=
value
*
pi
;
return
Transform
(
transform:
Matrix4
.
rotationY
(
radians
),
alignment:
Alignment
.
center
,
child:
child
,
);
},
tween:
Tween
<
double
>(
begin:
begin
,
end:
end
),
);
}
class
WaveAnimation
extends
GetAnimatedBuilder
<
double
>
{
WaveAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
required
super
.
child
,
super
.
onComplete
,
required
double
begin
,
required
double
end
,
super
.
idleValue
=
0
,
})
:
super
(
builder:
(
context
,
value
,
child
)
=>
Transform
(
transform:
Matrix4
.
translationValues
(
0.0
,
20.0
*
sin
(
value
*
pi
*
2
),
0.0
,
),
child:
child
,
),
tween:
Tween
<
double
>(
begin:
0
,
end:
360
),
tween:
Tween
<
double
>(
begin:
begin
,
end:
end
),
);
}
class
ColorAnimation
extends
GetAnimatedBuilder
<
Color
?>
{
ColorAnimation
({
class
WobbleAnimation
extends
GetAnimatedBuilder
<
double
>
{
WobbleAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
required
super
.
child
,
super
.
onComplete
,
required
Color
begin
,
required
Color
end
,
Color
?
idleColor
,
required
double
begin
,
required
double
end
,
super
.
idleValue
=
0
,
})
:
super
(
builder:
(
context
,
value
,
child
)
=>
ColorFiltered
(
colorFilter:
ColorFilter
.
mode
(
Color
.
lerp
(
begin
,
end
,
value
!.
value
.
toDouble
())!,
BlendMode
.
srcIn
,
),
builder:
(
context
,
value
,
child
)
=>
Transform
(
transform:
Matrix4
.
identity
()
..
setEntry
(
3
,
2
,
0.001
)
..
rotateZ
(
sin
(
value
*
pi
*
2
)
*
0.1
),
alignment:
Alignment
.
center
,
child:
child
,
),
idleValue:
idleColor
??
begin
,
tween:
ColorTween
(
begin:
begin
,
end:
end
),
tween:
Tween
<
double
>(
begin:
begin
,
end:
end
),
);
}
class
SizeAnimation
extends
GetAnimatedBuilder
<
double
>
{
SizeAnimation
({
class
SlideInLeftAnimation
extends
SlideAnimation
{
SlideInLeftAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
required
super
.
child
,
super
.
onComplete
,
required
super
.
begin
,
required
super
.
end
,
super
.
idleValue
=
0
,
})
:
super
(
offsetBuild:
(
context
,
value
)
=>
Offset
(
value
*
MediaQuery
.
of
(
context
).
size
.
width
,
0
),
);
}
class
SlideInRightAnimation
extends
SlideAnimation
{
SlideInRightAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
required
super
.
child
,
super
.
onComplete
,
required
super
.
begin
,
required
super
.
end
,
super
.
idleValue
=
0
,
})
:
super
(
offsetBuild:
(
context
,
value
)
=>
Offset
((
1
-
value
)
*
MediaQuery
.
of
(
context
).
size
.
width
,
0
),
);
}
class
SlideInUpAnimation
extends
SlideAnimation
{
SlideInUpAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
required
super
.
child
,
super
.
onComplete
,
required
super
.
begin
,
required
super
.
end
,
super
.
idleValue
=
0
,
})
:
super
(
offsetBuild:
(
context
,
value
)
=>
Offset
(
0
,
value
*
MediaQuery
.
of
(
context
).
size
.
height
),
);
}
class
SlideInDownAnimation
extends
SlideAnimation
{
SlideInDownAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
required
super
.
child
,
super
.
onComplete
,
required
super
.
begin
,
required
super
.
end
,
super
.
idleValue
=
0
,
})
:
super
(
offsetBuild:
(
context
,
value
)
=>
Offset
(
0
,
(
1
-
value
)
*
MediaQuery
.
of
(
context
).
size
.
height
),
);
}
class
SlideAnimation
extends
GetAnimatedBuilder
<
double
>
{
SlideAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
required
super
.
child
,
required
double
begin
,
required
double
end
,
required
OffsetBuilder
offsetBuild
,
super
.
onComplete
,
super
.
idleValue
=
0
,
})
:
super
(
builder:
(
context
,
value
,
child
)
=>
Transform
.
scale
(
scale:
value
,
builder:
(
context
,
value
,
child
)
=>
Transform
.
translate
(
offset:
offsetBuild
(
context
,
value
),
child:
child
,
),
tween:
Tween
<
double
>(
begin:
begin
,
end:
end
),
);
}
// class ZoomAnimation extends GetAnimatedBuilder<double> {
// ZoomAnimation({
// super.key,
// required super.duration,
// required super.delay,
// required super.child,
// super.onComplete,
// required double begin,
// required double end,
// super.idleValue = 0,
// }) : super(
// builder: (context, value, child) => Transform.scale(
// scale: lerpDouble(1, end, value)!,
// child: child,
// ),
// tween: Tween<double>(begin: begin, end: end),
// );
// }
class
ColorAnimation
extends
GetAnimatedBuilder
<
Color
?>
{
ColorAnimation
({
super
.
key
,
required
super
.
duration
,
required
super
.
delay
,
required
super
.
child
,
super
.
onComplete
,
required
Color
begin
,
required
Color
end
,
Color
?
idleColor
,
})
:
super
(
builder:
(
context
,
value
,
child
)
=>
ColorFiltered
(
colorFilter:
ColorFilter
.
mode
(
Color
.
lerp
(
begin
,
end
,
value
!.
value
.
toDouble
())!,
BlendMode
.
srcIn
,
),
child:
child
,
),
idleValue:
idleColor
??
begin
,
tween:
ColorTween
(
begin:
begin
,
end:
end
),
);
}
...
...
lib/get_animations/extensions.dart
View file @
debc71c
...
...
@@ -81,8 +81,9 @@ extension AnimationExtension on Widget {
}
GetAnimatedBuilder
slide
({
required
Offset
begin
,
required
Offset
end
,
required
OffsetBuilder
offset
,
double
begin
=
0
,
double
end
=
1
,
Duration
duration
=
_defaultDuration
,
Duration
delay
=
_defaultDelay
,
ValueSetter
<
AnimationController
>?
onComplete
,
...
...
@@ -94,6 +95,7 @@ extension AnimationExtension on Widget {
begin:
begin
,
end:
end
,
onComplete:
onComplete
,
offsetBuild:
offset
,
child:
this
,
);
}
...
...
@@ -116,7 +118,21 @@ extension AnimationExtension on Widget {
);
}
GetAnimatedBuilder
shake
({
GetAnimatedBuilder
spin
({
Duration
duration
=
_defaultDuration
,
Duration
delay
=
_defaultDelay
,
ValueSetter
<
AnimationController
>?
onComplete
,
bool
isSequential
=
false
,
})
{
return
SpinAnimation
(
duration:
duration
,
delay:
_getDelay
(
isSequential
,
delay
),
onComplete:
onComplete
,
child:
this
,
);
}
GetAnimatedBuilder
size
({
required
double
begin
,
required
double
end
,
Duration
duration
=
_defaultDuration
,
...
...
@@ -124,7 +140,7 @@ extension AnimationExtension on Widget {
ValueSetter
<
AnimationController
>?
onComplete
,
bool
isSequential
=
false
,
})
{
return
S
hak
eAnimation
(
return
S
iz
eAnimation
(
duration:
duration
,
delay:
_getDelay
(
isSequential
,
delay
),
begin:
begin
,
...
...
@@ -134,29 +150,51 @@ extension AnimationExtension on Widget {
);
}
GetAnimatedBuilder
spin
({
GetAnimatedBuilder
blur
({
double
begin
=
0
,
double
end
=
15
,
Duration
duration
=
_defaultDuration
,
Duration
delay
=
_defaultDelay
,
ValueSetter
<
AnimationController
>?
onComplete
,
bool
isSequential
=
false
,
})
{
return
SpinAnimation
(
return
BlurAnimation
(
duration:
duration
,
delay:
_getDelay
(
isSequential
,
delay
),
begin:
begin
,
end:
end
,
onComplete:
onComplete
,
child:
this
,
);
}
GetAnimatedBuilder
flip
({
double
begin
=
0
,
double
end
=
1
,
Duration
duration
=
_defaultDuration
,
Duration
delay
=
_defaultDelay
,
ValueSetter
<
AnimationController
>?
onComplete
,
bool
isSequential
=
false
,
})
{
return
FlipAnimation
(
duration:
duration
,
delay:
_getDelay
(
isSequential
,
delay
),
begin:
begin
,
end:
end
,
onComplete:
onComplete
,
child:
this
,
);
}
GetAnimatedBuilder
size
({
required
double
begin
,
required
double
end
,
GetAnimatedBuilder
wave
({
double
begin
=
0
,
double
end
=
1
,
Duration
duration
=
_defaultDuration
,
Duration
delay
=
_defaultDelay
,
ValueSetter
<
AnimationController
>?
onComplete
,
bool
isSequential
=
false
,
})
{
return
Siz
eAnimation
(
return
Wav
eAnimation
(
duration:
duration
,
delay:
_getDelay
(
isSequential
,
delay
),
begin:
begin
,
...
...
test/animations/extensions_test.dart
View file @
debc71c
...
...
@@ -101,14 +101,14 @@ void main() {
testWidgets
(
'slide() returns a SlideAnimation'
,
(
WidgetTester
tester
)
async
{
const
begin
=
Offset
.
zero
;
const
end
=
Offset
.
zero
;
const
begin
=
0
;
const
end
=
1
;
final
widget
=
buildWidget
();
final
animation
=
widget
.
slide
(
begin:
begin
,
end:
end
);
final
animation
=
widget
.
slide
(
offset:
(
_
,
__
)
=>
const
Offset
(
0
,
0
)
);
expect
(
animation
,
isA
<
SlideAnimation
>());
_testDefaultValues
<
Offset
>
(
_testDefaultValues
(
animation:
animation
,
widget:
widget
,
begin:
begin
,
end:
end
);
});
...
...
@@ -130,39 +130,65 @@ void main() {
);
});
testWidgets
(
'shake() returns a ShakeAnimation'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'spin() returns a SpinAnimation'
,
(
WidgetTester
tester
)
async
{
final
widget
=
buildWidget
();
const
begin
=
0.0
;
const
end
=
360
;
final
animation
=
widget
.
spin
();
expect
(
animation
,
isA
<
SpinAnimation
>());
_testDefaultValues
(
animation:
animation
,
widget:
widget
,
begin:
begin
,
end:
end
);
});
testWidgets
(
'size() returns a SizeAnimation'
,
(
WidgetTester
tester
)
async
{
final
widget
=
buildWidget
();
const
begin
=
0.9
;
const
end
=
1.1
;
final
animation
=
widget
.
size
(
begin:
begin
,
end:
end
);
expect
(
animation
,
isA
<
SizeAnimation
>());
_testDefaultValues
(
animation:
animation
,
widget:
widget
,
begin:
begin
,
end:
end
);
});
testWidgets
(
'blur() returns a BlurAnimation'
,
(
WidgetTester
tester
)
async
{
final
widget
=
buildWidget
();
final
animation
=
widget
.
shake
(
begin:
begin
,
end:
end
);
expect
(
animation
,
isA
<
ShakeAnimation
>());
const
begin
=
0.9
;
const
end
=
1.1
;
final
animation
=
widget
.
blur
(
begin:
begin
,
end:
end
);
expect
(
animation
,
isA
<
BlurAnimation
>());
_testDefaultValues
(
animation:
animation
,
widget:
widget
,
begin:
begin
,
end:
end
);
});
testWidgets
(
'
spin() returns a Spin
Animation'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'
flip() returns a Flip
Animation'
,
(
WidgetTester
tester
)
async
{
final
widget
=
buildWidget
();
const
begin
=
0.0
;
const
end
=
360
;
final
animation
=
widget
.
spin
();
expect
(
animation
,
isA
<
SpinAnimation
>());
const
begin
=
0.9
;
const
end
=
1.1
;
final
animation
=
widget
.
flip
(
begin:
begin
,
end:
end
);
expect
(
animation
,
isA
<
FlipAnimation
>());
_testDefaultValues
(
animation:
animation
,
widget:
widget
,
begin:
begin
,
end:
end
);
});
testWidgets
(
'
size() returns a Size
Animation'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'
wave() returns a Flip
Animation'
,
(
WidgetTester
tester
)
async
{
final
widget
=
buildWidget
();
const
begin
=
0.9
;
const
end
=
1.1
;
final
animation
=
widget
.
siz
e
(
begin:
begin
,
end:
end
);
final
animation
=
widget
.
wav
e
(
begin:
begin
,
end:
end
);
expect
(
animation
,
isA
<
Siz
eAnimation
>());
expect
(
animation
,
isA
<
Wav
eAnimation
>());
_testDefaultValues
(
animation:
animation
,
widget:
widget
,
begin:
begin
,
end:
end
);
...
...
test/animations/get_animated_builder_test.dart
View file @
debc71c
...
...
@@ -325,45 +325,124 @@ void main() {
await
tester
.
pumpAndSettle
();
});
testWidgets
(
'
Slid
eAnimation'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'
Wav
eAnimation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
Slid
eAnimation
(
Wav
eAnimation
(
duration:
const
Duration
(
seconds:
1
),
delay:
Duration
.
zero
,
begin:
Offset
.
zero
,
end:
const
Offset
(
1.0
,
1.0
),
begin:
1.0
,
end:
2.0
,
child:
Container
(),
),
);
expect
(
find
.
byType
(
Slid
eAnimation
),
findsOneWidget
);
expect
(
find
.
byType
(
Wav
eAnimation
),
findsOneWidget
);
await
tester
.
pumpAndSettle
();
});
testWidgets
(
'
Bounc
eAnimation'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'
Wobbl
eAnimation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
Bounc
eAnimation
(
Wobbl
eAnimation
(
duration:
const
Duration
(
seconds:
1
),
delay:
Duration
.
zero
,
begin:
0.0
,
end:
1.0
,
begin:
1.0
,
end:
2.0
,
child:
Container
(),
),
);
expect
(
find
.
byType
(
BounceAnimation
),
findsOneWidget
);
expect
(
find
.
byType
(
WobbleAnimation
),
findsOneWidget
);
await
tester
.
pumpAndSettle
();
});
testWidgets
(
'SlideAnimation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
SlideAnimation
(
offsetBuild:
(
p0
,
p1
)
=>
const
Offset
(
1.0
,
1.0
),
duration:
const
Duration
(
seconds:
1
),
delay:
Duration
.
zero
,
begin:
0
,
end:
1
,
child:
Container
(),
),
);
expect
(
find
.
byType
(
SlideAnimation
),
findsOneWidget
);
await
tester
.
pumpAndSettle
();
});
testWidgets
(
'SlideInLeftAnimation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_Wrapper
(
child:
SlideInLeftAnimation
(
duration:
const
Duration
(
seconds:
1
),
delay:
Duration
.
zero
,
begin:
1.0
,
end:
2.0
,
child:
Container
(),
),
),
);
expect
(
find
.
byType
(
SlideInLeftAnimation
),
findsOneWidget
);
await
tester
.
pumpAndSettle
();
});
testWidgets
(
'SlideInRightAnimation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_Wrapper
(
child:
SlideInRightAnimation
(
duration:
const
Duration
(
seconds:
1
),
delay:
Duration
.
zero
,
begin:
1.0
,
end:
2.0
,
child:
Container
(),
),
),
);
expect
(
find
.
byType
(
SlideInRightAnimation
),
findsOneWidget
);
await
tester
.
pumpAndSettle
();
});
testWidgets
(
'SlideInUpAnimation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_Wrapper
(
child:
SlideInUpAnimation
(
duration:
const
Duration
(
seconds:
1
),
delay:
Duration
.
zero
,
begin:
1.0
,
end:
2.0
,
child:
Container
(),
),
),
);
expect
(
find
.
byType
(
SlideInUpAnimation
),
findsOneWidget
);
await
tester
.
pumpAndSettle
();
});
testWidgets
(
'SlideInDownAnimation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_Wrapper
(
child:
SlideInDownAnimation
(
duration:
const
Duration
(
seconds:
1
),
delay:
Duration
.
zero
,
begin:
1.0
,
end:
2.0
,
child:
Container
(),
),
),
);
expect
(
find
.
byType
(
SlideInDownAnimation
),
findsOneWidget
);
await
tester
.
pumpAndSettle
();
});
testWidgets
(
'
Shak
eAnimation'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'
Bounc
eAnimation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
Shak
eAnimation
(
Bounc
eAnimation
(
duration:
const
Duration
(
seconds:
1
),
delay:
Duration
.
zero
,
begin:
0.0
,
end:
1
0
.0
,
end:
1.0
,
child:
Container
(),
),
);
expect
(
find
.
byType
(
Shak
eAnimation
),
findsOneWidget
);
expect
(
find
.
byType
(
Bounc
eAnimation
),
findsOneWidget
);
await
tester
.
pumpAndSettle
();
});
...
...
@@ -406,4 +485,32 @@ void main() {
expect
(
find
.
byType
(
SizeAnimation
),
findsOneWidget
);
await
tester
.
pumpAndSettle
();
});
testWidgets
(
'BlurAnimation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
BlurAnimation
(
duration:
const
Duration
(
seconds:
1
),
delay:
Duration
.
zero
,
begin:
1.0
,
end:
2.0
,
child:
Container
(),
),
);
expect
(
find
.
byType
(
BlurAnimation
),
findsOneWidget
);
await
tester
.
pumpAndSettle
();
});
testWidgets
(
'FlipAnimation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
FlipAnimation
(
duration:
const
Duration
(
seconds:
1
),
delay:
Duration
.
zero
,
begin:
1.0
,
end:
2.0
,
child:
Container
(),
),
);
expect
(
find
.
byType
(
FlipAnimation
),
findsOneWidget
);
await
tester
.
pumpAndSettle
();
});
}
...
...
Please
register
or
login
to post a comment