transform method
Return a transformed widget, based on child and TransformInfo
Implementation
@override
Widget transform(Widget item, TransformInfo info) {
double position = info.position;
Widget child = item;
if (_scale != null) {
double scaleFactor = (1 - position.abs()) * (1 - _scale!);
double scale = _scale! + scaleFactor;
child = new Transform.scale(
scale: scale,
child: item,
);
}
if (_fade != null) {
double fadeFactor = (1 - position.abs()) * (1 - _fade!);
double opacity = _fade! + fadeFactor;
child = new Opacity(
opacity: opacity,
child: child,
);
}
return child;
}