颤动的背景板高度

时间:2018-06-09 09:48:39

标签: android dart flutter

我。在一个扑动的应用程序上工作并尝试backdrop

我的动画由以下人员管理:

$account->rowQuery("SELECT (noOfChild * childPrice) AS totalChildPrice, 
(noOfAdult * adultPrice) AS totalAdultPrice, 
SUM(noOfChild * childPrice) AS sumForChild, 
SUM(noOfAdult * adultPrice) AS sumForAdult 
FROM booking ");

我正在构建的小部件如下:

Animation<RelativeRect> getPanelAnimation(BoxConstraints constraints) {
  final height = constraints.biggest.height;
  final backPanelHeight = height - header_height;
  final frontPanelHeight = -header_height;

  return new RelativeRectTween(
            begin: new RelativeRect.fromLTRB(
                0.0, backPanelHeight, 0.0, frontPanelHeight),
            end: new RelativeRect.fromLTRB(0.0, 0.0, 0.0, 0.0))
         .animate(new CurvedAnimation(
            parent: widget.controller, curve: Curves.linear));
}

现在,Widget bothPanels(BuildContext context, BoxConstraints constraints) { return new Scaffold( body: new Stack( children: <Widget>[ _getDrawerItemWidget(_selectedDrawerIndex), new PositionedTransition( rect: getPanelAnimation(constraints), child: new GestureDetector( onVerticalDragEnd: (details) { if (details.primaryVelocity == 0) return; widget.controller .fling(velocity: details.primaryVelocity > 0 ? -1.0 : 1.0); }, child: new Material( elevation: 12.0, borderRadius: new BorderRadius.only( topLeft: new Radius.circular(32.0), topRight: new Radius.circular(32.0), ), child: new Container( child: new Column( children: <Widget>[ new Container( height: header_height, child: new Center( child: new Text("Menu"), ), ), new Container( child: new Column( children: <Widget>[ new ListTile( title: new Text("Tile 1"), onTap: () { _onSelectDrawerItemWidget(0); widget.controller.fling(velocity: -1.0); }, ), new ListTile( title: new Text("Tile 2"), onTap: () { _onSelectDrawerItemWidget(1); widget.controller.fling(velocity: -1.0); }, ) ], )), ], )), ), ), ) ], ), ); } 告诉我们要去哪里,这一直都是。

我的end: new RelativeRect.fromLTRB(0.0, 0.0, 0.0, 0.0)(堆叠顶部)只有很少的线,所以我想让它上升到我需要的数量,而不是一直向上。

当然硬编码某些高度非常糟糕且无法维护...如何在Android中将此高度设为front panel

我的意思是:今天它有2个瓷砖,我希望它只是为了它们,但明天瓷砖可能是4,我想避免更改其他代码。

我该怎么办?我应该寻找什么?

0 个答案:

没有答案