2017-03-08 125 views
3

我正在尋找使用AnimatedContainertransform屬性動畫容器的規模;然而,規模並沒有被轉換,直接從頭到尾跳轉。如何使用AnimatedContainer的動畫變換(例如縮放)

代碼段:

var container = new AnimatedContainer(
    duration: const Duration(milliseconds: 200), 
    width: 50.0, 
    height: 50.0, 
    // selected is a bool that will be toggled 
    transform: selected ? new Matrix4.identity() : new Matrix4.identity().scaled(0.2,0.2), 
    decoration: new BoxDecoration(
    shape: BoxShape.circle, 
    backgroundColor: Colors.blue[500], 
), 
    child: new Center(
    child: new Icon(
     Icons.check, 
     color: Colors.white, 
    ), 
) 
); 

上發生了什麼事情上的任何見解?

回答