Line data Source code
1 : import 'package:flutter/material.dart'; 2 : 3 : // ignore: public_member_api_docs 4 : class DownToUpTransition { 5 : // ignore: public_member_api_docs 6 3 : Widget buildTransition({ 7 : Curve curve = Curves.ease, 8 : required Animation<double> animation, 9 : required Widget child, 10 : }) { 11 : const begin = Offset(0, 1); 12 : const end = Offset.zero; 13 6 : final tween = Tween(begin: begin, end: end).chain( 14 3 : CurveTween(curve: curve), 15 : ); 16 3 : return SlideTransition( 17 3 : position: animation.drive(tween), 18 : child: child, 19 : ); 20 : } 21 : }