Skip to content

Instantly share code, notes, and snippets.

View kishan2612's full-sized avatar

kishan V kishan2612

  • ChannelKonnect
  • Bangalore
View GitHub Profile
@kishan2612
kishan2612 / startanim.dart
Created December 29, 2018 15:09
startanimation
void _startAnimation(AnimationController _controller) {
_controller.fling(
velocity:isBackpanelVisible(widget._controller) ? -1.0 : 1.0);
}
bool isBackpanelVisible(AnimationController _controller) {
final AnimationStatus status =_controller.status;
return status == AnimationStatus.completed ||
status == AnimationStatus.forward;
}
@kishan2612
kishan2612 / frontview.dart
Last active December 29, 2018 14:57
frontview wrap
Widget _frontView() {
return SlideTransition(
position: _getSlideAnimation(),
child: ScaleTransition(
alignment: Alignment.centerLeft,
scale: _getScaleAnimation(),
child: _frontViewBody(),
));
}
@kishan2612
kishan2612 / layoutbuilder.dart
Created December 29, 2018 14:53
layoutbuilder
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: activityContainer,
);
}
Widget activityContainer(BuildContext context, BoxConstraints constraint) {
final ThemeData _theme = Theme.of(context);
return Container(
@kishan2612
kishan2612 / frontviewAnimations.dart
Created December 29, 2018 14:50
custom navigation drawer front view animations
/*
FrontView Slide Animation
*/
Animation<Offset> _getSlideAnimation() {
return Tween(begin: Offset(0.85, 0.0), end: Offset(0, 0)).animate(
CurvedAnimation(parent: widget._controller, curve: Curves.linear));
}
/*
@kishan2612
kishan2612 / main.dart
Created December 29, 2018 14:38
custom navigation drawer main view code
class _MyHomePageState extends State<MyHomePage>
with SingleTickerProviderStateMixin {
AnimationController _controller;
@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this, duration: const Duration(milliseconds: 100), value: 1.0);