Widget build(BuildContext context) {
return GestureDetector(
onTap : () {
setState(() {
selected = !selected;
});
}, // onTap
child : center(
child : Container(
width : double.infinity,
height : 250.0,
color : Colors.blue,
child : AnimatedAlign(
alignment : selected ? Alignment.topRight : Alignment.bottomLeft,
duration : const Duration(seconds :1),
curve : Curves.fastOutSlowIn,
child : const FlutterLogo(size : 50),
) // AnimatedAligin
), // Container
), // Center
); // GestureDetector
}
마우스를 대면, flutter Logo가 선택될시 오른쪽아래에서 왼쪽아래로 움직이는것을 볼 수 있다.