This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _kDuration = const Duration(milliseconds: 2000); | |
const _kAnimInterval03 = const Interval(.00, .90); | |
... | |
Widget _buildAnimation(BuildContext context, Widget child) { | |
return Container( | |
child: Container( | |
width: _kActionSize * 4, | |
height: 256.0, | |
color: Colors.black87, | |
child: Center( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _kAnimInterval01 = const Interval(.00, .30); | |
const _kAnimInterval02 = const Interval(.00, .30); | |
const _kAnimInterval03 = const Interval(.30, .60); | |
const _kAnimInterval04 = const Interval(.60, .90); | |
const _kAnimInterval05 = const Interval(.60, .90); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tween<Offset>( | |
begin: Offset(-1.0, 0.0), | |
end: Offset(0.0, 0.0), | |
).animate( | |
CurvedAnimation( | |
parent: controller, | |
curve: Interval(.30, .60), | |
), | |
), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SlidableDrawerDelegateDemo extends StatefulWidget { | |
@override | |
_SlidableDrawerDelegateDemoState createState() => | |
new _SlidableDrawerDelegateDemoState(); | |
} | |
class _SlidableDrawerDelegateDemoState extends State<SlidableDrawerDelegateDemo> | |
with TickerProviderStateMixin { | |
AnimationController _controller; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
Widget build(BuildContext context) { | |
return AnimatedBuilder( | |
builder: _buildAnimation, | |
animation: controller, | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget _buildAnimation(BuildContext context, Widget child) { | |
return Container( | |
child: SkewTransition( | |
skew: skewTransform1, | |
child: SkewTransition( | |
skew: skewTransform2, | |
child: Container( | |
width: _kActionSize * 4, | |
height: 256.0, | |
color: Colors.black87, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SlidableDrawerDelegateAnimation({ | |
Key key, | |
this.controller, | |
}) : dxPositions = <Animation<Offset>>[ | |
Tween<Offset>( | |
begin: Offset(-1.0, 0.0), | |
end: Offset(1.0, 0.0), | |
).animate( | |
CurvedAnimation( | |
parent: controller, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Animates the skew of transformed widget. | |
class SkewTransition extends AnimatedWidget { | |
/// Creates a skew transition. | |
/// | |
/// The [skew] argument must not be null. | |
const SkewTransition({ | |
Key key, | |
@required Animation<double> skew, | |
this.child, | |
}) : super(key: key, listenable: skew); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _kDuration = const Duration(milliseconds: 4000); | |
const _kActionSize = 64.0; | |
const _kCount = 3; | |
const _kAnimInterval01 = const Interval(.00, .30); | |
const _kAnimInterval02 = const Interval(.00, .30); | |
const _kAnimInterval03 = const Interval(.30, .60); | |
const _kAnimInterval04 = const Interval(.60, .90); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
const _kDuration = const Duration(milliseconds: 4000); | |
const _kActionSize = 64.0; | |
const _kCount = 3; | |
const _kAnimInterval01 = const Interval(.00, .30); | |
const _kAnimInterval02 = const Interval(.00, .30); |